KatInterview

Building a Global Multi-Tenant Scheduling and Events Platform

System DesignModel answer
HardModel answerSystem Designsystem-designcalendarrecurrence

Last updated

Design a calendar backend for hundreds of millions of users covering events, recurrence, time zones, sharing, reminders, sync, and storage choices, with APIs, schemas, queries, and scaling.

You are asked to design the backend of a scheduling product that serves hundreds of millions of users across many tenants. Users own several calendars, share them with others, invite people to events, and expect reminders to arrive on time.

Functional scope

  • Timed and all-day events, attendees, invitations and RSVPs
  • Recurring series with per-occurrence changes
  • Correct handling of time zones, including daylight saving transitions
  • Reminders (email, push, in-app)
  • Shared calendars with roles and privacy boundaries
  • Text, attendee and time-based search
  • ICS import/export and sync with external calendar providers

Non-functional goals

  • Low read latency for range queries
  • High availability
  • Strong consistency where it matters (a user's own writes), eventual consistency elsewhere
  • Cost efficiency

Please cover

  1. Requirements and scale: state your assumptions and do rough capacity math.
  2. APIs: REST or gRPC endpoints for event CRUD, listing events in a time range, invites and RSVP, search, and calendar sharing. Address idempotency, pagination, filtering, concurrency control and rate limiting.
  3. Data model: relational schemas with keys, indexes and constraints. Explain how you represent recurrence (rule plus exceptions), time zones, soft deletes and audit fields.
  4. Queries: (a) all visible events for a user in a window, (b) conflict detection for a proposed event, (c) materializing one occurrence of a series given its rule and exceptions, (d) search by attendee and keyword.
  5. Scaling and storage: partition keys, sharding, secondary indexes, caching, search indexing, and precomputed versus on-the-fly expansion of recurring instances.
  6. Consistency and operations: concurrent edits, retries, transactions versus an outbox, eventual consistency for search and notifications, disaster recovery, backups, GDPR and retention.
  7. Notifications and integrations: reminder delivery, ICS, external sync, abuse prevention and quotas.
  8. Database choices: when relational, document or time-series stores fit, and which you would pick as the primary store.

Hints

Hint 1

Start with numbers: reads dominate writes, and reminders cluster at the top of the hour. Let these drive the sharding and the reminder design.

Hint 2

Store a recurring series once as wall-clock start + IANA zone + RRULE, key exceptions by the occurrence's original start, and expand only a bounded window into a per-user instances table.

Hint 3

Use optimistic versions (ETag / If-Match) for concurrent edits, idempotency keys for retries, and a transactional outbox to feed search, reminders and attendee copies asynchronously.