DSA Roadmap for Placements: What Matters in 2026
Practical DSA roadmap for campus placements in India: topic priorities, platform choices, company patterns, and time management.

The DSA anxiety problem
Placement season is six months away, you've solved maybe 30 problems on any platform, and you can't sleep. You lie awake at 2 AM scrolling LinkedIn posts where people your age brag about 500+ LeetCode solves, FAANG internship conversions and Rs 40 LPA fresher packages. College WhatsApp groups fill up with "bro which DSA sheet should I follow" and "is Striver's A2Z enough for TCS NQT." Everyone is panicking, and the panic does more damage than any gap in preparation.
The usual result is paralysis: weeks of bouncing between YouTube tutorials and ten different problem lists, finishing none of them. If that's you right now, take a breath. The biggest lesson is simple: most students over-prepare on topics that rarely come up and under-prepare on topics that appear in every single interview.
The gap between what YouTube courses teach and what interviewers ask is much wider than you'd expect.
So this won't be another generic "learn arrays, then trees, then graphs" list. I want to give you a straight read on what companies in India test, how to spend your limited time, and the mistakes that cost students offers they should have had.
What companies ask
Before you start grinding problems, understand what the test looks like. Indian placement interviews fall into two broad categories, and the DSA expectations differ wildly between them.
Service companies (TCS, Infosys, Wipro, Cognizant, Accenture)
These are bulk hirers, taking thousands of students per cycle. Their online assessments are standardized and cover:
- Basic arrays and strings: sorting, searching, pattern matching
- Simple math: GCD, LCM, prime numbers, factorial, Fibonacci
- Basic data structures: stacks, queues, linked lists (implementation, not problem-solving)
- SQL queries: joins, group by, subqueries
- Pseudocode interpretation: reading and tracing code logic
The DSA bar isn't high here. If you can solve easy-to-medium problems on any platform, you'll clear these rounds without much trouble. What usually decides a service company placement is the aptitude round (verbal, logical, quantitative) and how well you communicate in the interview. Lots of students underestimate that part, and it costs them.
Product companies (Google, Microsoft, Amazon, Flipkart, PhonePe, Razorpay, etc.)
The hiring bar is a different animal. These interviews test:
- Problem-solving ability: can you break down an unfamiliar problem?
- Optimal solutions: brute force gets you partial credit at best
- Code quality: clean, bug-free code written under pressure
- Communication: explaining your thought process clearly while you work
The topics overlap heavily across companies. Based on commonly reported interview questions from Indian placement drives (interview experiences on GeeksforGeeks, LeetCode Discuss and similar), this is a rough frequency distribution. Let it drive your whole preparation plan:
| Topic | Frequency in Interviews | Priority |
|---|---|---|
| Arrays / Strings | Very High | Must Learn |
| Hashing (HashMaps/Sets) | Very High | Must Learn |
| Two Pointers / Sliding Window | High | Must Learn |
| Binary Search | High | Must Learn |
| Stacks / Queues | High | Must Learn |
| Linked Lists | Medium-High | Must Learn |
| Trees (Binary Trees, BST) | High | Must Learn |
| Graphs (BFS, DFS) | Medium | Should Learn |
| Dynamic Programming | Medium-High | Should Learn |
| Recursion / Backtracking | Medium | Should Learn |
| Heaps / Priority Queues | Medium | Should Learn |
| Tries | Low-Medium | Nice to Have |
| Segment Trees / BIT | Low | Skip for most |
| Advanced Graph (Dijkstra, etc.) | Low | Nice to Have |
Segment Trees and advanced graph algorithms sit at the bottom. I suspect 90% of students who study them during placement prep never see them in an actual interview, while hashing and two pointers show up everywhere and some students barely practice them.
The topic order, and why
This is the order I recommend, with my reasoning for each stage. Every stage builds on the one before it, so please don't skip ahead.
Stage 1: Arrays and strings (2-3 weeks)
Everything else sits on top of this. Over 40% of placement coding questions involve arrays or strings in some form, and if you're weak here, trees, graphs and DP won't save you. Arrays and strings come first.
Patterns to master:
- Prefix sums: subarray sum queries in O(1)
- Kadane's algorithm: maximum subarray sum
- Dutch National Flag: sort an array with three distinct values
- Matrix traversal: row-wise, column-wise, spiral, diagonal
- String manipulation: palindrome checks, anagram grouping, substring search
# Kadane's Algorithm — Maximum Subarray Sum
def max_subarray_sum(nums):
max_sum = nums[0]
current_sum = nums[0]
for i in range(1, len(nums)):
current_sum = max(nums[i], current_sum + nums[i])
max_sum = max(max_sum, current_sum)
return max_sum
Target: 40-50 array/string problems across easy and medium difficulty. Don't rush them. Understand each pattern well enough to explain it to someone else.
Stage 2: Hashing (1-2 weeks)
HashMaps and HashSets are probably the most underrated tools in interview prep. A shocking number of "hard" problems turn trivial once you think in hash lookups. It's common to fight a brute force approach for 20 minutes and then solve the same problem in 5 once you think of a HashMap.
Patterns:
- Frequency counting: character/element frequency maps
- The Two Sum pattern: find pairs with a given sum
- Group by: group anagrams, group by a property
- Subarray with a given sum: prefix sum plus a hash map
# Two Sum using HashMap — O(n) time, O(n) space
def two_sum(nums, target):
seen = {}
for i, num in enumerate(nums):
complement = target - num
if complement in seen:
return [seen[complement], i]
seen[num] = i
return []
Target: 20-25 hashing problems. This stage goes fast because the concept is simple. The hard part is recognizing when a problem calls for it.
Stage 3: Two pointers and sliding window (2 weeks)
These two techniques come up constantly. They're also where the jump from brute force (O(n^2)) to an O(n) answer is most dramatic, and interviewers love watching a candidate make that leap.
Two pointer patterns:
- Opposite direction: pointers from the start and end (container with most water, valid palindrome)
- Same direction: slow and fast pointers (remove duplicates, linked list cycle detection)
- Three pointers: three sum, sort colors
Sliding window patterns:
- Fixed size window: maximum sum subarray of size k
- Variable size window: smallest subarray with sum >= target
- Window with a HashMap: longest substring without repeating characters
# Longest Substring Without Repeating Characters
def length_of_longest_substring(s):
char_index = {}
max_length = 0
start = 0
for end in range(len(s)):
if s[end] in char_index and char_index[s[end]] >= start:
start = char_index[s[end]] + 1
char_index[s[end]] = end
max_length = max(max_length, end - start + 1)
return max_length
Target: 25-30 problems. Learn the templates, and more importantly learn to recognize when to use them, because spotting the pattern is the skill being tested.
Stage 4: Binary search (1-2 weeks)
Binary search covers far more than "find an element in a sorted array." It's a problem-solving framework that applies to a surprising range of questions: rotated arrays, peak elements, and binary search on the answer (minimizing a maximum, kth smallest, and so on). Once it clicks, you'll start seeing chances to use it everywhere.
Variations to know:
- Standard binary search on sorted arrays
- Lower bound / upper bound: first and last occurrence
- Search in a rotated sorted array
- Binary search on answer: aggressive cows, book allocation, painters partition
# Binary Search on Answer — Minimum capacity to ship packages in D days
def ship_within_days(weights, days):
left, right = max(weights), sum(weights)
while left < right:
mid = (left + right) // 2
needed_days = 1
current_load = 0
for w in weights:
if current_load + w > mid:
needed_days += 1
current_load = 0
current_load += w
if needed_days <= days:
right = mid
else:
left = mid + 1
return left
Target: 20-25 problems. Spend extra time on "binary search on answer" problems. They're interview favorites, most students don't practice them enough, and I think they might be the highest-value category in all of DSA prep.
Stage 5: Stacks, queues and linked lists (2 weeks)
Stacks and queues are simple data structures that lead to elegant solutions: bracket matching, monotonic stack problems (next greater element, largest rectangle in histogram) and queue-based BFS.
Linked lists get tested less often than five years ago, but you still need the basics: reversal, cycle detection, merging two sorted lists and finding the middle element. Skip the exotic linked list problems; they aren't worth your time.
Target: 30-35 problems across all three.
Stage 6: Trees (2-3 weeks)
Binary trees and BSTs are interview staples. Almost every product company interview includes at least one tree problem, sometimes two, so you can't afford a gap here.
Must-know patterns:
- Traversals: inorder, preorder, postorder (recursive and iterative)
- Level order traversal (BFS)
- Height / depth calculations
- LCA (Lowest Common Ancestor)
- View problems: left view, right view, top view, bottom view
- BST operations: search, insert, delete, validate BST
# Lowest Common Ancestor of a Binary Tree
def lowest_common_ancestor(root, p, q):
if not root or root == p or root == q:
return root
left = lowest_common_ancestor(root.left, p, q)
right = lowest_common_ancestor(root.right, p, q)
if left and right:
return root
return left if left else right
Target: 30-40 problems. Trees come in a lot of varieties, so give this stage real time. Don't skip iterative traversals either, because interviewers sometimes ask for the non-recursive version specifically.
Stage 7: Graphs (2 weeks)
Graph problems scare students, and I get why. The good news is that the core techniques you need are few, far fewer than textbooks make it seem:
- BFS: shortest path in unweighted graphs, level-order processing
- DFS: connected components, cycle detection, topological sort
- Union-Find: connected components, redundant connections
Most placement interviews stick to BFS and DFS applications. Dijkstra, Bellman-Ford and the other advanced algorithms rarely appear unless you're interviewing at Google or a company heavy on competitive programming. Two weeks of solid BFS/DFS covers 90% of what you'll face, so don't spend three weeks on graph theory.
Target: 20-25 problems on BFS, DFS and their applications.
Stage 8: Dynamic programming (3-4 weeks)
DP is the topic students fear most, and that's understandable, since it asks for a different way of thinking from everything else. What I tell every student I mentor is that most placement DP problems fall into a handful of categories. Learn those, and the individual problems start to click:
- 1D DP: climbing stairs, house robber, coin change
- 2D DP: longest common subsequence, edit distance, grid paths
- Knapsack variants: 0/1 knapsack, unbounded knapsack, subset sum
- DP on strings: palindromic substrings, longest palindromic subsequence
- DP on intervals: matrix chain multiplication, burst balloons
You don't need 200 DP problems. Understand the categories, learn to recognize them, and solve 5-8 problems from each. That's enough. The students who try to brute-force their way through every DP problem on LeetCode tend to come out more confused, in my experience.
Target: 40-50 problems across the categories above.
How many problems should you solve?
The internet says 500+, and some people brag about 1000+. Quality beats quantity by a big margin.
A student who solves 200 problems carefully, understanding each pattern, writing clean code and going back over the ones they couldn't crack, will beat someone who rushes through 500 copied solutions they half understand. I've seen it happen over and over.
My target for you: 200-300 problems you understand well, over 4-5 months.
That works out to about 2-3 problems a day, which you can sustain alongside college coursework, and 4-5 a day on weekends. Take rest days too. Your brain needs time to consolidate what you've learned.
Platform comparison
| Platform | Best For | Indian Relevance | Cost |
|---|---|---|---|
| LeetCode | Product company prep, pattern recognition | Very High | Free (Premium: about $35/month) |
| Codeforces | Competitive programming, speed | Medium (for CP culture) | Free |
| GeeksforGeeks | Theory + practice, service company prep | Very High | Free (Courses: paid) |
| Coding Ninjas (Naukri) | Structured learning, company-specific questions | High | Paid (Rs 6,000-20,000) |
| InterviewBit | Focused interview prep | High | Free |
| HackerRank | Certifications, some companies use it for tests | Medium | Free |
Use LeetCode as your main platform for solving problems, and GeeksforGeeks for theory and explanations when a concept has you stuck. If you want structured guidance, Coding Ninjas (now under Naukri) and take U forward (Striver's resources, free on YouTube) are both excellent.
LeetCode Premium is worth it if you're targeting specific companies, because the company-wise question lists and frequency data save a lot of time. At about $35 a month (roughly Rs 3,000), it probably feels steep on a student budget. It might still be the highest-ROI money you spend all year.
Language choice: C++ vs Java vs Python
People have argued about this for years. My practical take:
C++ is the fastest to run, which matters on platforms with tight time limits, and the STL (Standard Template Library) is powerful. Most competitive programming resources and editorials are in C++. The syntax is verbose, though, and debugging is harder than it needs to be.
Java is the strongest pick for enterprise job interviews, since service companies love it. The standard library has excellent data structure support. It's wordier than Python but safer thanks to type checking, and a good choice if you're also aiming at Java backend roles.
Python has the easiest syntax and is the fastest to write in an interview. Lists, dicts and sets are built in and very convenient. It runs slower than C++ and Java, which now and then causes a TLE (Time Limit Exceeded) on some platforms. Annoying, but rare.
Whichever language you choose, knowing the most in-demand programming languages helps you match your DSA language to the roles you want.
For placement prep specifically:
- Targeting product companies? Use C++ or Python. C++ if you want maximum control and speed, Python if you want to write less code under pressure. Both are perfectly valid.
- Targeting service companies? Use Java. Many service companies ask for Java in their coding rounds, and knowing it well feeds into the backend developer roles they hire for.
- Not sure? Start learning DSA in Python, since the concepts matter more than the language, then learn to write the same solutions in C++ or Java as placement season gets closer.
Don't switch languages mid-preparation. I can't stress this enough. Pick one, learn its standard library for DSA, and stick with it until placements are over.
Common mistakes in contests and interviews
After mentoring dozens of students, I keep seeing the same patterns, and they're painful to watch because they're so avoidable.
1. Not reading the problem fully
Students see a problem that "looks like" one they've done and start coding right away. After 20 minutes of debugging, they realize the constraints were different, or there was an edge case in the problem statement they skipped right past.
The fix: read the problem at least twice. Identify the input constraints, which hint at the expected time complexity, and walk through the examples by hand before you write a line of code.
2. Jumping to code without a plan
The right sequence is to understand the problem, identify the pattern, plan the solution on paper or in your head, and only then code. Most students skip steps 2 and 3 entirely, I think because they feel pressure to start typing.
The fix: before writing any code, explain your approach out loud (or in your head) in 2-3 sentences. If you can't explain it clearly, you don't understand it well enough to code it. It's a simple test, and it never fails.
3. Ignoring edge cases
Empty arrays, single-element arrays, every element the same, negative numbers, integer overflow. These trip up students who test only with the given examples and call it done.
The fix: after coding, mentally run empty input, a single element, all-identical elements, very large input and negative values. It takes two minutes and saves you from "wrong answer on test case 47."
4. Spending too long on one problem
In an interview or timed test, sinking 40 minutes into one problem while two others sit unsolved is a terrible strategy. You'd score better solving two easy problems than half-solving one hard one.
The fix: if you don't have a clear approach within 10 minutes, move on and come back if time allows. Partial solutions often earn partial credit, and something beats nothing.
5. Not practicing under time pressure
Solving problems at home with no timer feels nothing like a 90-minute online assessment with your career on the line.
The fix: do weekly mock tests. LeetCode's Weekly and Biweekly contests work well for this, and so do Codeforces Div 2/3 rounds. Get used to the pressure before the real thing.
How to approach unseen problems
Every interview will throw at least one problem you've never seen. That's deliberate, since they're testing problem-solving rather than memory, and accepting it makes it less scary.
A framework that works:
-
Identify the input/output types. Array to number? String to string? Array to array? That alone narrows down the possible approaches.
-
Check the constraints. If n is at most 10^5, you need O(n log n) or better. If n is at most 20, brute force or backtracking is fine, and if n is at most 10^3, O(n^2) is acceptable. The constraints are hints, so read them.
-
Try brute force first. Even when it's too slow, writing it out helps you understand the problem and often shows you an optimization you'd have missed.
-
Ask whether sorting the input helps. Sorting often simplifies a problem dramatically and "only" costs O(n log n), so it's worth considering for almost any array problem.
-
Ask whether a HashMap helps. If you're doing repeated lookups or counting, hashing turns O(n) lookups into O(1). It's probably the most useful optimization technique of all.
-
Ask whether there are overlapping subproblems. If your brute force solves the same subproblem several times, DP might apply; look for that pattern in the recursion tree.
-
Ask whether there's a monotonic property to binary search on. If "too small" and "too big" have a clear boundary, binary search on that boundary.
Company-wise patterns
A quick reference for what specific companies tend to ask. Take it with a grain of salt, since patterns shift from year to year, but the general trends hold.
TCS Digital / NQT
- 1-2 coding questions (easy-medium)
- Focus on arrays, strings, basic math
- Time limit: generous (usually 2-3 hours for 2-3 questions)
- SQL question likely
Infosys SP / DSE
- 3 coding questions (easy to medium)
- Arrays, strings, sorting, basic recursion
- Pseudocode interpretation
- The aptitude section carries a lot of weight, so don't neglect it
Wipro Elite / Turbo
- 2 coding questions (easy)
- Very basic: simple loops, conditionals, patterns
- Heavy focus on aptitude and English
Amazon (SDE-1)
- 2 coding questions in OA (medium-hard)
- Trees, graphs, DP, sliding window, heap
- System design discussion (basic) in interviews
- Leadership principles in the behavioral round, which they take seriously
Google (SWE Intern / L3)
- Graph problems, DP, greedy algorithms
- Emphasis on optimal solutions and clean code
- Multiple interview rounds, each with 1-2 problems
- Expect follow-up questions ("what if the input was a stream?")
Microsoft (SDE / SWE)
- Arrays, trees, linked lists, strings
- Medium difficulty, emphasis on code quality
- System design for experienced roles
- Behavioral round with situational questions
Flipkart / PhonePe
- Similar to Amazon in difficulty
- Machine coding round (build a small system in 90 minutes)
- Focus on OOP design and clean architecture
Time management: a 5-month plan
| Month | Focus | Problems/Week | Activity |
|---|---|---|---|
| Month 1 | Arrays, Strings, Hashing | 15-20 | Foundation building |
| Month 2 | Two Pointers, Binary Search, Stacks/Queues | 15-20 | Pattern recognition |
| Month 3 | Trees, Linked Lists, Recursion | 15-20 | Core data structures |
| Month 4 | Graphs, DP (basic patterns) | 12-15 | Advanced topics |
| Month 5 | Revision, Mock Tests, Company-Specific | 10-12 | Exam preparation mode |
In Month 5, stop learning new topics completely. Revise the problems you've solved, take part in weekly contests, and prepare for the specific companies you're interviewing with. Product companies will likely add a system design interview round alongside DSA, so start getting familiar with those concepts in Month 4 and you'll be ready when it counts.
Consistency beats intensity
If there's one thing to take away, it's this: placement preparation is a marathon.
The students who succeed aren't the ones with the biggest solve counts. They build strong fundamentals, practice steadily and look after their mental health through a stressful few months. Cramming 100 problems in a panic-fueled weekend leaves you with almost nothing, while 3 problems a day for four months gets you into interviews with quiet confidence. You can guess which one gets the offers.
It's not glamorous advice and it won't get likes on LinkedIn, but it's true.
Take breaks and exercise. Sleep enough, and I mean properly, not the "I'll sleep when placements are over" kind. Talk to friends about things other than DSA, and watch a movie without feeling guilty. Placement season is a few important months of your life, but it isn't everything, and a rejection from one company doesn't define your career. Plenty of excellent engineers never got placed through campus at all.
Once you land that offer, our India tech salary guide for 2026 can help you evaluate and negotiate the package.
Consistency beats intensity. A problem or two a day, every day, builds the habit, and the results follow, even if not right away.
Anurag Sinha
Founder & Editor
Founder and editor of Tech Tips India. Writes tech guides, buying guides and explainers for Indian readers, with rupee pricing and local availability. Product roundups are researched from manufacturer specs and published reviews, not lab testing.
Stay Ahead in Tech
Get the latest tech news, tutorials, and reviews delivered straight to your inbox every week.
No spam ever. Unsubscribe anytime.
Comments (0)
Leave a Comment
All comments are moderated before appearing. Please be respectful and follow our community guidelines.
Related Articles

API Design: REST and GraphQL Patterns That Scale
API design guide covering REST, GraphQL, tRPC, authentication, rate limiting, error handling, and testing with Node.js examples.

Redis Caching: Speed Up Your App in Practice
Redis caching strategies, data structures, and cache invalidation with Node.js, Next.js, and Upstash integration guide.

TypeScript Advanced Patterns You Should Know
Advanced TypeScript: discriminated unions, template literals, branded types, builder pattern, and Zod validation with examples.