Daily iOS
iOS system design

When to load data

A travel booking app goes list → detail → booking. For each screen, how do you decide whether to load its data when the screen appears or ahead of time from the previous screen?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Decide by transition probability × data size × latency sensitivity. Include the detail's essentials (title, price, hero image) in the list response so they show instantly, and load the rest on entering detail. Prefetch only near the visible items, and cut back on cellular and Low Power Mode.

Share a question