For a transit app with mobile tickets, what must the phone be able to do alone, and what can only the server own?
answer
- split by authority and point of use
- what must work underground?
- a bought ticket shows offline
- prices, payments, voids: server only
- agree how late a void may land
basics
~20 sWith no signal, the phone alone must show a ticket already bought and stored schedules for saved lines. Only the server can own fares, payment, issuing tickets, voiding refunded ones and live departures, so voids reach an offline phone late.
solid answer
~40 sI split by **authority and point of use**. With no signal, the device must show a ticket the rider already bought, including after a relaunch, plus stored schedules for the rider's lines, marked as scheduled rather than live. The server owns everything that needs one authoritative answer: **fare rules and prices**, **payment authorisation**, **issuing** a ticket, **voiding** a refunded one, and **live departures**, which come from vehicle data the phone never sees. Buying therefore needs a connection, and I say so. The split creates one trade-off to agree aloud: a voided ticket may still display on a phone that has been offline since the refund, so the business accepts a window, and how a gate or inspector checks validity is left to the security deep dive.
go deeper
Recall the two sides: a bought ticket must show on the phone with no signal; prices, payments and refunds are decided by the server.
Explain the two tests, point of use and authority, apply them capability by capability, and state that buying a ticket needs a connection.
Name the trade-offs the split creates, late voids on offline phones, an untrusted device clock and rules frozen into old builds, and hand each to its deep dive with an agreed bound.
Frame the void window as an operator decision with a price: how much fare loss is acceptable in exchange for a ticket that never fails at the gate.
## The split is a requirements decision In a mobile design round the **client/server split** is often treated as an architecture detail settled while drawing boxes. It is better settled during requirements, because it answers a requirements question: *which things must keep working when the phone cannot reach the server, and which things must never be decided by the phone?* Two tests sort each capability: - **Point of use**: where is the rider when they need it? A ticket is needed at a gate that may be underground with no signal. - **Authority**: does it need one answer that every rider, gate and inspector agrees on? A price, a refund or a live vehicle position does. A capability that must work at the point of use with no signal has to be possible on the device alone. A capability that needs one authoritative answer belongs to the server, even if the phone could compute something similar. ## What the phone must do alone - **Show a ticket the rider already bought**, with its validity period and a scannable code, with no signal: after the app was closed, after the operating system ended it in the background, after a restart. - **Show stored schedules** for the rider's saved lines and stops, labelled as scheduled times with the moment they were last updated. - **Plan simple trips on stored schedules**, if the interviewer wants an offline planner; otherwise state plainly that planning needs a connection. - **Keep the rider's own settings**, such as saved stops and accessibility preferences, without the network. Each line is a requirement, not a mechanism. How the ticket is stored, kept current or protected from copying is decided in the storage, sync and security deep dives. ## What only the server can own - **Fares and prices**: zones, concessions, peak pricing and price changes must be identical for everyone; an old build computing fares would charge yesterday's prices. - **Payment authorisation**: the payment provider and the back end decide whether money moved. - **Issuing a ticket**: a ticket exists because the server issued it, never because the app created one. - **Voiding**: refunds, chargebacks and fraud blocks are decisions only the operator can make. - **Live departures**: they come from vehicle and operations data the phone never sees. ## The split at a glance | Capability | Owner | Works with no signal? | |---|---|---| | Show a bought ticket | Device, from what it already holds | Yes: the hard requirement | | Scheduled times for saved lines | Device, from stored schedules | Yes, labelled as scheduled | | Live departures | Server | No: show the last known times with their age | | Price a journey | Server | No | | Buy a ticket | Server and payment provider | No: tell the rider before they go underground | | Void a refunded ticket | Server | Reaches the phone only when it reconnects | ## The trade-offs the split creates 1. **Purchases need a connection.** Saying so is part of scoping. The requirement it produces is about the experience: encourage buying before the rider goes underground, and never show a ticket as bought until the device actually holds it. 2. **Server decisions arrive late on an offline phone.** A ticket voided after a refund may still display on a phone that has not reconnected. The business either accepts that window or makes the gate or inspector, not the rider's phone, the place a void is enforced. How is the security deep dive's question. 3. **The phone's clock is not an authority.** A countdown on the ticket reads the device clock, which a rider can change. Name it as a requirement for the validity check; do not solve it here. 4. **Old app versions keep running.** Anything placed on the device, such as fare logic, is frozen into every build in the field for as long as riders keep it installed. That is the strongest argument for keeping rules on the server. ## Mistakes - Putting fare calculation in the app to save a round trip, which freezes pricing rules into builds the operator cannot recall. - Making the ticket screen depend on a network call, so it fails exactly where it is needed. - Treating a voided ticket as instantly revoked on every phone, which an offline device cannot honour. - Splitting by convenience, whatever is easiest to build first, instead of by point of use and authority.
- Could the transit app compute fares on the phone so pricing works offline?It could show a cached price list as a hint, but the authoritative price must come from the server at purchase. Fare rules change, concessions depend on the rider's account, and every installed build would freeze the rules it shipped with. Since buying needs a connection anyway, local pricing gains little and risks charging the wrong amount.
- How do you phrase the voided-ticket window as a requirement?As an agreed bound plus an owner: 'a ticket voided while the phone is offline may still display until the phone next connects; the gate or inspector side rejects it, and the app removes it on its next update.' That names who enforces the void without designing how, which the security and sync deep dives own.
- Fare rules can live in the app because they rarely change
- A voided ticket disappears from every phone the moment it is voided
- The ticket screen can fetch the ticket from the server each time
- Offline support means every feature works without a connection
- Stored timetables let the phone show live departure times offline