AlgoViz

Design Google Calendar

hard 60 min

Events with a start and an end look like the simplest table there is.

Where it shows up

The same pattern appears across everyday software.

  • A clock rule changes

    The IANA time zone database is updated when governments change their rules. A calendar that stored only UTC for future meetings now shows the wrong hour, and cannot know the right one.

  • Sync in the Google Calendar API

    A list answer carries a nextSyncToken. If a token is no longer valid the server answers 410, and the client wipes its copy and starts again.

  • Pushes that carry nothing

    Google's documentation says that push messages have no body and are not 100% reliable. They say only that something changed; the client then asks.

  • Expanding on request

    The same API returns a series as one item by default, and as separate occurrences when singleEvents is true.

  • Meeting rooms

    A person may be double-booked, a room may not. PostgreSQL's manual uses room bookings as its example of an exclusion constraint.

  • Monday, five minutes to nine

    People choose round hours, so reminders arrive in waves at the same seconds, in one time zone after another.

  • Calendars from elsewhere

    iCalendar files and CalDAV join different products. The event's UID tells a copy from a second event.