skip to content

In a transit app design round, the interviewer adds that tickets are scanned at underground gates with no signal; what does that requirement change across the design?

level: seniorimportance: must knowfreq 52%

answer

  1. the requirement that reorders everything
  2. bought means stored on the device
  3. cold start, flight mode, ticket shows
  4. nothing on the launch path may wait
  5. server decisions now arrive late

basics

~20 s

Signal-free gates make the phone the home of a bought ticket: a purchase is not done until the ticket is stored, the ticket opens from a cold start with no network or blocking check, and server decisions such as voids arrive late.

solid answer

~50 s

No signal at the gate turns the device into the place a bought ticket lives. **A purchase completes when the ticket is stored on the phone**, not when the payment succeeds. The ticket must open from a **cold start with no network**, because the operating system may end a backgrounded app at any time, so nothing on that path may wait for the network: not a session refresh, not a forced-update check, not a remote-config fetch, and an expired session must not hide a paid ticket. The latency target becomes tap-to-ticket **offline**. Validity must be checkable without the phone calling home, and the device clock cannot be trusted; both go to the security deep dive. Server decisions such as a refund's void reach the phone late, so that window is agreed with the business. I rank it first and design around it.

go deeper

for a junior

Recall that a ticket needed underground must already be on the phone, and must open with no network even after the app has been closed.

for a middle

Explain why purchase completion moves to 'stored on the device', and why nothing on the launch path may wait for the network.

for a senior

Rank this requirement first, walk the launch path from a cold start, name the late-void and clock trade-offs, and hand each mechanism to its deep dive without solving it.

for a principal

Frame the void window and the lost-phone policy as operator decisions with a cost, not as engineering details.

## Why one requirement can reshape a design Most requirements adjust a design: a data budget changes a refresh interval, a large-text requirement changes a layout. A few **reshape** it, because they change where the truth lives or which paths may touch the network. For a transit app, 'tickets are scanned at underground gates with no signal' is that requirement. A senior candidate recognises it when it is said, ranks it first, and lets it constrain every later box in the diagram, without solving storage, sync or security on the spot. ## What it changes | Area | If signal were assumed | With no signal at the gate | |---|---|---| | Where a bought ticket lives | Fetched from the server when shown | Held on the device before the rider reaches the gate | | When a purchase is done | When payment succeeds | When the ticket is stored on the phone | | Launch path to the ticket | May call the network first | Must not wait on any network call | | Expired session | Sign in again, then show the ticket | A paid ticket still shows; signing in can wait | | Latency target | Tap to ticket on a good network | Tap to ticket from a cold start, offline | | Validity check | The server answers | Checkable without the phone calling home | | Refunds and voids | Visible at once | Reach the phone only when it reconnects | ## The launch path, end to end Walk the rider's moment at the gate as a sequence of conditions the design must already satisfy: 1. **The app may not be running.** Both major mobile platforms may end or tear down a backgrounded app at any time to reclaim resources, so the ticket must open from a cold start, never only from memory. 2. **There is no network.** Anything the app usually does at launch, such as refreshing a session token, checking for a forced update, fetching remote configuration or loading a home screen's data, must not stand between the icon and the ticket. Each can run later without hiding it. 3. **The session may have expired.** An expired session is a reason to sign in again *later*, not a reason to hide a ticket the rider paid for. What sign-out does to stored tickets, whether it keeps, hides or removes them, is a policy to state. 4. **The battery may be low.** The ticket screen should be cheap to show and easy for a gate reader to scan, which may mean raising screen brightness while it is visible. 5. **The phone may be old.** The time target must hold on the oldest supported device class, not only on a new phone. ## Questions it forces - Is the gate itself online, or does it also check tickets offline? The answer decides who can enforce a void. - Can a ticket move to a new phone, and what happens when a phone is lost? - How late may a refund's void reach a phone that stays offline, and who absorbs that cost? - Must a rider be able to *buy* underground? Usually not, and saying so is a scoping decision. ## Where each consequence is designed The requirement belongs to the opening of the round; its mechanisms do not. Name each and move on: - How tickets are stored and survive restarts: the caching and local storage deep dive. - How tickets and voids are brought up to date after reconnecting: the offline sync deep dive. - How a ticket resists copying, and how validity is proven without the network: the device security deep dive. - How launch stays fast and cheap on old phones: the device resource budgets deep dive. - How a forced-update check coexists with an offline ticket: the old-app-versions part of the backend contract. ## Mistakes - Treating offline as 'show a cached copy of the last screen', which fails after a cold start. - Calling the purchase complete on payment success while the ticket exists only on the server. - Letting a session refresh or an update check block launch, so an expired session hides a paid ticket. - Designing mechanisms such as encryption or a sync protocol before the requirement is agreed and ranked.

  • The team wants a forced-update check at launch. How do you reconcile it with the offline ticket?
    Run the check, but never in front of the ticket. If it cannot complete, the app carries on; if it says an update is required, the ticket stays reachable anyway, because a rider at an underground gate cannot download an update there. How the version gate works belongs to the backend contract's deep dive; the requirement is that it never blocks a paid ticket.
  • How would you state this requirement so it can be verified before release?
    As a condition sequence: buy a ticket, end the app, restart the phone, turn on flight mode, let the session expire, open the app; the ticket must appear within the agreed time on the oldest supported device. That makes the requirement checkable; designing the test cases themselves belongs to mobile test design.

  • Offline support just means caching the last screen the user saw
  • A ticket purchase is done as soon as the payment succeeds
  • An expired session should hide tickets until the rider signs in
  • The OS keeps the app in memory between purchase and the gate
  • The phone's clock can be trusted to decide ticket validity