Section 2: The Contract You Will Be Held To - Requirements (Functional & Non-Functional)
Executive Summary: This section converts Section 1's clarifying answers into a contract: five functional requirements, each demo-able on a phone; four non-goals, each with the Section 12 door that reopens it; then the numbers — three latency budgets, a deliberately uneven availability split, and the mobile battery budget most candidates never mention — and finally privacy, written into the requirements rather than a settings screen.
Requirements are where this interview quietly separates people. The weak version is a wish list — "fast", "reliable", "real time" — adjectives that commit to nothing and can therefore never be violated. The Staff version is a contract: sentences a QA engineer could test, numbers an on-call engineer could be paged for missing. Write it badly and Section 7's push-versus-pull debate is a matter of taste.
Functional Requirements, as Things You Can Demo
Each is a sentence about a person holding a phone, not a system.
| # | Requirement | The demo |
|---|---|---|
| F1 | A user can opt in and share their live location with the people they choose | Maya flips sharing on; her phone begins posting a point every thirty seconds |
| F2 | A user can see which friends are currently nearby, with an approximate distance | Maya opens the app and sees "Raj, 1.2 km away" |
| F3 | A user is notified when a friend arrives nearby | Raj's phone buzzes once as Maya walks into range of Dolores Park |
| F4 | A user can stop sharing instantly and disappear from every friend's view | Maya hits the off switch; within seconds she is gone from Raj's screen, not shown as "last seen" |
| F5 | Sharing granularity is per friend group, not all-or-nothing | Maya shares with "close friends" and not with four hundred acquaintances |
F3 is the requirement that reshapes the architecture. F2 is a question — "who is near me right now?" — answered by a stateless query against an index. F3 is an event, and events require that somebody remembered the previous answer: "notify on arrival" commits you to per-pair state. A design that answers F2 with a radius query over everybody can still serve F3 — by re-running that query on every location write and intersecting it with the friend list — but F3 is what forces it to, which is a very different bill from answering F2 once per app open. Section 7 prices that difference; Section 8 owns the state machine the requirement obliges to exist.
F4 looks like a settings checkbox and is a distributed systems requirement. "Disappear" means the cached copy of Maya's location is deleted, nothing further is published into her friends' channels, and messages already published are invalidated on arrival rather than recalled — a fan-out of its own, which Section 9 interrogates.
Quick check before moving on:
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson