Autocoder

DSA Interview Questions: Topic-wise Question Banks

Last updated 2026-11-19

Data structures and algorithms questions decide most coding rounds, whether they appear in an online test, a whiteboard-style interview or a live pair-programming session. The guides in this section split the subject by topic, such as arrays, strings, hashing, linked lists, trees, graphs and dynamic programming, and work through the patterns that recur within each.

The goal is pattern recognition. Almost every medium-level question is a known pattern wearing a new story. If you can name the pattern, state its complexity and write it without hesitation, you will solve unfamiliar problems far faster than someone who has only memorised solutions.

Learn patterns before volume

Take one topic at a time and finish its bank before starting another. Within a topic, the questions are ordered from easy to hard so that you meet the basic pattern first and its harder variations later. Sliding window, two pointers, prefix sums, binary search on the answer and monotonic stacks each unlock a family of problems.

After each question, write one sentence naming the pattern and the signal in the problem statement that suggests it. Sorted input hints at two pointers or binary search. A contiguous subarray with a constraint hints at a sliding window or prefix sums. Counting or deduplication hints at hashing.

Always state complexity

Interviewers expect time and space complexity with every solution. Practise saying it out loud, including what n means. A solution that is correct but whose complexity you cannot justify will score lower than a slightly slower one you can analyse clearly. Each worked answer here states both so you can compare your own analysis against it.

A sensible order of topics

Practising under test conditions

Online tests usually give two or three problems in 60 to 90 minutes, so reading speed and edge case discipline matter as much as algorithms. Set a timer, write in the language you will actually use, and test your code on empty input, a single element, duplicates and the largest allowed size before you call it done.

Choosing a language

Use one language consistently. Python is compact and quick to write, while Java and C++ are common in company tests and give you stronger control over performance. Whatever you pick, know its standard collections well. The programming language guides cover the language-specific questions that follow from the algorithms.

All 50 guides in this section

Frequently asked questions

How many DSA problems do I need to solve for placements?

There is no magic number. Covering every topic with a few well-understood problems each, and being able to redo them from scratch, is worth more than a large count of half-remembered solutions.

Which language is best for DSA interviews?

The one you can write fastest without syntax errors. Python is shortest, Java and C++ are widely accepted everywhere. Switching language late in preparation usually costs more time than it saves.

Should I memorise solutions?

Memorise patterns and their complexity, not code. Interviewers change constraints, and a memorised solution does not adapt.

Where do I practise after reading a topic bank?

Re-solve each question without looking, then try similar problems on any practice platform. The how-to guides under how-to explain how common test platforms behave.

Related guides