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
35 practiced

In a graph of interconnected services (or modules, or servers), find every node whose removal would disconnect part of the network (articulation points), and every 'strongly connected' cluster where every node can reach every other node in the cluster. Explain how a single DFS pass with discovery times and low-link values gives you both answers in O(V+E).

MediumTechnical
45 practiced

Given an unsorted array of integers, find the length of the longest run of consecutive integers (they need not be contiguous in the array), in O(n) time. Explain why sorting first would cost you the O(n) bound, and how a hash set lets you check 'is this the start of a run' in O(1).

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
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?

MediumTechnical
42 practiced

Design a greedy compression scheme (Huffman coding) for a payload where some symbols are far more frequent than others. Explain why always merging the two lowest-frequency nodes first produces an optimal prefix-free code, and what breaks the argument if you merged in a different order.

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.