Mobile Design Rounds
Follow-up roundAndroid3 min read

Follow-up round: two updates arrive in the wrong order

. Drafted with AI assistance, then edited by Manuel. Based on the live ticker case. Android and Compose only.

The setup

You designed a live stock ticker. A WebSocket sends price ticks for the symbols on screen. Each tick has a sequence number for its symbol. The server sends price 101 as number 41, then price 102 as number 42. The phone receives number 42 first, then number 41.

The question

The interviewer asks: "What does the user see?"

Stop here and answer out loud for one minute.

A weak reply

"The latest tick that arrived." That is 101, and it is old. The screen now shows 101 while the real price is 102, and nothing on screen says it is wrong. It stays wrong until the next tick for that symbol.

A strong reply

  • Arrival time is not the order. Each tick carries a sequence number for its symbol, and the app keeps the highest one it has applied.
  • A tick whose number is not newer is dropped. Here, 42 is applied and 41 is dropped. The user sees 102.
  • The same check finds a gap. If 42 is missing and 43 arrives, the app asks for one snapshot of that symbol and ignores its ticks until the snapshot arrives.
  • This works because the server promises no missing numbers for each symbol. An exchange feed does not promise that, so the gateway between the exchange and the app has to.

The twist many people miss

The interviewer asks: "The connection drops and comes back. In a chat app you replay the missed messages. Why not here?"

A good answer: a chat message is a separate fact, so losing one loses information. A price replaces the one before it, so old ticks are not worth replaying. After a reconnect I subscribe again and take one snapshot for each symbol. The snapshot is my replay. It also carries a sequence number, so ticks that arrive after it are checked against it.

Check yourself

  • Did you say arrival order cannot be the order, and name what is?
  • Did you say what happens to the late tick?
  • Did you cover a missing number, not only a late one?
  • Did you explain why a snapshot replaces replay for prices?

Score your answer on the score sheet.

Go deeper

  • Live ticker case: the failure table has a row for out-of-order delivery, and the follow-ups cover replay and stale prices.
  • Build guide: the sequence check with the contract.
  • Chat app case: where gaps and replay are the right answer.

All follow-up rounds

Get the follow-up round by email

One short email each week. The cheat sheet comes with the first one.

You confirm your address first. Unsubscribe any time. Privacy.