Public Solution

RideShare 1 - City Launch

RideShare 1 - City 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.

MediumDatabasesApi DesignLoad BalancingWebsockets

Requirements Recap

RequirementTarget
Active drivers (concurrent)~3,000
Daily rides~50,000
Match time< 15 seconds
Location update frequencyEvery 3 seconds
City radius~30 km
Availability target99.9%

Architecture Breakdown (Component-by-Component)

  1. 1. Rider/Driver Apps

    Represents mobile user traffic and request patterns.

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

  2. 2. API Server

    Runs core business logic and orchestrates downstream calls.

    Bridges 1 incoming flow to 3 downstream dependencies.

  3. 3. PostgreSQL (Trips/Users)

    Persists relational data with transactional guarantees.

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

  4. 4. Driver Locations

    Stores high-scale data with flexible schema and throughput.

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

  5. 5. Session Cache

    Stores hot data to reduce origin read latency.

    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
Distribute traffic across multiple app instancesStable p95 by reducing overloaded nodesRemoves single-instance failure riskHigher compute footprint than single-server designNeeds health checks and rollout-aware routing

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: Unhealthy instances continue receiving traffic during partial failure

    Mitigation: Use active health checks, low-fail thresholds, and connection draining on rollout.

Why This Scores Well

  • Availability (35%): Redundant routing and data paths reduce single points of failure under burst traffic.
  • 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%): Higher complexity is scoped to requirements that actually demand scale or stronger fault tolerance.

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