List non-functional requirements for the system...
Estimate the scale of the system you are going to design...
Define what APIs are expected from the system...
GET api/events
get events by user id and time range
request
{
user_Id: 'u123',
invitee: ['[email protected]', '[email protected]']
from: 1624957228 // unix timestamp, easy to convert to local time
to: 1624958228
}
response
{
events: [
{
event_id: 'e123',
user_id: 'u123',
email: '[email protected]',
event_name: 'interview',
event_desc: 'interview description',
from: 1624957228,
to: 1624957228
},
.....
]
}
POST api/event/create
create an event
request
{
user_id: 'u123',
event_name: 'interveiw',
event_desc: 'xxx',
from: 1624958228,
to: 1624958228,
invitee: ['[email protected]', '[email protected]'] // optional
}
response
{
event_id: 'e134',
status: 200,
error_msg: 'conflict with xxx' // error message, e.g. there is conflict event
}
POST api/event/manage
update/delete event
request
{
event_id: 'e123',
user_id: 'u123',
action: 'cancel', // 'update'
event_name: 'new event', // updated event name
}
POST api/event/invite
invitee accept or decline the event
request
{
user_id: 'u345',
action: 'accept' , // accept or decline
reason: 'no time' // accept or decline reason
}
response
{
status: 200,
error_msg: '...'
}
Defining the system data model early on will clarify how data will flow among different components of the system. Also you could draw an ER diagram using the diagramming tool to enhance your design...
User
user_id: pk, uuid
email: string
name: string
Calendar
calendar_id: pk, uuid
user_Id: fk
name: string
desc: string
timezone: Timezone
Event
event_id: pk, uuid
name: string
desc: string
from: int
to: int
Notification
notif_id: pk, uuid
event_id: fk
method: string // push notif, SMS, call...
user_id: fk,
effect_time: int,
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
discuss data model
Calendar
calendar_id: pk, uuid
name: string
desc: string
timezone: Timezone
Event
event_id: pk, uuid
name: string
desc: string
from: int
to: int
Calendar <> Event is many to many relationships
CalendarEvent
id: pk
event_id: fk
calendar_id: fk
role: string // invitee or host
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?