skip to content

In a food-delivery app's client block diagram, how do you show each box earns its place, and which missing box is the classic gap?

level: middleimportance: should knowfreq 38%

answer

  1. a requirement behind every box
  2. what breaks if it is gone
  3. reopening in a lift, mid-order
  4. a state holder dies with the process
  5. merge a box out loud

basics

~20 s

Tie each box to a requirement it serves and merge or drop any box nothing needs. The classic gap is no local store: an app that must reopen mid-order without signal needs the active order, cart and addresses on disk.

solid answer

~50 s

I walk the diagram box by box and name the requirement that pays for each one, and what breaks without it. The **local store** is paid for by "reopen the app in a lift mid-order and still see the order, the cart and my addresses": without it every screen waits on the network, and a process ended in the background takes the cart with it. The **push handler** is paid for by "tell me the courier picked up my order while the app is closed". The **sync engine** is the box to challenge: placing an order needs the network anyway, so there is no offline queue of orders, and its job may shrink to keeping the active order current, or merge into the repository, said out loud. A box I cannot tie to a requirement comes off the board.

go deeper

for a junior

Recall that each box should answer a requirement, and that an app reopened mid-order needs some data on disk: the active order, the cart and saved addresses.

for a middle

Explain the audit: the requirement behind each box and what breaks without it, and why a screen's state holder cannot stand in for the local store across a process restart.

for a senior

Show judgment by shrinking or merging a box out loud, such as a sync engine with little to sync, and by keeping the local store small and purposeful rather than caching everything.

for a principal

Frame the audit as cost: every box is code, tests and a failure mode owned for years on devices you cannot update, so a box with no requirement behind it is a liability, not thoroughness.

## What "earning its place" means Drawing the common client diagram is the easy part of a mobile design round; any candidate can recite UI, state holders, repository, local store, network client, sync engine and push handler. What the interviewer actually checks is whether **each box is there for a reason this app has**. A box earns its place when you can name the requirement it serves and say what breaks without it. A box nothing pays for should be merged or dropped, and a box the requirements demand must not be missing. That makes the diagram an argument rather than a picture. For a food-delivery customer app (browse restaurants and menus, a cart and checkout, live order tracking with a courier on a map, a push on each status change) the argument runs box by box. ## Box by box for the food-delivery app | Box | The requirement that pays for it | What breaks without it | |---|---|---| | **UI** | Browse, order and track | Nothing to show | | **State holder** | Screens with real logic: cart edits, checkout steps | Logic tangled into rendering, hard to test | | **Repository** | One owner per kind of data (orders, cart, menus) | Screens each fetch and disagree | | **Local store** | Reopen mid-order and still see the order, the cart and addresses | Blank screens without signal; cart lost on restart | | **Network client** | Every server call with shared auth and error handling | Each screen reinvents calls | | **Sync engine** | The stored order stays current with no screen open | Relaunch shows a stale order | | **Push handler** | A status change reaches a user whose app is closed | User learns of pickup only by opening the app | ## The classic gap: no local store The most common missing box is the **local store**. The reasoning that leads to it sounds sensible: "you need a network to order food, so the app is online-only, so there is nothing to keep on disk". The requirement it misses is not ordering offline; it is **reopening the app with no signal**. - The user orders, walks into a basement or a lift, and opens the app to check the order. Without a store, the tracking screen is a spinner until signal returns. - On both native platforms the operating system may end a backgrounded app's process to free resources. A cart held only in a screen's state holder dies with the process, because a state holder lives only as long as the screen it serves. The small saved UI state both platforms can restore is meant for things like a selected tab, not the user's cart. - Every launch waits on the network before it can paint anything, even data the device had a minute ago. The fix is not "cache everything". The store earns its place with a **small, purposeful set**: the active order with its last-known status, recent orders, the cart, saved addresses, perhaps the last menus browsed. Some data should stay owned by the server even when shown: a repository may treat the network as the source of truth for a type, and a price the user will be charged is the clearest example. ## Boxes that may shrink or merge Earning its place cuts both ways. Some boxes in the common shape may not have much to do in this app. - **Sync engine.** In an app built around offline editing, the sync engine carries a queue of writes and pulls changes. Here, placing an order needs the restaurant and payment online, so there is no requirement to queue orders offline. Its job may shrink to keeping the active order current and applying incoming updates, or be merged into the repository. Either is fine if you say so out loud. - **A use-case or domain layer.** Architecture guidance commonly treats it as optional, worth adding only for complex or shared logic. A box that only forwards calls owns nothing. - **Push handler.** This one cannot be argued away: the scenario requires a push on each status change, and that push arrives through the OS rather than through a screen. Something must own registering the device's push token and handling a tap or a data update. ## How to say it in the interview 1. Point at a box and name the requirement behind it in one sentence. 2. Name what breaks without it, ideally with a concrete moment from the app ("a customer in a lift opening the order"). 3. For a box with little to do, say what job remains and where it lives if you merge it. 4. Invite the challenge: "if you'd rather I drop the sync engine, the active-order refresh moves into the repository." The interviewer is reading two things: that you did not draw boxes from habit, and that you would notice if a needed one were missing. ## What this does not decide The audit says which boxes exist, not how they work inside. What exactly is persisted and how its schema evolves, how the live courier position is transported, and how an order placement survives a retry are each deep dives owned by their own part of the round. Name the one that matters next and move on rather than explaining it here.

  • The interviewer says users always have signal. Does the local store still earn its place?
    Usually yes, for a different requirement. The OS may end a backgrounded app's process, and the user expects the cart and the active order to be there when they return; a relaunch should also paint the last-known order at once instead of a spinner. The store can be small, but without it a restart loses work.
  • How do you tell a box worth merging from one worth keeping?
    Ask what it owns that no other box owns. A use-case layer that only forwards calls owns nothing and can merge into the repository; a sync engine that does work with no screen open owns a lifetime the UI does not have. When merging, name the responsibility and where it now lives, so it reads as a decision, not an omission.

  • The local store is unnecessary because ordering food needs a network anyway.
  • Every box in the common diagram must stay, whatever the app requires.
  • A screen's state holder can keep the cart, so a disk store adds nothing.
  • Drawing more boxes always shows a more thorough design.
  • A box can be dropped silently if the interviewer does not ask about it.