System Design blueprint · Ride hailing
Cab booking end to end (Uber & Ola)
A ride-hailing flow that takes a rider from pickup and drop entry through surge-priced quote, geo-cell driver matching, OTP-verified pickup, live tracking, fare settlement over UPI, cards, wallet or cash, ratings and safety. It must never assign one driver to two trips, charge a fare different from the agreed quote rules, or lose an SOS event.
- Steps
- 9
- Subjective questions
- 33
- Objective questions
- 33
The problem and the outcome
Problem: Riders need a car, auto or bike quickly at a fair, predictable price, and drivers need steady nearby requests, all while location data changes every few seconds. Supply, demand, payment methods and safety needs differ sharply by city and vehicle type.
Outcome: Riders get a locked quote, a confirmed driver with a road-based ETA, OTP-secured pickup and live trip sharing. Drivers get well-ranked offers, and the business gets consistent trip state, reliable payments including cash reconciliation, and an auditable event log.
Architecture
How it works, step by step
- The rider sets pickup and drop on the map (with saved places and pickup-point snapping) and picks a vehicle type such as bike, auto, mini or sedan.
- The fare service gets route distance and time from the routing engine, applies the city rate card and the current surge multiplier for the pickup cell, and returns a quote with an ID and expiry so the shown price is honoured.
- Booking creates a trip in REQUESTED state using an idempotency key, so a double tap or retry never creates two trips; every state change is written with a version number.
- The matching engine pulls available drivers from the rider's H3 cell and surrounding rings, filters by vehicle type and status, ranks them by road ETA rather than straight-line distance, and may batch requests in short windows for better global assignment.
- The top driver gets a timed offer over a persistent socket with push fallback; acceptance is a conditional update (only if the trip is still unassigned and the driver is free), otherwise the next driver is offered.
- At pickup the rider tells the driver a short OTP; the trip moves to STARTED only if the OTP matches, which prevents wrong-rider and fake-start trips.
- During the trip the driver app streams GPS pings that update the geo index and feed the rider's live map, trip-sharing links and route-deviation checks.
- On drop the fare is computed from the quote rules plus allowed adjustments (route change, waiting, tolls), then collected by UPI, card, wallet or cash; cash trips post the platform commission to the driver's ledger.
- Both sides rate each other; cancellations after a grace window or driver arrival attract a fee per policy, and SOS alerts, emergency contacts and trip sharing are handled on a priority path.
Tech stack
- H3 hexagonal geo indexing
- Redis for live driver locations and status
- Apache Kafka for trip and location events
- PostgreSQL or a distributed SQL store for trips and ledgers
- OSRM, Valhalla or a commercial maps API (Google Maps, Mappls) for routing and ETA
- WebSocket or MQTT for driver offers, with FCM/APNs fallback
- Payment gateway or PSP for UPI intent/autopay, cards and wallets
- Kubernetes with city-level sharding
Key design decisions
- Shard live location and matching by city and geo cell, because nearly all queries are local and it isolates failures per region.
- Rank candidate drivers by road ETA from the routing engine, not haversine distance, because rivers, flyovers and one-ways make straight-line distance misleading.
- Model the trip as an explicit state machine with versioned conditional updates so concurrent accept, cancel and timeout events cannot corrupt state.
- Lock a quote with an ID and expiry at booking time so surge changes after booking do not alter the rider's agreed price rules.
- Treat cash as a first-class method: the driver collects it and the platform recovers commission through the driver's wallet or payout deductions.
Common mistakes
- Writing every GPS ping to the primary database instead of an in-memory geo index, which overloads storage and slows matching.
- Offering one trip to many drivers at once without a conditional assign, leading to double acceptance and angry drivers.
- Surge that flips sharply between neighbouring cells or minutes, encouraging riders to walk across a boundary or drivers to game zones.
- Assuming steady connectivity; drivers in basements or low-network areas need ping buffering, offline OTP checks and idempotent retries.
- Settling UPI payments only on the client callback rather than confirming with the PSP via webhook or status check, causing missed or duplicate charges.
What to measure
- Time to match: booking to driver acceptance, by city and vehicle type
- Pickup ETA accuracy: predicted versus actual arrival
- Offer acceptance rate and driver cancellation rate
- Payment success rate per method, plus cash commission recovery
- SOS acknowledgement time and trip-share usage
Most-asked interview questions
Subjective questions 33
1How would you design driver matching so it is fast and never double-assigns a driver?Asked almost every time
Drivers send location pings every few seconds into an ingest service that updates an in-memory geo index keyed by H3 cell, sharded by city. On a request, I look up the rider's cell and neighbouring rings, filter by vehicle type and availability, then call the routing engine for road ETA and rank. I offer to one driver at a time with a short timeout, or batch requests over a small window to optimise globally. Acceptance is a conditional update: set the trip's driver only if the trip is unassigned and the driver's status is available, using a version check or compare-and-set. If it fails, the driver gets a 'trip taken' message and matching moves on. Driver status is locked during an offer so they are not offered two trips.
2Walk me through the trip state machine and how you keep state changes consistent.Asked almost every time
I model the trip as an explicit state machine: REQUESTED, DRIVER_ASSIGNED, DRIVER_ARRIVED, STARTED, COMPLETED, with CANCELLED reachable from defined states. Each row carries a version number. Every transition is a conditional write such as 'set state to STARTED, version to 6, where trip_id matches, state is DRIVER_ARRIVED and version is 5'. If the condition fails, the caller re-reads and decides. Illegal transitions are rejected in one service, not in each client. Each transition also appends an immutable trip event through a transactional outbox, so billing, notifications, tracking and analytics consume a reliable ordered stream per trip. Keying that stream by trip ID keeps ordering, and the version lets consumers drop duplicates or stale events.
3How do you make sure the rider is charged according to the quote they saw?Asked almost every time
The fare service stores each quote server-side with a quote ID, rider ID, vehicle type, pickup and drop, route estimate, rate card version, surge multiplier and expiry. The client only holds the ID. Booking must reference a valid, unexpired quote owned by that rider. Otherwise the rider gets a fresh quote and confirms again. The trip snapshots the quote rules, so later changes to the rate card or surge do not affect it. At drop, the final fare is calculated from those snapshotted rules. Only whitelisted adjustments are added, such as a rider-initiated drop change, waiting beyond the free window, or tolls, and each has an evidence trail. Anything outside the rules is capped or sent for review, never silently charged.
4Explain how the booking idempotency key works in practice.Asked almost every time
The client generates a unique key, such as a UUID, when the rider taps Book. It sends the same key on every retry of that intent. The booking service does an insert-if-absent on a table keyed by rider ID and idempotency key, storing the resulting trip ID and response. If a double tap or a network retry arrives, the unique constraint fails and the service returns the original trip instead of creating a new one. If the same key arrives with a different payload, it returns an error. Keys expire after a reasonable window. A second guard is useful too: allow only one active trip per rider per product, enforced with a unique partial index or a conditional write.
5How would you design the driver location service that ingests GPS pings?Asked almost every time
Driver apps send pings every few seconds over a persistent connection to a stateless gateway. Pings go into a partitioned log such as Kafka, keyed by driver ID so each driver's updates stay ordered. A location service consumes them, drops out-of-order or implausible points, and updates an in-memory geo index. That index maps H3 cell to available drivers and driver to their latest position, status and timestamp. Entries carry a TTL, so drivers who go silent disappear from matching automatically. The index is sharded by city or cell range. Raw pings are written asynchronously to cheaper storage for fare audit, disputes and ETA model training. The hot path never waits on durable storage.
6How would you guarantee an SOS event is never lost?Asked almost every time
SOS goes on a separate, priority path. The app sends it over multiple channels: the live socket, an HTTPS call with retries, and SMS as a last resort if data is unavailable. Each SOS has a client-generated ID, so duplicates collapse. The server persists it durably with synchronous replication before acknowledging. The app keeps retrying until it gets that acknowledgement and shows the rider clear status. The SOS service runs on dedicated capacity, isolated from surge-time traffic, with its own queue and alerting. It triggers the safety team console, notifies emergency contacts, attaches live location and trip details, and offers a one-tap call to the national emergency number 112. Unacknowledged cases escalate automatically, and the path is tested with regular drills.
7What core entities and storage would you choose for this system?Asked almost every time
I would use these entities. Rider and driver profiles. Vehicle. Quote, with its ID, rules snapshot, surge and expiry. Trip, holding state, version, rider, driver, quote reference, pickup, drop and timestamps. TripEvent, an append-only history. Payment intent and ledger entries. Rating. SOS case. Trips and payments need strong consistency, so they go in a relational or NewSQL database sharded by city or trip ID. Live locations and driver availability sit in an in-memory geo store with TTL. Trip events flow through Kafka to a data lake for analytics. Raw GPS traces go to object storage or a time-series store. The quote and rate cards are cached, but the source of truth stays in the database.
8How do you compute surge pricing and keep it fair?Very often asked
Surge reflects the imbalance between demand and supply in a cell over a recent window. I count open requests and app opens against available drivers per H3 cell, smooth the ratio over time and across neighbouring cells, and map it to a multiplier with caps set by policy and, where applicable, local regulation. Fairness comes from three things: the rider sees the multiplier before booking, the quote is locked with an ID and expiry, and the multiplier changes gradually so it cannot jump between two taps. I'd log every quote with its inputs so disputes and regulator questions can be answered, and monitor for zone gaming by drivers going offline to trigger surge.
9How would you handle payments across UPI, cards, wallets and cash?Very often asked
Fare calculation happens server-side from the locked quote plus allowed adjustments like waiting time and tolls, so the client never decides the amount. For UPI and cards, I create a payment intent with an idempotency key tied to the trip, and treat the PSP webhook or a status poll as the source of truth, not the app callback. Failed digital payments become dues on the rider account, collected on the next ride. Wallets use a double-entry ledger. Cash is common for autos and bikes in India, so the driver collects it and the platform posts its commission as a debit on the driver's ledger, recovered from future online earnings or payouts. Reconciliation jobs match ledger entries against PSP settlement reports daily.
10Give a back-of-the-envelope estimate for location ping load and how you would size for it.Very often asked
I would state my assumptions instead of quoting real figures. Say there are one million drivers online at peak, each pinging every four seconds. That is about 250,000 writes per second. At roughly 100 bytes per ping, that is around 25 MB per second of ingest, or about 2 TB per day of raw data before compression. Each update is a small in-memory operation, so a few dozen index shards partitioned by city handle it comfortably, with headroom for festivals and rain. Kafka partitions are sized to the consumer parallelism. Load can also be cut by adapting the ping rate: send less often when the driver is stationary or offline, and more often on an active trip.
11How does the offer flow to drivers work, including timeouts and fallbacks?Very often asked
The matching engine picks a candidate and marks a short-lived offer reservation on that driver, so they are not offered two trips at once. The offer goes over the driver's persistent socket through the gateway that owns the connection, found via a connection registry. If the socket is down, a push notification is sent. The offer has a server-side deadline. A timer service or delayed queue expires it, releases the reservation and moves to the next ranked driver. Acceptance is one conditional update: set the driver on the trip only if the trip is unassigned and the driver is still free. Declines and timeouts are recorded for acceptance-rate metrics, and the rider sees 'finding driver' until assignment or a final no-drivers result.
12When would you choose batched matching over greedy nearest-driver assignment?Very often asked
Greedy matching gives each request the best driver available right now. It is simple and fast, but in dense areas it can be globally poor. One rider takes a driver who would have been ideal for another rider, leaving the second rider a long pickup. Batching collects requests and drivers over a short window, a few seconds at most, and solves a bipartite assignment that minimises total ETA. Hungarian-style or min-cost-flow solvers are typical. The trade-off is the added wait and extra compute. I would batch in dense, high-demand cells where gains are real. In sparse areas or for latency-sensitive products I would fall back to greedy. The window should be tuned with experiments against pickup ETA and completion rate.
13Why rank drivers by road ETA instead of straight-line distance, and how do you keep it cheap?Very often asked
Straight-line distance ignores one-way streets, flyovers, rivers, U-turn restrictions and traffic. A driver 400 metres away across a divided highway can take longer than one 1.5 km away on the same side. Road ETA reflects what the rider actually waits for. Computing it for every candidate is expensive, so I prefilter by H3 rings and haversine distance to a small set, perhaps the nearest ten to twenty. Then I call the routing engine with a one-to-many matrix query using precomputed contraction hierarchies plus live traffic weights. Cell-to-cell ETAs are cached for short periods, and the system degrades to cached or distance-based ranking if routing is slow.
14How do you deliver live tracking to the rider and to people with a trip-share link?Very often asked
The location service publishes each active-trip driver position to a channel keyed by trip ID. Rider apps subscribe over a WebSocket or server-sent events through edge gateways. Share-link viewers use the same channel through a read-only, tokenised endpoint that expires when the trip ends. Updates are throttled to what the map needs, and the client smooths movement by snapping points to the route and interpolating between them. Missing updates are fine because each message carries absolute position and timestamp, so there is no need for guaranteed delivery. If push breaks, the client falls back to polling. Share tokens reveal only the trip's live data, never the rider's history or contact details.
15How do you detect route deviation or unusual stops during a trip?Very often asked
At trip start I store the expected route and ETA. A stream processor consumes GPS pings for active trips and compares them against that route. It flags sustained distance from the corridor, a long stationary period in an unexpected spot, a sudden ETA jump, or the trip going far past the drop. Short deviations caused by traffic or a valid reroute are tolerated using thresholds and recomputed routes. When a rule fires, the rider gets an in-app safety check-in. If there is no response or the rider asks for help, it escalates to the safety team. Thresholds are tuned per city to avoid alert fatigue, and every check is logged for audit.
16A UPI payment stays pending after the trip ends. How do you handle it?Very often asked
The trip is completed, but the payment sits in a PENDING state with a payment intent ID. I never mark it failed just because the client timed out. The payment service relies on the gateway webhook and also runs status-check polling with backoff, because webhooks can be delayed or lost. If it succeeds, the ledger is posted and the receipt is sent. If it fails, the rider is asked to retry or pay by another method, and the amount is recorded as dues on the next booking per policy. Collection calls use idempotency keys so a retry never debits twice. Daily reconciliation against gateway settlement files catches any mismatch, and any double debit triggers an automatic refund.
17How do you model the driver ledger for cash and online trips?Very often asked
I use a double-entry, append-only ledger. On an online trip the platform collects the fare, so the driver account is credited the fare minus commission and taxes, then paid out on a schedule. On a cash trip the driver already holds the money, so the ledger debits the driver for the platform's commission. Their balance can go negative. Each entry references the trip ID with a unique key, so retries never double-post. Balances are derived from entries or maintained with versioned conditional updates. Negative balances are netted against future online earnings or settled through driver top-ups. Policy can limit cash trips when dues exceed a threshold.
18How would you shard the system, and what are the trade-offs of sharding by city?Very often asked
Ride-hailing is naturally local. A rider in Pune never needs a driver in Chennai, so I shard matching, the geo index and surge by city or region. That gives locality, isolates failures and allows per-city tuning. The downside is skew: metro cities are much hotter than small ones, so large cities are further split by H3 cell ranges, with handling for boundary rings that cross shards. Trips that cross boundaries, like airport runs into a neighbouring district, are owned by the pickup city. Global entities such as user accounts, payment instruments and the ledger are sharded by user ID instead. A routing layer maps each request to the right shard.
19The driver's phone loses network in the middle of a trip. What happens?Very often asked
The driver app keeps recording GPS points locally, with timestamps, while offline. When connectivity returns it uploads them in a batch, and the server orders them by timestamp to rebuild the path for fare calculation. On the server, a missing heartbeat does not cancel the trip. It moves into a 'connection lost' sub-state. The rider's map shows the last known position and a notice. If the gap lasts too long, the safety system checks in with the rider. End-trip actions taken offline are queued with idempotency keys and replayed. If the GPS gap is large, the fare falls back to the routed distance between known points, capped by the quote rules, so the rider is never overcharged because of missing data.
20How would you detect GPS spoofing and fake trips?Very often asked
Drivers may spoof location to look closer for offers, or create fake trips to collect incentives. On the device side, I check for mock-location flags, rooted devices and app integrity signals, such as the Play Integrity API. On the server side, I look for impossible speeds or jumps, pings that stay too perfect or too static, mismatches between GPS and network-derived location, and routes that do not follow roads. For collusion, I watch for repeated rider-driver pairs, very short trips near incentive thresholds, and shared devices or payment instruments. Suspicious trips get their incentives held, not paid instantly. Scores feed a review queue, because hard blocks on noisy signals would hurt honest drivers in poor-GPS areas.
21How do you keep driver availability accurate in the matching index?Very often asked
Each driver has a status: OFFLINE, AVAILABLE, OFFERED, ON_TRIP. The source of truth is in a strongly consistent store with a version number. The geo index is a fast but possibly stale copy. Index entries expire via TTL if pings stop, so drivers who closed the app or lost signal drop out. When a driver takes a trip, the status changes in the source of truth first, and the index is updated from that event. Because the index can lag, matching treats it only as a candidate list. The final conditional assignment write rechecks real status. Drivers who also run other apps are handled the same way: if they do not respond, the offer times out and repeated timeouts lower their priority.
22What privacy measures would you build for riders and drivers?Very often asked
Phone numbers are masked. Calls and chats go through a proxy number or in-app VoIP, and that link is cut shortly after the trip. The driver sees the pickup point and rider first name, not saved addresses or history. Precise location is collected for the trip's purpose and kept only as long as policy and law require. India's DPDP Act 2023 requires a clear notice, consent tied to a purpose, and support for user rights. Data is encrypted in transit and at rest, with access based on role and audited. Support staff see masked data unless a case justifies more. Analytics use aggregated or pseudonymised data. Share links are tokenised and expire.
23How would you implement cancellation fees fairly?Often asked
Cancellation rules sit in a versioned policy engine, configured per city and product, and the policy version is stored on the trip. Inputs come from trip events: time since assignment, whether the driver arrived, the driver's ETA at booking versus actual movement, and who cancelled. A rider cancelling inside the grace window pays nothing. After the window, or after a verified arrival, a fee applies. If the driver was not moving toward the pickup or arrived far later than promised, the fee is waived. Arrival is verified with GPS near the pickup point, not just a button tap. Drivers who repeatedly cancel are penalised. Every fee comes with a reason shown to the user, and disputes go to support with the full event history.
24How would you design the rating system and protect it from abuse?Often asked
After completion, each side gets a rating prompt linked to the trip ID. A rating can only be submitted by a trip participant, and only once per trip, enforced with a unique key. Ratings flow as events into an aggregation service. That service keeps a rolling average over recent trips, so the score reflects current behaviour and old outliers fade. Low ratings ask for structured reasons, and safety-related reasons route to the trust and safety team. To limit abuse, I exclude ratings from trips under fraud investigation and detect retaliation patterns. Raw scores are not shown in a way that reveals who rated whom. Drivers below a threshold get coaching before any deactivation review.
25How would you handle a full data centre or region failure?Often asked
I run active-active or active-standby across at least two regions. Trip and ledger data are replicated synchronously within a region and asynchronously across regions, with a clearly stated RPO. The geo index is soft state. After failover it rebuilds within seconds from fresh driver pings, so it does not need replication. Clients reconnect through global load balancing to the healthy region. Trips in flight continue because their state and quote snapshot are in replicated storage, and idempotent APIs make retries safe. To avoid double assignment during a split, each city shard has exactly one writer at a time, enforced by leases or fencing tokens. Failover is drilled regularly, not just documented.
26How does pickup-point snapping work and why does it matter?Often asked
Raw GPS in dense Indian streets can be off by tens of metres, and a pin in the middle of a building or a flyover wastes minutes. Snapping moves the pin to a nearby point the driver can actually reach. Candidates come from road segments, known gates and entrances, and pickup spots learned from past successful pickups. The rules respect one-way streets and the side of the road. Saved places store the confirmed snapped point. The rider sees the suggested spot and can adjust it, and the final point is what goes into the quote and matching. Good snapping reduces the back-and-forth calls and cancellations that hurt both ETA and ratings.
27How do you publish trip events reliably to downstream systems?Often asked
I use the transactional outbox pattern. In the same database transaction that updates the trip state and version, the service writes an event row to an outbox table. A relay, or change-data-capture with something like Debezium, reads the outbox and publishes to Kafka, partitioned by trip ID for ordering. This avoids the dual-write problem, where the database commits but the message is lost, or the reverse. Delivery is at-least-once, so consumers such as billing, notifications and rewards are idempotent. They track the last processed version per trip or keep a processed-event table. Poison messages go to a dead-letter topic with alerting, rather than blocking the partition.
28What would your key SLOs and dashboards be for this workflow?Often asked
User-facing SLOs: quote latency, time from booking to driver assigned, assignment success rate, live-tracking freshness, payment success rate, and SOS acknowledgement latency, which gets the strictest target. System metrics: location ingest lag, geo index staleness, offer acceptance and timeout rates, routing engine latency, socket connection counts per gateway, and outbox relay lag. Correctness monitors: zero drivers on more than one active trip, final fare above quote-rule limits, and ledger imbalance after reconciliation. Each correctness check alerts immediately. Everything is sliced by city and product, because a citywide outage in one place can hide inside national averages. Distributed tracing by trip ID connects all services for debugging.
29How would you add scheduled rides booked hours in advance?Often asked
A scheduled ride is stored as a reservation with pickup time, locations, vehicle type and a fare estimate or locked quote, depending on product policy. Real-time matching cannot happen hours ahead, so a scheduler triggers the normal matching flow some minutes before pickup. It may start earlier for airports or areas with sparse supply. Optionally the platform pre-assigns a willing driver who commits to the slot, with a fallback to live matching if that driver drops. The scheduler must be durable and idempotent, so a crash or a duplicate trigger never creates two trips. The rider is notified when the driver is assigned, and if no driver is found by a cutoff the system escalates rather than failing silently.
30How do you handle demand spikes at airports, stadiums or during heavy rain?Often asked
Several layers help. Surge in the affected cells balances demand and supply. Airports often use a driver queue with first-in-first-out fairness and designated pickup zones instead of pure nearest matching. Infrastructure for known events, such as festivals, IPL matches and New Year's Eve, is pre-scaled per city based on history. Autoscaling handles unexpected spikes like monsoon rain. When overloaded, the system sheds non-critical work, such as analytics writes, high-frequency map updates and promotions, while protecting booking, matching, payments and SOS. Clients back off with jitter so retries do not snowball. Rate limits per user and per device stop retry storms.
31How would you safely roll out a new matching algorithm?Often asked
First, offline replay on historical request and supply logs, though this cannot capture how drivers react. Second, shadow mode in production: the new algorithm computes assignments alongside the old one without acting on them, so we can compare predicted ETAs and check latency. Third, an online experiment. Because riders and drivers in a city compete for the same pool, user-level A/B tests leak between groups. So I use switchback tests, alternating algorithms by city or cell over time windows, or randomise by geography. Guardrail metrics include pickup ETA, cancellation rate, driver earnings and completion rate. Rollout is behind a feature flag per city with instant rollback.
32How would you resolve a fare dispute when the rider says they were overcharged?Often asked
Support tooling pulls the trip's event history: the quote snapshot with rate card version and surge, state transitions with timestamps, the raw GPS trace, any route changes the rider asked for, waiting time, and toll evidence. The system recomputes the fare from the snapshotted rules and compares it with what was charged. If the driver took an unnecessarily long route, as shown by comparing the actual path with the expected route, the fare is adjusted to the expected route. Rules allow auto-refunds for clear cases within limits. Refunds go through the ledger with idempotent references. Patterns of disputes against particular drivers feed quality reviews.
33How would you integrate bike taxis and autos alongside cars without separate systems?Often asked
Vehicle type is a first-class attribute on the driver, the quote and the trip. The same pipeline is configured per product. Rate cards differ by product and city, including regulated fare structures where they apply. Routing profiles differ, since a two-wheeler can use lanes a sedan cannot, so ETAs come from profile-specific road weights. Matching filters candidates by product, and may offer a rider several products if they choose 'any'. Safety rules can vary too, such as helmet reminders for bikes. Regulations about which products can operate in a city are enforced through feature flags per city, so compliance changes do not need a code release.
Objective questions 33
1A rider's app retries a booking request after a timeout. What prevents two trips from being created?Asked almost every time
Why: The server deduplicates on the idempotency key and returns the original trip. UI tricks and rate limits do not guarantee this against network retries.
2The trip should move to STARTED only when…Asked almost every time
Why: Requiring both the OTP match and a valid state transition prevents fake starts and wrong-rider pickups.
3Which design best ensures an SOS is not lost?Asked almost every time
Why: Durable persistence before acknowledgement, idempotent retries and a priority path together make loss very unlikely.
4Why do ride-hailing systems commonly use hexagonal H3 cells for geo indexing?Very often asked
Why: All six neighbours of a hexagon are roughly equidistant, so k-ring searches and cell-level aggregates behave consistently, unlike squares with corner neighbours. It is still only a coarse filter; road ETA ranking is done separately.
5Two drivers tap Accept on the same trip at almost the same moment. What best prevents double assignment?Very often asked
Why: A compare-and-set or version-checked write makes assignment atomic, so exactly one accept succeeds and the other gets a clean 'already taken' response.
6Why does each quote carry an ID and an expiry?Very often asked
Why: The server stores the quote, and booking must reference a valid, unexpired quote ID. That binds the price shown to the rules applied.
7What does a version number on each trip state change mainly enable?Very often asked
Why: Conditional writes on the version stop two lost updates from racing. Downstream consumers can also use it to drop old or duplicate events.
8Why are driver location pings typically partitioned by driver ID in Kafka?Very often asked
Why: Kafka only orders messages within a partition. Keying by driver ID keeps each driver's updates in sequence.
9Matching ranks candidates by road ETA. What is the usual way to keep this affordable?Very often asked
Why: A cheap spatial prefilter narrows the candidates, so the expensive routing matrix runs on only a handful of drivers.
10For live tracking, what delivery guarantee is usually acceptable for position updates?Very often asked
Why: A missed position is replaced by the next one. Strong guarantees would add cost and latency without helping the rider.
11At drop, the final fare should be computed from…Very often asked
Why: Using the snapshotted rules honours the agreed quote. Only defined adjustments with evidence may change the amount.
12On a cash trip, how is the platform's commission typically recorded?Very often asked
Why: The driver already holds the cash, so the platform's share becomes a dues entry on the driver's ledger.
13A UPI collect for a completed trip shows PENDING after the client times out. What is correct?Very often asked
Why: UPI results can arrive late. Charging again risks a double debit, so you confirm the status first.
14Which pattern avoids the dual-write problem when updating trip state and publishing an event?Very often asked
Why: The event row commits atomically with the state change and is reliably relayed afterwards.
15Which approach best protects rider and driver phone numbers?Very often asked
Why: Masking prevents either party from learning the real number. Cutting the link after the trip limits misuse.
16What is the main purpose of the pickup OTP in a cab booking flow?Often asked
Why: The rider shares the OTP only with the driver who arrives, so the trip starts only when the correct rider and driver have met, preventing wrong pickups and fake trip starts.
17Which is the most suitable store for the live map of available drivers per H3 cell?Often asked
Why: Matching needs fast reads and writes of fresh positions, and TTL removes silent drivers. Batch and archive stores are far too slow for this.
18What is the main benefit of batching ride requests over a short window?Often asked
Why: Solving many requests together avoids greedy choices that leave other riders with long pickups. The cost is a small added delay.
19A driver's offer is not answered before its deadline. What should the system do?Often asked
Why: A server-side timeout keeps the flow moving and frees the driver. The trip cascades to the next candidate.
20How should the server push an offer to a driver whose socket is on a specific gateway node?Often asked
Why: A connection registry maps each driver to the gateway holding their socket. Push covers the case where that connection is down.
21Which number is India's single emergency response number commonly linked from SOS features?Often asked
Why: India's Emergency Response Support System uses 112 as the integrated emergency number.
22Why use a double-entry, append-only ledger for driver and platform balances?Often asked
Why: Entries are never mutated and debits always match credits. Errors are fixed with compensating entries and are easy to trace.
23Downstream consumers of trip events receive at-least-once delivery. What must they be?Often asked
Why: Duplicates will happen. Idempotent handling makes reprocessing harmless.
24What is the most natural primary sharding key for matching and surge services?Often asked
Why: Matching and surge are local. Sharding by geography gives locality and isolates failures.
25After a regional failover, how is the live driver geo index typically restored?Often asked
Why: Locations are ephemeral and refreshed continuously, so the index can be repopulated quickly.
26What prevents two regions from both assigning drivers in the same city during a network partition?Often asked
Why: Fencing ensures only the current lease holder's writes are accepted, avoiding split-brain double assignment.
27Which Indian law sets consent and purpose-limitation obligations for personal data such as location?Often asked
Why: The DPDP Act 2023 governs processing of digital personal data, including notice, consent and user rights.
28Which signal most strongly suggests GPS spoofing by a driver?Often asked
Why: Physically implausible movement is a classic spoofing indicator. The others are normal conditions.
29Why are plain user-level A/B tests problematic for matching algorithm changes?Often asked
Why: Network effects leak between treatment and control. Switchback or geographic randomisation reduces this bias.
30The driver's phone loses data mid-trip. What is the best behaviour?Often asked
Why: Offline buffering preserves the path for a fair fare and avoids disrupting a trip that is still in progress.
31How should a share-trip link for a family member be designed?Often asked
Why: Limiting the link's scope and lifetime gives safety visibility without leaking extra personal data.
32Why does pickup-point snapping improve the experience?Sometimes asked
Why: GPS error and bad pins cause confusion. Snapping to accessible points speeds up pickups.
33A rider cancels within the grace window after a driver is assigned. Under typical policy, what happens?Sometimes asked
Why: The grace window exists so riders can change their mind quickly without penalty.
Track your progress through every blueprint in your dashboard.
Start learning