Skip to content
SD-18 · System design

Design a Calendar Service

Asked at Senior level45 minutes
Our answers stay hidden until you reveal them.

Design a calendar service. Users create events with a time, a place and a description; events can repeat (“every weekday at 9:30”, “the last Friday of each month”), invite other people who accept or decline, and send reminders before they start. Users see a day, week or month view on the web and on their phones, check when colleagues are free, and every change shows on all their devices.

There are 200 million users, 50 million of them active each day on about 2 devices each. That is about 35,000 view requests a second at peak and 3,500 changes a second, each copied to about 3 attendees. The hard parts are not raw scale but correctness: storing a rule that repeats forever and still answering “what is on my calendar next week?” fast, getting time zones and daylight saving right, firing 29,000 reminders in the minute before the hour on time and only once, and keeping 100 million devices in sync without each one polling.

Good questions to ask first

Decide what you would assume for each before you look at ours.

  1. 1How many users?
  2. 2Which repeat rules?
  3. 3Can one instance of a series change?
  4. 4How many attendees?
  5. 5How early do reminders fire, and how exact?
  6. 6How fresh must other devices be?
  7. 7Can users see each other’s calendars?
  8. 8Time zones?

How to spend the 45 minutes

  1. 5minPart 1: Requirements: recurrence, invites, reminders
  2. 5minPart 2: Estimates
  3. 5minPart 3: API, including scope and versions
  4. 15minPart 4: Architecture, stage by stage
  5. 15minPart 5: Recurrence, reminders, sync
Sketch your own design: boxes, arrows and the numbers that matter. Then compare it with ours.Break it in the labVisual walkthrough