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.

EasyTechnical
35 practiced

What does it mean for a sorting algorithm to be stable, and why does that matter when you are sorting by a secondary key after already having sorted by a primary one? Name a stable and an unstable sort and say what would break if you used the unstable one in a multi-key sort.

MediumTechnical
34 practiced

Given k sorted linked lists (or k sorted iterators/streams), merge them into a single sorted list or stream. Aim for O(n log k) time where n is the total number of elements, and explain why a heap keyed on each list's current head gets you there instead of repeatedly scanning all k heads for the minimum.

MediumTechnical
35 practiced

Given a list of strings, group the ones that are anagrams of each other into the same bucket. Compare using a sorted-characters string as the grouping key against a character-frequency tuple as the key, and say which scales better as the strings get longer.

HardTechnical
57 practiced

You are given a stream of pairwise connections arriving over time (for example, dependency edges or account-merge events) and need to answer 'are these two items connected yet' after each one, without recomputing connectivity from scratch. Implement a structure that answers both the connect and the query operation efficiently, and explain why a fresh BFS/DFS after every update would not scale.

MediumTechnical
37 practiced

Design a stack that supports push, pop, top, and retrieving the current minimum element, all in O(1) time. A plain stack gives you O(1) push/pop/top for free; explain what you need to add to also answer 'what is the minimum right now' in O(1) without scanning the stack.

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.