How to Crack the DSA Coding Round: A Strategy Guide for Indian Freshers
Most Indian engineering students preparing for placements spend 3–4 months grinding LeetCode, solve 150–200 problems, and still blank out in actual coding rounds. The problem is not a lack of practice. It's that they're practicing the wrong thing.
Solving problems at home, at your own pace, with no one watching is fundamentally different from solving them in 45 minutes on a shared screen with an interviewer sitting across from you. The skills that bridge that gap — structured thinking, talking while coding, recognizing problem types fast, testing before declaring done — are almost never practiced. This post is about those skills.
What the Coding Round Is Actually Testing
When a recruiter at a product company or mid-tier startup schedules a coding round, they are not trying to find out if you memorized merge sort. They are trying to answer four questions:
-
Can you recognize the pattern? When you read a new problem, can you identify the underlying structure within 2–3 minutes? Is this a sliding window? A BFS traversal? A dynamic programming problem? Candidates who pattern-match quickly solve more problems in less time — and demonstrate something rote memorization cannot fake.
-
Can you think in front of other people? Interviewers learn more from watching you approach a problem than from seeing you produce a clean solution. Candidates who go silent for ten minutes and then produce code are harder to evaluate — and less likely to pass — than candidates who talk through their reasoning, even imperfectly.
-
Do you handle edge cases? You write a correct solution for the happy path. Do you then think: what if the input is empty? What if all values are negative? What if there's only one element? Strong candidates catch their own edge cases before the interviewer has to point them out.
-
Can you write readable, working code? Not perfectly optimized, not architecturally beautiful — just code that compiles, runs correctly, and handles the stated constraints.
Most freshers are reasonably good at (1) and (4) after a few months of practice. Points (2) and (3) are what separate shortlisted candidates from candidates who "almost made it."
Which Topics Actually Matter — and in What Order
Not all DSA topics are tested equally in campus and fresher interviews. Here is an honest priority order based on what actually appears in coding rounds at Indian product and service companies:
Tier 1 — Must know (appear in nearly every round):
- Arrays and strings: sliding window, two-pointer, prefix sums
- Hash maps and hash sets: frequency counting, fast lookups, complement tricks
- Sorting and binary search: on arrays, on answer spaces, on sorted subarrays
- Recursion and its stack implications
Tier 2 — Very common (expected at most product-company rounds):
- Linked lists: reversal, cycle detection, merge operations
- Trees: BFS, DFS, level-order traversal, lowest common ancestor
- Stacks and queues: monotonic stack, BFS with a queue, parenthesis problems
- Greedy algorithms: interval scheduling, activity selection
Tier 3 — Situational (important for FAANG-tier; less critical for most campus drives):
- Dynamic programming: 1D problems first — Fibonacci variants, coin change, house robber
- Graphs: BFS/DFS on adjacency list, connected components, basic shortest path
- Heaps and priority queues: top-K elements, merge K lists
Don't start with DP. It is the hardest category and the one most freshers reach for first because it looks impressive. Solve 40 Tier-1 problems fluently before touching Tier-3. A candidate who solves a medium array problem cleanly and explains their thinking clearly will nearly always beat a candidate who half-solves a DP problem in disorganized silence.
Concretely: if you have six weeks before placements start, spend the first three entirely on Tier 1. Aim for 30+ clean solutions with verbal explanation, not 100+ problems with half-understood solutions.
How to Behave During a Live Coding Interview
The approach matters as much as the solution. Use this five-step structure every time — even if you have seen the exact problem before.
Step 1 — Read and repeat (1 minute). Read the problem fully. Then say back to the interviewer what it is asking, in your own words. "So we have an unsorted integer array and we need to find two elements that sum to a target — the output is their indices, not the values, correct?" This confirms you understood the problem and buys you thinking time without going silent.
Step 2 — Clarify edge cases (1 minute). Ask about: empty input, negative numbers, duplicates, and the size constraints. "Can the array contain duplicates? Can the same index be used twice?" takes 30 seconds and prevents wasted code.
Step 3 — State your approach before coding (2 minutes). Tell the interviewer what you are going to do and what the time complexity will be — before writing a single line. "I'm going to use a hash map. As I scan left to right, I store each value with its index, and at each step check whether the complement of the current element is already in the map. That's O(n) time and O(n) space." If the interviewer wants a different approach, they will say so now. Pivoting before coding costs nothing; pivoting after fifteen minutes of code is painful.
Step 4 — Code and narrate (10–15 minutes). Write your solution while speaking briefly as you code. "Initialising the map here... iterating through... checking for the complement... storing the current index..." You do not have to narrate every line, but you must not go completely silent. An interviewer who can follow your code as you write it gives hints; one who can't, doesn't.
Step 5 — Test before declaring done (3 minutes). Run through at least two test cases by hand — the provided example and one edge case you identified in Step 2. Do this before you say you are finished. Catching your own bug in testing is fine. Having the interviewer catch it is not catastrophic. Declaring done with a bug they immediately spot is.
Before and After: The Same Problem, Two Different Approaches
Here is a standard medium-level problem that appears regularly in Indian product-company rounds: Given an integer array of 0s and 1s, find the length of the longest subarray with equal numbers of 0s and 1s.
Weak approach:
The candidate reads the problem, nods, and starts coding after 20 seconds of silence. They write nested loops — O(n²) — without stating their approach. Midway through, they realize they cannot efficiently track "equal 0s and 1s" and stall for four minutes. They produce something that passes the example input
[0, 1]but silently fails on[0, 1, 1, 0, 1]. When the interviewer asks about time complexity, they say "n squared, I think." The interviewer writes: struggled to communicate approach, solution incomplete.
Strong approach:
The candidate reads the problem and says: "So we need the longest contiguous subarray where the count of 0s equals the count of 1s. Can the array contain other values? And the subarray can be the entire array if it qualifies, right?"
After confirmation: "Brute force would check all subarrays — O(n²). A cleaner approach: treat each 0 as -1 and track the running sum. When two indices share the same running sum, the subarray between them has equal 0s and 1s. I'll use a hash map to store the first time each sum appears. O(n) time and O(n) space. Let me code that."
They code it in about ten minutes, narrating key steps. Before declaring done, they test
[0, 1, 1, 0, 1]by hand:
- Index 0: sum = -1 → store
{"-1": 0}- Index 1: sum = 0 → store
{"-1": 0, "0": 1}- Index 2: sum = 1 → store
{"0": 1, "-1": 0, "1": 2}- Index 3: sum = 0 → already seen at index 1, length = 3 − 1 = 2
- Index 4: sum = 1 → already seen at index 2, length = 4 − 2 = 2
They notice their initialization should handle the case where sum reaches 0 for the first time (meaning the whole prefix is a valid subarray) and fix it — explaining why as they do it.
The second candidate solved the same problem at the same difficulty. But they demonstrated structured thinking, communication, edge-case awareness, and time complexity reasoning. That is the interview on which they get an offer.
Common Mistakes
Mistake 1: Jumping to code without a plan
The most common failure mode. You read the problem and start typing the first thing that comes to mind, usually the brute force. Interviewers can tell within sixty seconds whether you have a direction or are just typing. Force yourself to spend three minutes before opening the IDE — every time, on every problem, even ones you have seen before.
Mistake 2: Solving in silence
This is the deadliest mistake, and almost no one practices against it. Silence signals one of two things: you are stuck, or you are not thinking. Neither is the impression you want. Even when you are completely confident in your approach, narrate what you are doing. "I'm setting up the base cases here" is enough. The interviewer should never be left guessing what you are trying to do.
Mistake 3: Optimizing before you have a working solution
"I know the optimal approach uses a monotonic stack, so I'll skip the brute force." This fails when the optimal solution has a bug — you have nothing to fall back on. Always build a working solution first, even an O(n²) one, and then optimize. Interviewers consistently prefer a working slower solution over a broken fast one. A working solution also gives you something to discuss for the remaining time.
Mistake 4: Testing only the provided example
The problem statement's example almost always passes. Edge cases — empty input, a single element, all-identical values, negative numbers, the maximum constraint — are where bugs live. When you write test cases, your first is the given example; your second should be something the problem didn't hand you.
Mistake 5: Switching languages under pressure
You have been practicing in Python. The company's interview platform shows Java as the default. You switch because you think it looks more professional. You now lose 20% of your time on syntax. Pick your strongest language, use it consistently, and only switch if the platform specifically requires it. No interviewer gives bonus marks for using Java over Python.
What to Do This Week
Day 1. Pick five Tier-1 problems you have already solved. Solve each one again — but this time, say every step out loud as you code, as if explaining to someone sitting next to you. Record yourself if no one is around. This is uncomfortable. It is also the single most effective preparation for the communication gap that kills most candidates.
Days 2–4. Solve one new problem per day using the five-step structure above. Write the steps out on paper before coding: read and repeat, clarify, state approach and complexity, code and narrate, test. Do not skip steps even when you already know the solution — the discipline is the practice.
Day 5. Set a 45-minute timer and run a full mock round: two problems back to back, no hints, talking out loud throughout. Treat it as an actual interview — close other tabs, sit at a desk, do not pause the timer. Afterward, note the one step in the five-step structure where your narration broke down. That is your focus for the following week.
One structured session per day done this way is worth more than five hours of passive problem-solving on a weekend.
CareerClutch's mock interview feature pairs you with a timed coding environment and gives feedback on approach, communication, and edge-case handling — not just whether your code passes. If you have been grinding problems in isolation, a few sessions with structured feedback will show you exactly where the five-step process breaks down for you specifically.