InterviewStack.io LogoInterviewStack.io

Algorithmic Problem-Solving and Data Structure Selection Questions

The higher-order meta-skill of attacking an unfamiliar problem: recognizing problem archetypes and mapping them to known techniques, decomposing under constraints, and choosing, composing, or designing the right data structures to meet specified operation costs (LRU cache, min-stack, ordered maps, disjoint-set/union-find). Covers reasoning about trade-offs between competing structures and approaches, working through medium-to-hard problems methodically, handling problem variations, and communicating an approach before coding. The connective-tissue topic that ties the individual structure and algorithm topics together, rather than any single structure or algorithm.

HardTechnical
40 practiced

When would you reach for a self-balancing tree (AVL or red-black) instead of a plain hash table, given that both can offer average O(log n) or O(1) operations? Focus on what a balanced tree gives you that a hash table fundamentally cannot (ordered iteration, range queries, worst-case guarantees), and where the balancing overhead is not worth paying.

MediumTechnical
43 practiced

You need the shortest path in a weighted graph. Walk through how you would choose between BFS, Dijkstra, Bellman-Ford, and A*, based on whether edges are weighted, whether negative weights are possible, and whether you need single-source or all-pairs distances. When would A*'s heuristic actually help over plain Dijkstra, and what property must that heuristic have?

EasyTechnical
33 practiced

Compare a recursive and an iterative implementation of the same simple function (say, factorial). When does recursion make the solution clearer, what does it cost you in call-stack usage, and when would you convert to an iterative or tail-recursive form instead?

MediumTechnical
37 practiced

Explain how a disjoint-set (union-find) structure answers 'are these two elements in the same group' and 'merge these two groups' efficiently, and what path compression and union-by-rank each contribute to keeping those operations close to O(1).

EasyTechnical
44 practiced

Compare a contiguous array and a singly linked list on random access, insertion/deletion at head/middle/tail, memory overhead, and cache locality. For a workload that is mostly random reads versus one that is mostly insertions and deletions in the middle, which would you pick and why?

Unlock Full Question Bank

Get access to all Algorithmic Problem-Solving and Data Structure Selection interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.