Delhivery Interview Questions with Answers
Last updated 2026-11-19
Delhivery is a logistics company: parcels move through pickup, sorting hubs, line-haul and last-mile delivery, and every step produces data. Technical interviews for such a business reward people who can reason about graphs and routes, about event streams, and about databases that hold millions of shipment records.
The twelve questions below are practice in the style of those themes, with worked answers. They are not copies of any interview. For algorithm practice, continue with Delhivery coding round questions, and for the SQL part see how to crack the SQL interview.
| Rounds (commonly reported) | Screening test or call, technical interviews, managerial or HR |
|---|---|
| Topics | DSA, SQL, system design for tracking and routing, OOP |
| Domain | Logistics: hubs, routes, last-mile delivery, shipment tracking |
Rounds as commonly reported
We have no sourced description of Delhivery's selection process, so this is general guidance for logistics-tech engineering roles rather than a statement about their current pipeline. Candidates typically meet a coding or screening stage, two technical interviews on data structures, databases and design, and a final conversation with a manager. Expect your projects to be probed for the decisions behind them.
- Screening: coding problems or a technical call.
- Technical: DSA on a shared editor, SQL queries, a small system design.
- Managerial or HR: ownership, ambiguity, location and expectations.
Think in shipments, hubs and events
A shipment is a state machine (booked, picked up, in transit, out for delivery, delivered, returned) driven by scan events. Hubs and routes form a graph. Last-mile assignment is a matching and routing problem. Frame answers in those terms and your design discussion stays concrete.
Hiring status
We hold no sourced hiring announcements, drive dates, openings or process description for Delhivery, so none are stated here. Delhivery has no page in our hiring section. Check the company's own careers site for current roles and eligibility.
Delhivery Interview Questions with Answers: questions with worked answers
1 Tell me about yourself and why logistics.
easyGive a short account of your background and one project, then connect it to the domain: you like problems that touch the physical world, where an algorithm saves real kilometres or hours. Mention something you understand about the business, such as the difference between first mile, line-haul and last mile. Do not claim knowledge of internal systems you have not seen.
2 Design shipment tracking: how would you store and serve the status of a parcel?
mediumStore immutable scan events (shipment id, event type, hub, timestamp, source) in an append-only table or log, and derive the current status as the latest valid event. Keep a denormalised current-status row, updated by a consumer, so the customer page reads one row instead of aggregating. Events can arrive late or out of order, so order by event time, ignore transitions that violate the state machine (for example "delivered" before "out for delivery" is suspicious and flagged) and make consumers idempotent on an event id. Publish changes to a queue for notifications.
3 How would you find the nearest hub to a pickup location among thousands of hubs?
mediumA scan of all hubs is O(n) and fine for thousands. For heavy query load, use a spatial index: a geohash or S2 or H3 cell grid where you look up the cell and its neighbours, or a k-d tree or R-tree for nearest-neighbour queries. Use the haversine formula for great-circle distance on latitude and longitude; Euclidean distance on raw degrees is wrong away from the equator. For road distance, refine the shortlist with a routing service, since straight-line distance can differ greatly from drive distance.
pythonfrom math import radians, sin, cos, asin, sqrt def haversine_km(lat1, lon1, lat2, lon2): p1, p2 = radians(lat1), radians(lat2) dlat, dlon = p2 - p1, radians(lon2 - lon1) a = sin(dlat / 2) ** 2 + cos(p1) * cos(p2) * sin(dlon / 2) ** 2 return 2 * 6371.0 * asin(sqrt(a))4 Write a query for the average delivery time per city, only for delivered shipments.
mediumFilter to delivered rows, compute the timestamp difference per shipment, then group by city. Be careful with units and with shipments that have no delivery time (NULL values are ignored by AVG). Use a percentile as well as an average, because a few very late parcels skew the mean. The exact date function differs by database.
sqlSELECT city, AVG(EXTRACT(EPOCH FROM (delivered_at - picked_up_at)) / 3600.0) AS avg_hours, COUNT(*) AS shipments FROM shipments WHERE status = 'DELIVERED' GROUP BY city ORDER BY avg_hours;5 A hub receives scans out of order. How do you keep the status correct?
mediumNever overwrite status with whichever event arrives last. Compare the event's own timestamp (and a sequence number if available) with the stored one and apply only newer ones, or apply transitions only if they are valid in the state machine. Keep every raw event so the history can be replayed and corrected when a late scan arrives. Add a small delay buffer for consumers that send customer notifications so you do not tell a customer "delivered" and then "in transit".
6 Explain the difference between BFS and Dijkstra, and which suits hub-to-hub routing.
mediumBFS finds the fewest edges and is correct only when all edges cost the same. Dijkstra finds the least total cost with non-negative weights using a priority queue in O((V + E) log V). Hub routing has costs (distance, time, price), so use Dijkstra, or A* with a straight-line heuristic when you have coordinates. If a cost can be negative or you need paths with a limit on hops, use Bellman-Ford. Time-dependent edges (departure schedules) need a time-expanded graph.
7 How would you assign parcels to delivery agents to minimise distance?
hardThis is a vehicle routing problem, NP-hard in general, so real systems use heuristics. A practical approach: cluster parcels by area (k-means or geohash cells) to give each agent a compact zone, respect capacity and time windows, then order stops by a nearest-neighbour heuristic improved with 2-opt swaps. Solvers such as OR-Tools handle constraints. State the trade-off clearly: you accept a near-optimal route computed in seconds over an optimal one that takes hours, and recompute when new parcels arrive.
8 Design the data model for shipments, hubs and routes.
mediumTables: shipments (id, origin, destination, weight, status), hubs (id, city, lat, lon), routes (from_hub, to_hub, distance, typical_hours), scan_events (shipment_id, hub_id, type, ts). Index scan_events on (shipment_id, ts) for tracking lookups, and partition it by date because it grows fastest. Keep route data small and cached in memory for the routing service. Normalise addresses separately from shipments, since the same address repeats.
9 What is the difference between a primary key, a unique key and a foreign key, and what happens to a foreign key on delete?
mediumA primary key uniquely identifies a row and cannot be NULL; a table has one. A unique key enforces uniqueness on other columns and allows NULL (how many NULLs depends on the database). A foreign key references a primary or unique key in another table to preserve integrity. On deleting a referenced row you can restrict the delete, cascade it to children, or set the child column to NULL, depending on the declared action.
10 Your tracking API gets ten times the normal traffic during a sale. What do you do?
hardMeasure first: find the bottleneck (database, cache, CPU). Cheap wins come first: cache the current-status response for a few seconds keyed by shipment id, serve static parts via CDN, and add read replicas for the status table. Protect the system with rate limits per client and load shedding that returns a slightly stale answer instead of an error. Scale stateless API servers horizontally behind a load balancer and make the write path asynchronous through a queue.
11 Describe a time you owned something end to end.
mediumPick a real project, ideally small enough to explain in two minutes: what the problem was, what you decided yourself, what you built, how you tested and released it, and what changed afterwards (a number if you have one). Mention one mistake and how you fixed it. Ownership means you chased loose ends, not just wrote code.
12 How would you handle a disagreement with your manager about a deadline?
mediumState the facts: what is done, what remains, the risks. Offer options rather than a refusal, such as shipping the core flow on time and the edge cases a week later, or adding people. Agree on a decision and confirm it in writing. Show that you raise risks early and then commit fully to the decision taken.
Frequently asked questions
What topics should I prepare for Delhivery?
Graphs and shortest paths, arrays and hashing, heaps, SQL aggregation and joins, and a small system design such as shipment tracking. Brush up OOP for low-level design questions.
Is system design asked for freshers?
Lightweight design questions are plausible, such as modelling shipments and hubs or designing tracking. Heavy distributed-system design is usually for experienced roles.
Do they ask SQL?
SQL is a sensible area to prepare for a data-heavy logistics business. Joins, grouping and window functions cover most practice questions.
Where can I see current openings?
On the company's own careers site. We hold no sourced hiring dates or numbers for Delhivery.
Are these real Delhivery questions?
No. They are practice questions in the style of logistics-tech topics, not a record of any interview.
Related guides
More in Company Interview Questions
- Dell Coding Round Questions with Solutions
- Dell Technologies Interview Questions and Answers for India Freshers
- Deloitte coding round questions
- Deloitte interview questions and answers
- Deutsche Bank coding round questions with solutions
- Deutsche Bank interview questions with answers (technology graduates)
- Directi Coding Round Questions With Solutions
- Directi Interview Questions and Answers
- Dream11 Coding Round Questions with Solutions
- Dream11 Interview Questions and Answers
- DXC Technology coding round questions
- DXC Technology interview questions and answers