diff options
-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 +... |