In this article
Before you start
This page is one step of the coding interview learning path.
Why interviewers ask this
A DSA round exists because it shows how a candidate reasons under time pressure, which a résumé cannot. Amazon's recruiter guidance says interviewers look for the ability to apply what you know to solve problems efficiently, and that they will not be evaluating your ability to memorize all the details of each topic (About Amazon, accessed 2026-10-26). Meta's page says its interviewers try to understand your approach to problem solving (Meta Careers, 2022). The term "DSA round" is common wording in Indian campus and product-company hiring, and the steps on this page apply there too.
A weak answer jumps into code in silence and stops at the first working version with no complexity statement. A strong answer restates the problem, names a brute-force solution and its cost, improves it, codes while explaining, and tests by hand. A Staff-level answer also says what changes if the input grows tenfold or arrives as a stream, and which assumption would break the approach.
DSA round from first principles
- DSA round
- A DSA round is a coding interview stage, held live with an interviewer or timed online, in which a candidate solves problems on data structures and algorithms, writes working code and explains the time and memory cost of the solution. It differs from a design round, which asks for an architecture rather than code.
- Online assessment
- An online assessment is a timed set of coding problems that a candidate solves on a web platform without a live interviewer, often before the live rounds. Companies use it to filter many applicants cheaply, and its format and length vary by company, level and year.
- Average-case cost
- Average-case cost is the running time of an operation over typical inputs, as opposed to the worst case on the most unlucky input. A Python dictionary lookup is constant time on average but linear in the worst case, when many keys hash to the same value.
In plain words
Think of a driving test. The examiner does not only care that you reach the destination. They watch how you check mirrors, signal and react. A DSA round works the same way: the interviewer watches your reasoning as well as the final code. The analogy breaks in one place. A driving test has no complexity question at the end, but a DSA round does.
In one precise sentence, a DSA round scores a working solution to an algorithm problem together with your explanation of why it is correct and how its cost grows with the input. So two candidates with the same code can score differently: the one who explains the choices, names the cost and checks the edge cases shows more of the reasoning the interviewer came to see.
Step 1: Clarify the problem and think out loud
Clarifying means restating the problem and agreeing on limits before any code; it also means asking about edge cases and saying your reasoning aloud. Meta's page tells candidates to think out loud (Meta Careers, 2022).
Input: the problem statement. Output: a restated problem with an example and agreed limits. What to say: "Let me restate it. Can the input be empty? Can values repeat? How large can n get?" Those are the three questions. The size question matters because it decides which cost is acceptable: a quadratic solution is fine for a few hundred items and hopeless for a hundred thousand. You now have a problem you both agree on, which is what Step 2 builds on.
Step 2: Agree on an approach and state its cost
Agreeing on an approach means you state the brute-force cost first, then improve it before you code. Meta's page says to be able to discuss the big-O complexity of your approaches (Meta Careers, 2022).
Often the improvement is a hash map or set that replaces an inner loop. The Python documentation says key in d is constant time on average (Python documentation), so a single pass that remembers what it has seen is linear; the worked example below runs this move on a real problem. Subarray sum equals k and longest substring without repeating characters are two more cases of it.
Input: the problem and your brute force. Output: an improved plan the interviewer has agreed to. If time runs short later, you can still finish the plain version, which is better than an unfinished clever one.
Step 3: Write the code and keep talking
Writing the code means you write a working solution first and narrate each block as you go. Interview-prep sites report that a Google screen uses a shared document or plain editor and that you cannot run your code (Devinterview, 2026). Write real code, not pseudo-code, and say what each block is for.
Know the cost of the calls you use. Operating at the end of a Python list moves nothing, so an append is constant time when averaged over many appends, called amortized cost, while operating at index 0 moves the rest of the list and is linear (Python documentation). A collections.deque is constant time at both ends (Python documentation). The Python interview questions page covers more of these costs, and defaultdict saves lines when you count things.
Step 4: Test it, state complexity and take the follow-up
Testing means you test by hand and state time and space complexity before you are asked, walking one small example and one edge case through your code. Meta's page says its questions are meant to be solved in 10-30 minutes (Meta Careers, 2022).
Input: your finished code. Output: a corrected solution and a one-sentence cost statement such as "one pass, linear time, linear extra memory for the map". Prep sites report that Google interviewers add follow-ups that change constraints mid-problem (Devinterview, 2026) and that Amazon sessions include follow-up questions on your approach (Exponent, 2026). Treat a new constraint as the next round of Step 2: restate it, adjust the plan, change the code.
Step-by-step description
- Restate the problem and agree on limits.
- Name brute force, its cost and the improvement.
- Write a working version and narrate it.
- Walk an example by hand and state complexity.
- Clarifying means restating the problem and agreeing on limits before any code.
- State the brute-force cost first, then improve it before you code.
- Write a working solution first and narrate each block as you go.
- Test by hand and state time and space complexity before you are asked.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Worked example
A 45-minute coding interview in Meta's full loop is 5 minutes of introductions, 35 of coding and 5 for your questions (Meta Careers, 2022).
Take one problem that fills the 35-minute coding block. An illustrative split of one problem is 5 minutes to clarify, 5 to plan, 18 to code and 7 to test.1 If two problems share the 35-minute block, each gets 17.5 minutes.1
| Quantity | Value (illustrative) |
|---|---|
| Clarify the problem | 5 minutes |
| Agree on an approach | 5 minutes |
| Write the code | 18 minutes |
| Test and state complexity | 7 minutes |
| Each of two problems in 35 minutes | 17.5 minutes |
| Nested-loop steps, n = 100,000 | 10,000,000,000 |
| One-pass steps, n = 100,000 | 100,000 |
| Membership checks (comparisons), list scan: 1,000 lookups in 1,000,000 items, worst case | 1,000,000,000 |
| Membership checks (comparisons), set: the same 1,000 lookups, average case | 1,000 |
The step counts show why Step 2 comes before Step 3. For an illustrative n of 100,000, a nested loop does up to n squared steps, 10,000,000,000, and one pass does 100,000, a ratio of 100,000.1 The list-against-set rows use the Python documentation: in on a list scans item by item, while in on a set is constant time on average (Python documentation).
Text description of the diagram
- A 45-minute coding interview is 5 minutes of introductions, 35 of coding and 5 for your questions.
- An illustrative split is 5 minutes to clarify, 5 to plan, 18 to code and 7 to test.
One problem, start to finish: two numbers that sum to a target
Take the illustrative list [4, 9, 1, 6, 3, 8] and the target 11. The task is to return the positions of two numbers that add to the target; the answer is positions 4 and 5, the numbers 3 and 8.1
Say the brute force first: "I try every pair with two nested loops."
def two_sum_brute(nums, target):
for i in range(len(nums)):
for j in range(i + 1, len(nums)):
if nums[i] + nums[j] == target:
return i, j
return NoneThen state its cost: "That is up to n times n minus one over two checks, so quadratic." On this list the right pair is the last one tried, after 15 comparisons.1
Now improve it: "For each number x, I only need to know whether target minus x appeared earlier. A dictionary answers that in constant time on average, so one pass is enough."
def two_sum(nums, target):
seen = {} # value -> position
for i, x in enumerate(nums):
if target - x in seen: # average-case constant-time lookup
return seen[target - x], i
seen[x] = i
return NoneTest by hand while you speak: "4 needs 7, not seen, store 4. 9 needs 2, store it. 1 needs 10, 6 needs 5, 3 needs 8, all unseen. Then 8 needs 3, and 3 is stored at position 4, so I return 4 and 5." That took 6 lookups, and both functions return the same pair.1 Finish with the cost statement: "One pass, linear time on average, linear extra memory for the dictionary." An empty list returns None, which covers the edge case you asked about in Step 1.
Trade-offs and edge cases
Do Meta, Amazon and Google run the same DSA round?
No. Format and length differ by company, level and year. Meta's screen is primarily a coding interview with one or more coding questions, and Meta's coding interview in the full loop runs 45 minutes and is typically harder than the screen (Meta Careers, 2022). That page dates from 2022 and may predate later changes.
Meta publishes its own format, while the Amazon and Google details come from interview-prep sites. One prep guide reports that Amazon's process opens with a timed online assessment and that coding interviews run 45 to 60 minutes with one or two problems (Exponent, 2026); other guides give different timings, so treat them as varying. Prep sites report a recruiter call, then a 45-minute live coding screen at Google, and three to four 45-minute onsite rounds that mix coding with a behavioral round (Devinterview, 2026).
Text description of the diagram
- Meta publishes its own format, while the Amazon and Google details come from interview-prep sites.
- Meta's coding interview in the full loop runs 45 minutes.
What changed in 2025 and 2026?
Exponent reports that Amazon's online assessment can be AI-assisted while live loop rounds prohibit AI use (Exponent, 2026). Devinterview notes that as of 2025 Google has shifted toward at least one in-person round (Devinterview, 2026). Both are reports from prep sites, so confirm the rules in your own invitation.
Is a hash map lookup always constant time?
No. Dictionary and set lookups are constant time on average and linear in the worst case, when every key hashes to the same value (Python documentation). The documentation lists average-case times because they assume a hash function good enough to make collisions uncommon. In an interview, say "constant time on average" and name the worst case if asked.
Which topics should you prepare?
Meta lists lists, arrays, hash tables, stacks, queues, graphs, trees, heaps, sorts, searches and traversals such as breadth-first search (BFS) and depth-first search (DFS) (Meta Careers, 2022). Pattern examples: merge intervals, topological sort, K closest points to origin and the monotonic stack. Some prep sites claim dynamic programming is or is not asked at a given company; no official page read for this article confirms either, so prepare it as a topic without assuming.
Can you run your code?
Do not assume so. Prep sites report that Google screens use a plain editor or shared document and that code cannot be run (Devinterview, 2026). Plan to test by hand, as in Step 4.
How to answer it in an interview
Walk me through how you would approach this coding problem.
Before I code, let me restate the problem and check the limits: can the input be empty, can values repeat, and how large can n get? My first idea is brute force with two nested loops, which is quadratic. I can improve it by storing what I have seen in a hash map, so one pass is linear on average, with extra memory as the trade-off. I will write the working version first, talk through each block as I go, then test one small example and an edge case by hand, and state time and space complexity at the end.
The spoken structure: restate and ask, give brute force with its cost, give the improvement with its trade-off, then code, test and state complexity.
Common mistakes
- "I memorized the solution, so I will type it." (wrong) Amazon says interviewers will not be evaluating your ability to memorize all the details. (right) "Here is why this approach works and what it costs."
- "I will code in silence and explain at the end." (wrong) Meta's page tells candidates to think out loud. (right) "This block builds the map; this loop checks each item."
- "A dictionary lookup is always constant time." (wrong) It is constant on average and linear in the worst case. (right) "Constant time on average."
- "Inserting at index 0 in a loop is fine." (wrong) Each insert shifts the whole list. (right) "I will use a deque for constant time at both ends."
- "I will skip the working version and chase the optimal one." (wrong) An unfinished clever solution leaves nothing to test or discuss. (right) "Working version first, then I improve it."
Follow-up questions
How long is a DSA round interview?
It varies. Meta's page describes a 45-minute coding interview in the full loop (Meta Careers, 2022), and prep sites report 45 to 60 minutes at Amazon (Exponent, 2026) and 45 minutes at Google (Devinterview, 2026). Treat the number as a range and confirm with your recruiter.
What topics come up in a DSA round?
Meta lists arrays, hash tables, stacks, queues, graphs, trees, heaps, sorting, searching and traversals. Read coding interview patterns and method for the full pattern list.
What should you do if you get stuck in a DSA round?
Say where you are stuck, share your reasoning and ask the interviewer for a hint. A working simple version is better than silence.
Is there an online assessment before the DSA rounds?
For some companies and levels, yes. A prep guide reports a timed online assessment at Amazon, but timings conflict between sources, so check your own invitation.
How should you practice for a DSA round?
Solve problems out loud with a timer, in a plain editor, and finish by stating complexity. Start with a pattern such as longest substring without repeating characters and repeat the four steps each time.
- A DSA round tests working code and your explanation of its cost, not memorized solutions.
- Follow four steps: clarify and think aloud, agree an approach, code while talking, then test and state complexity.
- Formats differ by company, level and year; only Meta's here comes from the company.
- Dictionary and set lookups are constant time on average, not always.
- Write a working version first, then improve it.
Sources
- Preparing for your software engineering interview at Meta — Meta Careers, 6 Oct 2022
- Time complexity of operations on built-in types — Python documentation, 26 Oct 2026
- collections: container datatypes (deque) — Python documentation, 26 Oct 2026
- Amazon recruiters share 6 job interview tips for software development engineers — About Amazon, 26 Oct 2026
- Amazon SDE interview guide — Exponent (interview-prep site), 26 Jun 2026
- Google interview process, end to end — Devinterview (interview-prep site), 8 Oct 2026