Daily iOS
iOS system design

Thumbnail grid to detail

The first screen is a grid of photo thumbnails from an API, and tapping one opens a detail screen with comments, likes, sharing, and swipe left or right for the next photo. How would you lay out the classes and the data flow?

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

The grid and the detail share one PhotoStore (page state plus DB), so swiping in detail continues the grid's pagination. Thumbnails request a small-size URL and detail requests a large one, with separate cache keys. Page size is 2 to 3 times the number of cells on screen.

Share a question