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.

MediumTechnical
33 practiced

Find the length of the longest substring of a given string that contains no repeated characters. Solve it in O(n) time using a window that expands and contracts over the string, and explain what state you track to know when to shrink the window from the left.

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.

EasyTechnical
32 practiced

Given a sorted array and a target value, find two numbers that add up to the target using O(1) extra space. Explain why sorted order lets you avoid the hashmap you would otherwise need, and how you would adapt the same technique to intersect two sorted arrays.

HardTechnical
39 practiced

You are given jobs, each with a start time, end time, and profit, and can only work one job at a time. Choose a subset of non-overlapping jobs that maximizes total profit. Explain why the simple 'always pick the job that finishes earliest' greedy rule (which works when every job has equal profit) is no longer sufficient once jobs carry different profits.

MediumTechnical
40 practiced

Rotate an array to the right by k steps in-place, using O(1) extra space (k may exceed the array's length). Explain your approach, and how the same in-place three-reversal trick generalizes: reversing a string in place, or rotating a 2D matrix in place.

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.