DSA Interview FAQ
Coding-interview Q&A by topic — arrays, trees, graphs, DP, and how to communicate under pressure.
Frequently asked
DSA interview Q&A by topic
96 detailed answers across 14 topics.
Interview process
How to approach problems, talk complexity, and code under pressure
Arrays & hashing
Hash maps, frequency counting, prefix sums, and space–time tradeoffs
Two pointers & sliding window
Pair scans, fixed/variable windows, and subarray templates
Stacks & queues
Matching, monotonic stacks, deques, and BFS queues
Linked lists
Pointer craft, reversal, cycles, and merge patterns
Trees & BSTs
DFS/BFS traversals, recursion, and search-tree invariants
Heaps & priority queues
Top-K, streaming medians, and scheduling with heaps
Graphs — BFS/DFS
Traversals, connectivity, topo sort, and shortest paths
Binary search
Sorted arrays, boundaries, and searching the answer space
Backtracking
Subsets, permutations, combinations, and pruning
Dynamic programming
1D/2D DP, knapsack, LIS, and classic recurrences
Greedy & intervals
Local optima, merge/schedule intervals, and sweep lines
Bit manipulation & math
XOR tricks, masks, gcd, and modular arithmetic
System vs coding patterns
When design beats algorithms, and complexity tradeoffs in products