Google Calendar
Materials — open to everyone, no sign-in
Topic: Google Calendar
Interviewer: ken
Level: L4 (Experienced Individual Contributor)
Additional Resources:
System Design Interview - Design Google Calendar
10/30/2024
YouTube for the event:
Coach Ken LinkedIn:
https://commitway.com/linkedin
WeChat QRCodes
| | | 职场提升俱乐部 |
10-15 requirement gathering -> 12 minutes (45-12 = 33)
15-20 high level design
5-15 deep dive
[45]
Requirements
500 M 100 M monthly actives
[43]
[41]
[39:40]
Real time refresh of UI? Under 1 minute
2 events per day on average
[38]
[36]
===
[35] data schema
[33:52]
Unregistered users? Will not appear in the table
Add more to invitation
[32:18]
[30]
[28:44]
Get all event?
Add start_time, end_time
[26:34]
[ how to see invitations to me? ]
[23]
getEvents
Created by us + Sent to us
[20:30]
Q: How to implement getEvents?
A: change the design
[19:19]
getEvents:
getEvents: handled by event service
getInvitation: handled by invitation service
createEvent:
User -> event -> event_db
event->invitation
event->notification_service
[how to send notification?]
[SQL/noSQL]
[partition]
handleInvitation
Add getEvent(event_id)
[13:51]
Q: Using SQL database
A: Because High requirements for consistency
Q: throughput?
Reads: 100M * 10 times a day / (24 * 3600) = 12k a second
[8:06]
Writes:
Events table: 10k per second writes / 5 * 3 = 6k per second for event table
Invitation table: 1 call to update all invitation = 6k per second for event table
MySQL
Notification to user?
Email to user
Websocket
Register with the websocket service
[3]
Q: how to register websocket
A:
user -> login service -> assign notification service -> user
user-> websocket service ( < domain name, port number, URL path> )
===
Add some more API
SQL QPS
===