Design the backend API for a task tracker used by web and mobile apps. Users sign in, create lists, add tasks with due dates and labels, tick them off and share a list with a few teammates. The app has 3 million registered users and 500,000 daily active users. At peak the API receives about 3,000 requests per second, mostly reads of a user's lists and tasks. Each list can hold thousands of tasks, so the API must page through results rather than return everything at once.
Functional requirements
Create, read, update and delete lists and tasks
Page through tasks in a list, filtered by status or due date
Share a list with other users who can view or edit it
Only owners and invited members can see a list
Non-functional requirements
API responses under 200 ms at p95
No lost updates when two people edit the same task
99.9% availability
Constraints and scale
500,000 daily active users
3,000 requests per second at peak, about 80% reads
Up to 5,000 tasks in one list
You will practise
Design clean REST resources, status codes and cursor-based pagination
Keep the API tier stateless so it scales horizontally
Model relational data with indexes that match the access patterns
Show 2 hints
Offset pagination slows down on page 200. What could the client send back instead of a page number?
Where does the session or token live if any API instance can serve any request?