Public Solution

Social Feed 1 - MVP Launch

Social Feed 1 - MVP Launch solution gives a production-minded baseline for this prompt. You get a concise requirements recap, a component-by-component architecture breakdown, explicit tradeoffs for latency, availability, cost, and complexity, plus failure mitigations and scoring rationale so you can benchmark your own design quickly.

EasyDatabasesApi DesignCachingStorage

Requirements Recap

RequirementTarget
Registered users100,000
Daily active users~20,000
Avg posts per user/day3
Avg follows per user50
Post size≤ 300 characters
Timeline load time< 500 ms

Architecture Breakdown (Component-by-Component)

  1. 1. Web Clients

    Generates user traffic and receives responses.

    Acts as an entry layer that routes traffic into the rest of the system.

  2. 2. API Gateway

    Handles api gateway responsibilities in this design.

    Bridges 1 incoming flow to 1 downstream dependency.

  3. 3. API Service

    Runs core business logic and orchestrates downstream calls.

    Bridges 1 incoming flow to 3 downstream dependencies.

  4. 4. Redis Cache

    Stores hot data to reduce origin read latency.

    Bridges 1 incoming flow to 1 downstream dependency.

  5. 5. Primary NoSQL DB

    Stores high-scale data with flexible schema and throughput.

    Acts as a sink or system-of-record endpoint in the architecture flow.

  6. 6. Object Storage

    Stores large files and media objects durably.

    Acts as a sink or system-of-record endpoint in the architecture flow.

Tradeoffs (Latency / Availability / Cost / Complexity)

DecisionLatencyAvailabilityCostComplexity
Keep the request path focused on core business operationsShorter synchronous path keeps average response time stableFewer inline dependencies reduce immediate failure blast radiusAvoids unnecessary infrastructure in the first rolloutLower coordination overhead for small teams
Keep a clear system of record for transactional writesPredictable read/write behavior with indexed accessStrong correctness with managed backup and recoveryStorage and IOPS spend grows with write volumeSchema evolution and query tuning required
Cache hot reads in front of the primary data storeLower median and tail latency on repeated readsAbsorbs origin pressure during read spikesAdds cache infra spend but reduces database scaling pressureRequires TTL and invalidation discipline

Failure Modes and Mitigations

  • Failure mode: Primary datastore saturation increases latency and write timeouts

    Mitigation: Tune indexes, add read offload where valid, and cap expensive query classes.

  • Failure mode: Cache stampede after hot-key expiry overloads the database

    Mitigation: Use request coalescing, jittered TTLs, and stale-while-revalidate for hot keys.

Why This Scores Well

  • Availability (35%): A compact request path limits synchronous dependencies that can fail in-line.
  • Latency (20%): The design keeps hot reads close to users and reduces expensive origin round-trips.
  • Resilience (25%): Clear role separation and bounded dependencies reduce cascading-failure risk.
  • Cost Efficiency (10%) + Simplicity (10%): The architecture stays right-sized for the stated constraints, avoiding premature infra sprawl.

Next Step CTA

Validate this architecture by solving the prompt yourself, then practice the highest-leverage component in a guided lab and topic hub.

FAQ

  • What should I change first if traffic doubles?

    Profile the bottleneck first, then scale the hot path component (usually compute, cache, or read path) before adding new system layers.

  • Why is Databases emphasized in this solution?

    It is the highest-leverage topic for this challenge constraints and directly improves score-impacting metrics like latency, availability, or resilience.

  • How do I validate this architecture quickly?

    Run the same challenge in the simulator, compare score breakdown metrics, and then test one tradeoff change at a time.

Related Reading