Data Structures and Algorithms (DSA) is the universal filter for software engineering interviews in India. From TCS to Google, every company tests problem-solving ability through DSA questions. The difference between candidates who clear coding rounds and those who do not is rarely raw intelligence: it is the quality and consistency of their preparation. This guide gives you the roadmap, the topic priorities, and the strategies that work.
DSA requirements by company type in India
Not all companies test DSA at the same depth. Calibrate your preparation to your target:
Mass IT recruiters (TCS, Infosys, Wipro, Capgemini): Basic programming: loops, arrays, string manipulation, simple sorting. 1–2 coding questions at easy difficulty. Pass 80%+ of test cases = cleared. LeetCode Easy-level problems are sufficient.
Mid-tier product companies (Myntra, BigBasket, Razorpay, CRED for SDE-1): Medium-difficulty DSA. Expect 2 questions in 90 minutes. Arrays, strings, hashmaps, binary search, two pointers. 100–150 LeetCode problems (mix of easy and medium) is adequate preparation.
Unicorns and large product companies (Swiggy, PhonePe, Flipkart, Meesho): Medium-to-hard DSA. 2–3 problems in 90 minutes. All major topics tested: trees, graphs, DP, sliding window, backtracking.
FAANG India (Amazon, Microsoft, Google, Meta): Hard DSA. 4–5 coding rounds across the loop, each with 1–2 problems. Competitive difficulty. All topics, including segment trees, tries, advanced graph algorithms. 300–500 LeetCode problems of mixed difficulty is the preparation bar.
The 12 DSA patterns that appear in 80% of questions
Instead of memorising 500 solutions, learn these patterns:
- Two Pointers: Sorted array problems, palindrome checks, pair sum. Start with valid palindrome, two sum (sorted array), 3Sum.
- Sliding Window: Subarray and substring problems with constraints. Start with maximum subarray (Kadane's), longest substring without repeating characters.
- Fast and Slow Pointers: Cycle detection in linked lists. Floyd's cycle detection algorithm.
- Binary Search: On sorted arrays and on answers. Start with classic binary search, search in rotated sorted array, find minimum in rotated sorted array.
- Tree BFS / Level Order: Use a queue. All level-order traversal problems.
- Tree DFS: Recursion. Inorder, preorder, postorder, path sum, LCA (Lowest Common Ancestor).
- Dynamic Programming (DP): The hardest pattern. Start with 1D DP (climbing stairs, house robber), then 2D DP (longest common subsequence, edit distance). Avoid DP problems until you are comfortable with recursion.
- Backtracking: N-queens, permutations, subsets, Sudoku solver. Learn the template (choose → explore → unchoose).
- Graph BFS/DFS: Number of islands, word ladder, course schedule. Learn adjacency list representation.
- Union-Find (Disjoint Set): Connected components, redundant connection.
- Heap / Priority Queue: Kth largest element, merge K sorted lists, top K frequent elements.
- Monotonic Stack: Next greater element, largest rectangle in histogram, daily temperatures.
The 90-day DSA study plan for Indian engineers
Week 1–2: Foundation. Arrays, strings, hashmaps. Solve 3–5 problems daily on LeetCode. Aim for 30 easy problems in 2 weeks.
Week 3–4: Core structures. Linked lists, stacks, queues, binary search. 3–5 problems daily. Add 20 more problems.
Week 5–8: Trees and recursion. Binary trees, BST, recursion fundamentals, DFS and BFS on trees. This is the highest-yield preparation for most Indian interviews. 40 problems across this period.
Week 9–10: Graph algorithms. BFS, DFS, Union-Find, topological sort. Solve 20 graph problems.
Week 11–12: Dynamic Programming. Start with 1D DP (10 problems), then 2D DP (10 problems). Do not attempt advanced DP if your target is mass IT or mid-tier: focus time elsewhere.
Week 13 onward: Mock interviews. Do LeetCode contests weekly. Use HireStepX for coding discussion practice (explaining your approach). Time yourself on every problem: interview conditions require solutions within 15–20 minutes.
Tracking: The LeetCode company tags for Amazon, Microsoft, and Flipkart show the specific problems asked at each company. Prioritise these.
After you solve the problem, can you explain it? HireStepX's AI mock interviewer helps you practise thinking aloud and presenting your DSA solutions: the skill that wins coding rounds.
Practice freeCommon mistakes in DSA preparation by Indian engineers
Mistake 1: Watching solutions without solving: Reading or watching an editorial and feeling like you understood it is not the same as solving it. Close the tab, open a blank editor, and write the solution from memory.
Mistake 2: Only solving easy problems: Easy problems build pattern recognition but do not prepare you for medium-difficulty interview questions. Move to medium problems as soon as you can solve easy problems consistently under 10 minutes.
Mistake 3: Not practising time constraints: In a real interview, you have 20–25 minutes per problem. Start timing yourself from Week 5 onward. Speed comes from pattern recognition, not from rushing.
Mistake 4: Skipping the communication habit: Indian engineers often solve problems silently. In interviews, you must think aloud. Practise explaining your approach before coding: 'I am going to use a sliding window here because the problem has a fixed-size subarray constraint and asks for the maximum...'
Mistake 5: Stopping at one solution: After finding a working solution, always ask: Is there a more optimal approach? Interviewers often follow up with 'Can you do better?' Knowing the O(n²) → O(n) improvement path is part of the skill.
Frequently asked questions
Practice these questions on HireStepX