Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Mobile Contacts App

Plan the iOS client of a contacts product: a long A to Z list and a search box served from a copy kept on the device, adding and changing people offline, row pictures that never hold up scrolling, and changes that reach the user's second device.

Problem statement

Your task is the iOS client of a contacts product, plus the few backend calls it relies on. Focus on the client: where contacts are kept on the device, what keeps the list and search quick, and how changes made offline travel to the user's second device.

For this exercise, assume that a backend for contacts is already running; you decide which calls it exposes to the client, while its internal storage and scaling are not part of the task. Each user keeps up to 10,000 contacts in their account.

A contact has a name, any number of phone numbers and email addresses, a company, a note and an optional photo. The user may be signed in on an iPhone and an iPad at the same time. This is the product's own app with its own account, not the address book built into iOS.

Calling and messaging, sharing a contact with another person, groups, importing from other services and merging duplicate contacts are excluded, and every request goes over HTTPS.

Signal drops are common, and once the client leaves the screen iOS can pause or kill it without warning. With no connection, the user must still be able to browse, search, add, edit and delete contacts; no edit may be lost, and after both devices reconnect they must show the same contacts.

What to build

  1. A user scrolls an alphabetical list of all their contacts, grouped under letter headers with a side index and a small photo on each row, and the list opens with no network.
  2. A user types part of a name, phone number or email address and the matching contacts update with each keystroke, with no network.
  3. A user adds, edits and deletes contacts, including the photo; each change shows at once, even offline, and is never lost.
  4. A change made on one of the user's devices appears on the other, and both end up with the same contacts after edits made offline on each.

At scale

  • For this exercise, assume up to 10,000 contacts per user at about 1 KB of text each, and a photo of up to 1 MB per contact, so all the text fits on the phone but full photos for everyone do not.
  • The list opens within 300 ms from stored data with no network, and scrolling stays smooth at 60 frames per second (about 16 ms per frame) while photos load.
  • Search results update within 100 ms of each keystroke across all 10,000 contacts, with no network.
  • An edit shows on the device that made it at once; when both devices are online and the app is open on the other one, the change appears there within a few seconds.
  • While it is not on screen, the client may not check the service on a fixed schedule: repeated wake-ups waste power, and iOS pauses apps that are off screen.