All jobs / Mobile developer / Networking
Mobile developer interview question · 1–3 years
A feed can be tens of thousands of items. How do you load it?
The strongest answer
Page or cursor-load, virtualize the window, and cancel in-flight work for rows that scrolled away — do not fetch the world into an array
Why it works
Exactly. Window the data and the views. Prefetch a little; do not ingest the corpus.
What a good answer covers
- Cursor / page the API.
- Virtualize the viewport.
- Cancel work for offscreen rows.
- Same idea as a virtualized web list.
Answers that fall short
- Close, but not the strongest: Fetch all ids once, keep them in memory, bind as the user scrolls
Tens of thousands of models plus images is a memory cliff. - Weak: Fetch the next page only when they tap “More” so we never prefetch
Tap-More is a UX choice, not a substitute for virtualization if they do tap a lot. - Red flag: Download a CSV of the feed on first launch and query it locally forever
A stale local dump is not a feed.
Who gets asked this
More Networking questions
- A notes app edits offline and later meets a server that also changed. What do you do?
- How do you avoid re-downloading a list that rarely changes, without showing stale data for ever?
- You are choosing how a field-sales app syncs. What do you put in the design doc?
- On launch the app fires six requests at once. The access token has expired, and some users end up logged out…
- Three apps will all work offline. What do you standardise?
- The API was down for ten minutes. It fell over again the moment it returned, and the traffic was the app…
- The backend adds a field to a response and the shipped app starts failing to parse it. What should the client…