EasyStarter

Link-in-Bio Page

DatabasesAPI DesignCDN

Problem Statement

LinkPage is building a link-in-bio service (like Linktree). Users create a profile page (e.g., `linkpage.io/jane`) with:

- Custom links - add, remove, and reorder links (up to 50) with titles, URLs, and optional thumbnails.Themes - choose from pre-built visual themes or customize colors, fonts, and background.Click tracking - see how many clicks each link gets, with a simple analytics dashboard.Social icons - auto-detected icons for popular platforms (Instagram, YouTube, TikTok, etc.).SEO & sharing - proper Open Graph tags so the page looks good when shared on social media.

Targeting 100,000 users with 2 million page views per day.

What You'll Learn

Design a Linktree-like service where users create a personalized page with links to their social profiles. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.

DatabasesAPI DesignCDN

Constraints

Registered users~100,000
Page views/day~2,000,000
Page load time< 300 ms
Links per userUp to 50
Themes available~20
Availability target99.9%
ApproachClick to expand

Interview-Ready Approach

1) Clarify Scope and SLOs

  • Problem statement: Design a Linktree-like service where users create a personalized page with links to their social profiles.
  • Design for a peak load target around 116 RPS (including burst headroom).
  • Registered users: ~100,000
  • Page views/day: ~2,000,000
  • Page load time: < 300 ms
  • Links per user: Up to 50
  • Themes available: ~20

2) Capacity Planning Method

  • Convert traffic and growth constraints into request rate, storage growth, and concurrency budgets.
  • Keep at least 2-3x safety margin per tier (ingress, compute, storage, async workers).
  • Reserve explicit latency budgets per hop so p95 can be defended in review.

3) Architecture Decisions

  • Databases: Define a clear system-of-record and design read/write paths separately before adding optimizations.
  • API Design: Standardize API boundaries, idempotency keys, pagination, and error contracts first.
  • CDN: Serve static and cacheable content from edge and keep origin strictly for misses and dynamic requests.

4) Reliability and Failure Strategy

  • Use strong write constraints (transactions or conditional writes) and explicit backup/restore strategy.
  • Apply strict input validation and backward-compatible versioning.
  • Define cache keys and purge workflows before launch to avoid stale/global outages.

5) Validation Plan

  • Run one peak-load test, one dependency-degradation test, and one failover test.
  • Verify idempotency for all retried writes and async consumers.
  • Track user-facing SLOs first: p95 latency, error rate, and successful throughput.

6) Trade-offs to Call Out in Interviews

  • Databases: SQL gives stronger transactional guarantees; NoSQL often gives better write scaling and flexibility.
  • API Design: Rich APIs improve developer speed but can create long-term compatibility burden.
  • CDN: Long TTL improves latency/cost; short TTL improves freshness.

Practical Notes

  • Profile pages are read-heavy and rarely change - aggressively cache them at the CDN level with short TTLs (5 minutes).
  • A single relational database stores user profiles, links, and themes.
  • Click tracking: log to a queue and aggregate async. Don't add latency to the page load.

Learn the Concept

Practice Next

Reference SolutionClick to reveal

Why This Solution Works

Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.

Reference flow: Web Clients -> DNS -> CDN Edge -> API Gateway -> API Service -> Primary SQL DB

Design strengths

  • The architecture keeps synchronous paths short and isolates stateful dependencies behind clear boundaries.

Interview defense

  • This design makes bottlenecks explicit (ingress, core compute, persistence, async workers).
  • It supports progressive scaling without re-architecting the core request path.
  • It keeps correctness-sensitive state changes in durable systems while offloading background work asynchronously.