A color picker service provides a backend that enables users to explore, select, and store their preferred colors. After authenticating, users can choose colors they like and have those choices permanently recorded. Additionally, users can share specific colors through a URL, making them accessible to anyone, whether they are logged in or not.
My first point of clarification with the interviewer would be: are we designing the interactive color selection widget, or the backend system responsible for storing and delivering colors? The focus is the backend. A critical follow-up question: could a shared color experience viral popularity? If the answer is yes, the system evolves beyond straightforward CRUD operations. It transforms into a content delivery challenge masked as a configuration interface.
100,000 simultaneous users.Out of scope (below the line)
99.9% uptime for both the personal color management API and the shared-color retrieval path.200 ms at the 99th percentile globally, even during celebrity-driven traffic surges.300 ms at the 99th percentile.100 users and must scale to 10 million registered accounts. Celebrity-shared colors may draw 100,000+ concurrent viewers.| Metric | Value | Design consequence |
|---|---|---|
| Registered users (scale target) | 10M | A single PostgreSQL primary with read replicas is sufficient |
| Max colors per user | 100 | Total color rows are bounded at roughly 1 billion in the worst case; realistically, the number is far lower |
| Color record size | ~200 bytes (hex, label, metadata) | The entire color dataset fits easily within a single database |
| Shared-color reads (celebrity peak) | 100k+ concurrent | The database alone cannot serve this load. A CDN is mandatory |
| Shared-color payload | < 1 KB | Extremely small and highly cacheable at the network edge |
| Write queries per second (QPS), normal | Low hundreds | Easily managed by AWS Lambda or a small fleet of containers |
| Read QPS (celebrity spike) | 100k+ | Amazon CloudFront absorbs this traffic. The origin receives approximately one request per time-to-live (TTL) window per edge location |
The defining numbers for this architecture are the celebrity read spike and the minuscule payload size. The CDN’s TTL governs the frequency of origin contact. Together, these factors reveal that the system is not fundamentally a database scaling exercise; it is a CDN caching strategy problem. The database remains compact and uncomplicated, while CloudFront carries the vast majority of the load.
High‑level architecture – CDN absorbs celebrity read spikes while writes and personal reads hit the application and database.