diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-05-29 18:11:21 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-05-29 18:11:21 +0300 |
commit | 32f2afbf34b9316094ded907e02e16c311119279 (patch) | |
tree | c12a3c87c33bbd04833795d236964e1f4f17adeb | |
parent | 24b554052f832a8f72714c9cd8f7c52a06e1958d (diff) | |
download | oso-work-sample-32f2afbf34b9316094ded907e02e16c311119279.tar.gz |
restate problem
Sponsored-by: author
-rw-r--r-- | README.md | 80 |
1 files changed, 80 insertions, 0 deletions
@@ -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 +... |