KatInterview

Frontend System Design: Multi-Device Photo Albums

System DesignModel answer
MediumModel answerSystem Designfrontendstate-managementreal-time

Last updated

Design the client architecture, normalized state, paginated sorted photo lists, direct-to-storage uploads, and near-real-time sync for a multi-device photo album web app.

You are asked to design, at a whiteboard level, the frontend architecture of a browser-based photo album product. Mockups exist for three screens:

  1. Albums screen — a grid of albums, each with a cover photo and a name.
  2. Album screen — the photos belonging to one album; from here the user can add photos and rename the album.
  3. Photo screen — metadata for one photo (capture time, city, etc.).

Required behaviors:

  • Browse albums.
  • Open an album and page through its photos.
  • Rename an album.
  • Upload one or several photos into an album.
  • Edits made on one device show up on the user's other devices within seconds.
  • Photos and albums can be sorted by city, in ascending or descending order.

Assume:

  • Primary scenario is one user with several devices; sharing/collaboration is a future extension only.
  • An account has tens to a few hundred albums; one album can hold thousands of photos, so the photo list must paginate.
  • Photos are multi-megabyte binaries; metadata is tiny; reads vastly outnumber writes.
  • "Near real time" means seconds, with eventual consistency; conflicting concurrent edits may be resolved rather than prevented.
  • city is assigned by the server by reverse-geocoding photo EXIF GPS at ingest, or null if unavailable. Users never type it.
  • The client is a modern SPA; binaries sit in object storage behind a CDN. Choose your own API style/transport and defend it.

The interviewer will probe component/data boundaries, normalization, where each piece of state lives, how sorting interacts with pagination, the upload lifecycle, the sync transport plus recovery from dropped events, and how thousands of photo tiles get rendered. Be explicit about your single source of truth — duplicate state is the thing they will attack hardest. State any further assumptions you need.