summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-05-29 18:11:21 +0300
committerLars Wirzenius <liw@liw.fi>2021-05-29 18:11:21 +0300
commit32f2afbf34b9316094ded907e02e16c311119279 (patch)
treec12a3c87c33bbd04833795d236964e1f4f17adeb
parent24b554052f832a8f72714c9cd8f7c52a06e1958d (diff)
downloadoso-work-sample-32f2afbf34b9316094ded907e02e16c311119279.tar.gz
restate problem
Sponsored-by: author
-rw-r--r--README.md80
1 files changed, 80 insertions, 0 deletions
diff --git a/README.md b/README.md
index a2aed58..4c0dfc6 100644
--- a/README.md
+++ b/README.md
@@ -2,3 +2,83 @@
This is the work sample for my job application for a developer
position for OSO.
+
+## Re-statement of problem
+
+To clarify the problem for myself, I am re-stating it. This will also
+work to make sure I've understood it in the intended way when we
+discuss this.
+
+The goal is to write a server, which communicates with a client using
+messages over HTTP. The client has a list of integers, and the asks
+the server to figure out what is the largest integer in the list. The
+crux is that the client does not send the server the whole list, but
+only small messages and the server needs to, effectively, ask the
+client to do pairwise comparisons of integers.
+
+The possible messages sent by the client and the server are listed
+below, as examples. Communication is started by client by a "start
+computation" message. Server responds with a suitable message, which
+causes the client to make a new HTTP request with the response to the
+server's message. This continues until the server sends a message
+with result it has come up with.
+
+## Client request: start computation
+
+~~~json
+{
+ "type": "compute_max",
+ "length": 2
+}
+~~~
+
+## Server response: request computation
+
+~~~json
+{
+ "type": "compare",
+ "left": 0,
+ "right": 1,
+ "request_id": 7
+}
+~~~
+
+## Client request: computation result
+
+~~~json
+{
+ "type": "comp_result",
+ "answer": true,
+ "request_id": 7
+}
+~~~
+
+## Server response: result
+
+~~~json
+{
+ "type": "one",
+ "result": 2
+}
+~~~
+
+# Example
+
+~~~plantuml
+@startuml
+
+Alice -> Bob: Authentication Request
+Bob --> Alice: Authentication Response
+
+Alice -> Bob: Another authentication Request
+
+@enduml
+~~~
+
+
+---
+title: OSO work sample
+author: Lars Wirzenius
+classes:
+- json
+...