Interview guides · Didi Chuxing
Didi Chuxing Software Engineer Interview Guide
Didi Chuxing Software Engineer interview guide: reported rounds, questions and how candidates describe the process.
The 60-second brief
As a Software Engineer at Didi Chuxing, you are at the heart of one of the world’s most complex mobility platforms. Your work directly impacts how millions of people navigate cities, manage logistics, and access essential services. Whether you are optimizing real-time routing algorithms, scaling high-concurrency systems, or developing machine learning models to predict travel patterns, your contributions are fundamental to the efficiency and reliability of the platform. The role demands a unique combination of technical rigor and creative problem-solving. You will be tasked with solving "real-world" engineering challenges that involve massive scale and high availability.
This guide is scoped to a Software Engineer candidate at Didi Chuxing.
Focus areas
- Coding interviews (algorithmic problem solving)
- Data structures (Trie / Prefix Tree)
- Graph algorithms (Number of Islands)
The Didi Chuxing interview process
Didi Chuxing candidates report 5 rounds over 4-6 weeks. The stages below are what candidates describe, not a published process.
Online Assessment
Some candidates may be asked to complete an Online Assessment before being invited to technical interviews.
What to demonstrate
- Some candidates may be asked to complete an Online Assessment before being invited to technical interviews
- Depth in Coding interviews (algorithmic problem solving)
How to prepare
- Answer aloud and timed: Implement a basic Trie (Prefix Tree) and explain its time complexity.
- Answer aloud and timed: Solve the "Number of Islands" problem and provide a follow-up solution for handling additional features like lakes.
Technical Coding Assessment
Expect a technical coding assessment that evaluates your programming skills.
What to demonstrate
- Expect a technical coding assessment that evaluates your programming skills
- Depth in Coding interviews (algorithmic problem solving)
How to prepare
- Answer aloud and timed: Write a function for "Big Integer Addition."
- Answer aloud and timed: Given an array, implement a solution for the "Two Sum" problem.
System Design Discussion
Engage in discussions about system design to demonstrate your architectural skills.
What to demonstrate
- Engage in discussions about system design to demonstrate your architectural skills
- Depth in Coding interviews (algorithmic problem solving)
How to prepare
- Answer aloud and timed: Optimize a brute-force approach to a problem to move from O(n^2) to a more efficient complexity.
- Answer aloud and timed: How would you handle a deadlock situation in a multi-threaded system?
Project Experience Deep Dive
Discuss your past project experience in detail to showcase your relevant skills.
What to demonstrate
- Discuss your past project experience in detail to showcase your relevant skills
- Depth in Coding interviews (algorithmic problem solving)
How to prepare
- Answer aloud and timed: Propose a solution for a technical case study, explaining your design process and trade-offs.
- Answer aloud and timed: Describe how you would scale a specific service to handle high-concurrency traffic.
Final HR Review
The process concludes with a final HR review to discuss potential fit and next steps.
What to demonstrate
- The process concludes with a final HR review to discuss potential fit and next steps
- Depth in Coding interviews (algorithmic problem solving)
How to prepare
- Answer aloud and timed: How do you approach data consistency in a distributed environment?
- Answer aloud and timed: Walk me through a challenging technical problem you solved in a previous project.
Where candidates lose points
Prioritize Communication
When solving coding problems, "think out loud." Interviewers want to understand your logic, which is just as important as the final code.
Master Your Resume
Know every detail of your projects. If you mention a specific model or technology, be prepared to explain exactly how it works and why you chose it.
Prepare for Behavioral Questions
Don't neglect your soft skills. Be ready to discuss your goals, your teamwork style, and how you handle challenging interpersonal situations.
Research the Company
Familiarize yourself with Didi Chuxing's products and the unique challenges of the global mobility industry.
Questions & practice
Implement a basic Trie (Prefix Tree) and explain its time complexity.
Medium · Coding and Algorithms
Approach
- Restate the input: its shape, its size, and what is guaranteed about it.
- Name the brute-force solution and its complexity before improving on it.
- Choose the data structure from the access pattern, not from familiarity.
- State the target complexity and say which constraint rules the naive version out.
Follow-up
- How does this change if the input no longer fits in memory?
- What is the worst case, and how likely is it on real data?
Solve the "Number of Islands" problem and provide a follow-up solution for handling additional features like l
Medium · Coding and Algorithms
Solve the "Number of Islands" problem and provide a follow-up solution for handling additional features like lakes.
Approach
- Restate the input: its shape, its size, and what is guaranteed about it.
- Name the brute-force solution and its complexity before improving on it.
- Choose the data structure from the access pattern, not from familiarity.
- State the target complexity and say which constraint rules the naive version out.
Follow-up
- How does this change if the input no longer fits in memory?
- What is the worst case, and how likely is it on real data?
Write a function for "Big Integer Addition."
Medium · Coding and Algorithms
Approach
- Restate the input: its shape, its size, and what is guaranteed about it.
- Name the brute-force solution and its complexity before improving on it.
- Choose the data structure from the access pattern, not from familiarity.
- State the target complexity and say which constraint rules the naive version out.
Follow-up
- How does this change if the input no longer fits in memory?
- What is the worst case, and how likely is it on real data?
Given an array, implement a solution for the "Two Sum" problem.
Medium · Coding and Algorithms
Approach
- Restate the input: its shape, its size, and what is guaranteed about it.
- Name the brute-force solution and its complexity before improving on it.
- Choose the data structure from the access pattern, not from familiarity.
- State the target complexity and say which constraint rules the naive version out.
Follow-up
- How does this change if the input no longer fits in memory?
- What is the worst case, and how likely is it on real data?
Optimize a brute-force approach to a problem to move from O(n^2) to a more efficient complexity.
Medium · Coding and Algorithms
Approach
- Restate the input: its shape, its size, and what is guaranteed about it.
- Name the brute-force solution and its complexity before improving on it.
- Choose the data structure from the access pattern, not from familiarity.
- State the target complexity and say which constraint rules the naive version out.
Follow-up
- How does this change if the input no longer fits in memory?
- What is the worst case, and how likely is it on real data?
How would you handle a deadlock situation in a multi-threaded system?
Medium · System Design and Architecture
Approach
- Say what the runtime actually does before reasoning about the code.
- Name what is shared across threads and what owns each piece of state.
- Identify the window where an invariant is briefly untrue.
- Distinguish a value from a reference to it, and say which one you handed out.
Follow-up
- What happens if two callers reach this at the same time?
- Where could this allocate more than you expect?
Describe how you would scale a specific service to handle high-concurrency traffic.
Medium · System Design and Architecture
Approach
- Say what the runtime actually does before reasoning about the code.
- Name what is shared across threads and what owns each piece of state.
- Identify the window where an invariant is briefly untrue.
- Distinguish a value from a reference to it, and say which one you handed out.
Follow-up
- What happens if two callers reach this at the same time?
- Where could this allocate more than you expect?
Explain the computation complexity of the models you used in your last research project.
Medium · Project Experience and Technical Depth
Approach
- Restate the input: its shape, its size, and what is guaranteed about it.
- Name the brute-force solution and its complexity before improving on it.
- Choose the data structure from the access pattern, not from familiarity.
- State the target complexity and say which constraint rules the naive version out.
Follow-up
- How does this change if the input no longer fits in memory?
- What is the worst case, and how likely is it on real data?
Stop tag and share joins from fanning out a page
Medium · join fan-out · semi-joins · many-to-many
resource_tag is (resource_id, tag_id) with PK (resource_id, tag_id); resource_share is (resource_id, shared_with_user_id, permission). The tagged-and-shared listing inner-joins resource to both, filters tenant_id, tag_id = ANY($2) and shared_with_user_id = $3, orders by updated_at DESC and takes 50. Pages come back with fewer than 50 distinct resources and the total in the header is far too high. Explain the row multiplication, rewrite both the page query and the count query so each is correct, and name the index each one needs. PostgreSQL 16.
Approach
- Do the arithmetic against the predicates that are actually there. An inner join emits one row per matching child row, and both joins are filtered: tag_id = ANY($2) admits only the requested tags, shared_with_user_id = $3 admits one user's share rows. So a resource holding three of the requested tags and shared with $3 once yields three rows, not one — the multiplier is its count of matching tags times its share rows for that single user, and that second factor is 1 unless the table admits duplicate (resource_id, shared_with_user_id) pairs. LIMIT 50 then limits rows rather than resources, and COUNT(*) counts pairs — the header is the product, not the population.
- Reject DISTINCT as the fix. It deduplicates after the product has been built, so the planner must materialise and sort the fanned-out set before the LIMIT can apply, and it leaves any SUM or AVG in the same select list wrong.
- Rewrite both filters as semi-joins, keeping resource as the only row source: AND EXISTS (SELECT 1 FROM resource_tag rt WHERE rt.resource_id = r.resource_id AND rt.tag_id = ANY($2)) and the same shape against resource_share. A semi-join stops at the first match per resource and preserves the driving index order, so ORDER BY updated_at DESC, resource_id DESC LIMIT 50 still stops after 50 rows.
- Count with the same predicates and no join at all: SELECT count(*) FROM resource r WHERE r.tenant_id = $1 AND r.status = 'active' AND EXISTS (...) AND EXISTS (...). Nothing multiplies a resource, so the number is the population.
Follow-up
- The filter changes from 'any of these tags' to 'all of these tags'. Rewrite it and state what it costs relative to the ANY form.
- A resource can be shared with the same user twice under different permissions. Does your count change, and should it?
Write the update path that detects a concurrent edit
Medium · optimistic concurrency · transactional outbox · audit history
resource carries version INT NOT NULL DEFAULT 1. resource_revision holds revision_id, resource_id, version, actor_user_id, change_kind, patch JSONB, request_id, created_at with UNIQUE (resource_id, version). outbox_event holds aggregate_type, aggregate_id, aggregate_version, event_type, payload, status. A PUT carries the version the client read. Write the exact statements for the single transaction that applies the edit, records the revision and enqueues 'resource.updated', and give the handler's branch on zero affected rows. Then say what PostgreSQL 16 does under READ COMMITTED when two of these updates hit one row at once.
Approach
- One transaction, three writes, no network call inside it: UPDATE resource SET title = $3, version = version + 1, updated_at = now() WHERE resource_id = $1 AND tenant_id = $4 AND version = $2; then INSERT the resource_revision row at version $2 + 1; then INSERT the outbox_event row at the same aggregate_version. The event goes to a table rather than a broker because no transaction spans both.
- Branch on the affected-row count before doing anything else. Zero has three causes — stale version, wrong tenant, row gone — so re-read once and map to 409 carrying the current version, or 404 for an id outside the caller's tenant, which also stops the endpoint confirming that another tenant's id exists.
- State the engine behaviour instead of assuming it. Under READ COMMITTED the second UPDATE blocks on the row lock, and when the first commits PostgreSQL re-evaluates the WHERE clause against the newly committed row, so the version predicate now fails and the statement reports zero rows. Under REPEATABLE READ the identical collision raises SQLSTATE 40001 instead, so the handler must fold both shapes into one conflict response.
- Keep UNIQUE (resource_id, version) even though the predicate already serialises writers. It is what makes a lost update unwritable if any other path ever reaches the revision table, and it converts a logic bug into 23505 rather than into a silently missing history row.
Follow-up
- A client sends the version it read ten minutes ago and the resource has moved three versions. What is in your 409 so it can resolve the conflict without a full re-fetch?
- Two editors, two disjoint fields, no overlap. Does your answer still refuse the second write, and should it?
Propose a solution for a technical case study, explaining your design process and trade-offs.
Medium · System Design and Architecture
Approach
- Fix the scope first: who calls this, how often, and what they do when it fails.
- Name the read and write paths separately; they rarely have the same bottleneck.
- Choose a partition key and say what query it makes expensive.
- State the consistency you need, and where you are willing to be stale.
Follow-up
- What breaks first when traffic grows ten times?
- How does this behave when that dependency is down for an hour?
How do you approach data consistency in a distributed environment?
Medium · System Design and Architecture
Approach
- Fix the scope first: who calls this, how often, and what they do when it fails.
- Name the read and write paths separately; they rarely have the same bottleneck.
- Choose a partition key and say what query it makes expensive.
- State the consistency you need, and where you are willing to be stale.
Follow-up
- What breaks first when traffic grows ten times?
- How does this behave when that dependency is down for an hour?
Walk me through a challenging technical problem you solved in a previous project.
Medium · Project Experience and Technical Depth
Approach
- Clarify what is being asked and what a complete answer contains.
- State your assumptions explicitly before working the problem.
- Say what you would check first and why it is the highest-information step.
- Work from the requirement backwards to the design.
Follow-up
- What assumption would you test first?
- How would you know your answer was wrong?
How do you approach A/B testing and power analysis in your experiments?
Medium · Project Experience and Technical Depth
Approach
- Clarify what is being asked and what a complete answer contains.
- State your assumptions explicitly before working the problem.
- Say what you would check first and why it is the highest-information step.
- Work from the requirement backwards to the design.
Follow-up
- What assumption would you test first?
- How would you know your answer was wrong?
p99 jumped on one listing filter while p50 stayed flat
Medium · query planning · composite index · percentiles
After a release that added an owner_user_id filter to the resource listing, p99 rose from 90 ms to 1.9 s while p50 stayed at 40 ms. Traffic and row counts are unchanged. resource carries the index (tenant_id, status, updated_at DESC, resource_id DESC). The new query filters tenant_id and owner_user_id, orders by updated_at DESC, resource_id DESC, and takes 20 rows. On PostgreSQL, explain the shape of the regression, prove it from a query plan, and give the index you would add.
Approach
- Start from the shape. A flat p50 with a moved p99 means a subset of requests changed cost, not all of them, so the first job is naming the subset. Bucket the endpoint's latency by the tenant's row count; the natural hypothesis is that large tenants are a small share of requests and all of the tail.
- Get the plan for the new query on a large tenant with EXPLAIN (ANALYZE, BUFFERS). Expect an index scan over the tenant's range, a filter discarding most of it, then a Sort feeding the Limit, possibly reporting Sort Method: external merge Disk. Read actual rows on the scan node, not estimated.
- Explain why the existing index cannot serve it. A composite B-tree is seekable only as a left prefix, and with no equality predicate on status the scan cannot treat updated_at as an ordering, because rows in the tenant's range are ordered by status first. Everything matching must be read and sorted before LIMIT 20 can apply, so a tenant with 400,000 rows pays 400,000 rows to return 20.
- Add (tenant_id, owner_user_id, updated_at DESC, resource_id DESC). Equality on the first two columns leaves the index ordered by updated_at within that pair, so the plan becomes an index scan that stops after 20 rows with no Sort node. PostgreSQL can scan a B-tree backwards, so the DESC markers matter only if the two sort columns ever disagree in direction; keeping them explicit documents the order the keyset cursor depends on.
Follow-up
- The endpoint paginates with OFFSET. What does page 500 cost with your index, and what does the keyset version cost?
- How would you have caught this before release, given that a 10,000-row seed database produces the same plan shape at an unnoticeable cost?
Suggested practice checklist
Built from the rounds and topics Didi Chuxing candidates report.
Day 1 — Map the Didi Chuxing loop
- Write out the reported sequence: Online Assessment, Technical Coding Assessment, System Design Discussion, Project Experience Deep Dive, Final HR Review.
- For each round, write one sentence on what it is judging, from the description above, and mark the one you are least ready for.
Deliverable: A one-page map of the 5 reported rounds, with the weakest marked.
Day 2 — Work Coding interviews (algorithmic problem solving)
- Spend the session on Coding interviews (algorithmic problem solving), which Didi Chuxing candidates report being tested on.
- Write one worked example in Coding interviews (algorithmic problem solving) and time yourself on it.
Deliverable: One timed worked example in Coding interviews (algorithmic problem solving).
Day 3 — Work Data structures (Trie / Prefix Tree)
- Spend the session on Data structures (Trie / Prefix Tree), which Didi Chuxing candidates report being tested on.
- Write one worked example in Data structures (Trie / Prefix Tree) and time yourself on it.
Deliverable: One timed worked example in Data structures (Trie / Prefix Tree).
Day 4 — Work Graph algorithms (Number of Islands)
- Spend the session on Graph algorithms (Number of Islands), which Didi Chuxing candidates report being tested on.
- Write one worked example in Graph algorithms (Number of Islands) and time yourself on it.
Deliverable: One timed worked example in Graph algorithms (Number of Islands).
Day 5 — Answer out loud: Coding and Algorithms
- Answer aloud, timed: Implement a basic Trie (Prefix Tree) and explain its time complexity.
- Answer aloud, timed: Solve the "Number of Islands" problem and provide a follow-up solution for handling additional features like lakes.
Deliverable: Spoken answers to 2 reported Coding and Algorithms question(s), under time.
Day 6 — Answer out loud: System Design and Architecture
- Answer aloud, timed: How would you handle a deadlock situation in a multi-threaded system?
- Answer aloud, timed: Propose a solution for a technical case study, explaining your design process and trade-offs.
Deliverable: Spoken answers to 2 reported System Design and Architecture question(s), under time.
Day 7 — Answer out loud: Project Experience and Technical Depth
- Answer aloud, timed: Walk me through a challenging technical problem you solved in a previous project.
- Answer aloud, timed: Explain the computation complexity of the models you used in your last research project.
Deliverable: Spoken answers to 2 reported Project Experience and Technical Depth question(s), under time.
Behavioural preparation
Behavioural rounds judge the decision you made and what it cost.
Describe your experience with database management and SQL optimization.
Medium · Project Experience and Technical Depth
Approach
- Pick a story where you made the decision, not one where you watched it.
- State the situation in two sentences and spend the rest on the reasoning.
- Give the blast radius: what could have broken, and what you measured.
- Name the disagreement and how you resolved it with evidence.
Follow-up
- What would you do differently if you ran that again?
- How did you know your change caused the improvement?
Narrate an outage you owned from page to postmortem
Hard · incident response · blast radius · postmortems
Pick an incident you personally drove, ideally one where writes were affected rather than reads. In six to eight minutes: state the symptom as it first appeared on a dashboard, the blast radius you established before you knew the cause, the mitigation you applied and when, the mechanism you eventually proved, and the follow-up that would prevent a repeat. Bring numbers: error rate, tenants affected, minutes to mitigate, minutes to resolve. If you cannot name what you measured, choose a different incident.
Approach
- Open on the signal rather than the cause: which metric at which percentile moved, on which service, at what time, so the listener follows the same evidence you had rather than a conclusion you already reached.
- Separate mitigation from diagnosis out loud. State what you did to stop the bleeding (flag off, shed traffic, drain a lease, roll back a deploy) and say plainly that you did it before the mechanism was known, because those are two jobs with different deadlines.
- Establish blast radius in countable terms: how many tenants, how many writes, and crucially whether the effect was loss or only delay. An append-only revision table or a pending outbox row means the change survived and the projection was merely behind, which is a repair rather than a data-loss incident.
- Prove the mechanism instead of asserting it. Name the trace span that grew, the plan that flipped to a sequential scan, the lease that expired, plus one alternative you ruled out and the signal that stayed flat while you ruled it out.
Follow-up
- What would you do differently in the first five minutes, given the same dashboard and no more information?
- Which follow-up action did you deliberately not take, and why was dropping it the right call?
Turn a code review disagreement into a decision
Easy · code review · optimistic concurrency · communication
A colleague's change updates a row with UPDATE resource SET version = version + 1 WHERE resource_id = $1 AND version = $2 and treats an affected-row count of zero as a successful no-op. You read that as a silently lost update; they think returning 200 is friendlier to clients than returning a conflict. Describe how you have handled a review disagreement of this shape: what goes in the comment, when you leave the thread, and who decides. Then write the comment you would leave here, in under 80 words.
Approach
- Sort the disagreement before writing anything. A silently discarded write is a correctness claim about data; the choice between 409 and 412 is taste. Only the first justifies blocking a merge, and saying which one you are doing is most of the value of the comment.
- Make the claim reproducible in the comment itself with an interleaving rather than a principle: A reads version 7, B reads version 7, B commits version 8, A's predicate matches zero rows, A is told it succeeded and A's edit is gone.
- Offer the alternative with its cost attached: return 409 carrying the current version and the revision that won, so the client can re-read and re-apply. Note that automatic retry is not the fix, because a retry re-reads the winner's state and reapplies an intent formed against data that no longer exists.
- Apply an escalation rule you can state: two round trips on the thread, then a call, and the service's owner decides rather than the reviewer. A reviewer who cannot be overruled is a bottleneck with extra steps.
Follow-up
- Where would you put the test that fails if someone reintroduces the swallowed zero rowcount?
- The author says clients cannot handle a 409. How do you check whether that is true?