Case study demo
Nearby friends
Stream location updates and find friends within a radius.
An interactive demo of how this system behaves. It runs in your browser.
Full interview walkthroughRide hailing (Uber)Concept it usesAPI styles: REST, gRPC, WebSockets and SSEConcept it usesMessage queues and KafkaConcept it usesGeospatial indexes: finding what is nearby
Design it
Live places that are close enough, at a cost the server can take
Forty people walk or cycle around a 2 km town, and each phone sends its place to the server. The server shows each person which friends are within 500 m. Like a ride-hailing app showing nearby drivers, it must be close to the truth without flooding the server. Pick how often phones send, and what the server does with places that stop coming.
The goals
- A friend's place on screen is at most 15 m off, on average.
- The server gets at most 10 place updates a second.
- After 8 phones lose signal, none of them is still shown as nearby.
Each phone sends its place every
A place that has stopped coming
The check runs the same engine as the demo on this page for 40 simulated seconds under each condition, with a fixed seed, so a design always gets the same result. There is no score: each goal passes or fails.