Problems by Topic

Updated · techinterview.org

Problems by Topic

Browse our 59 interview problems organized by data structure and algorithm topic. Perfect for focused practice.

Available Topics

Algorithms (19 problems)

These cover the techniques interviewers reach for first: recursion, bit manipulation, string handling, and greedy scans. Be ready to state the time and space complexity of your approach out loud, since that is usually the first follow-up, and notice how many problems map onto one of the common coding patterns.

Arrays (8 problems)

Array questions test how cleanly you handle indices, in-place swaps, and edge cases like empty or single-element input. Many reduce to a two pointers or sliding window pass, so reach for that before nesting loops.

Data Structures (22 problems)

Interviewers use these to check whether you can pick the right structure and reason about its operations across stacks, queues, linked lists, trees, and hash maps. Know the cost of insert, lookup, and delete for each, and be ready to say when a hash map is worth the extra memory for O(1) access.

Dynamic Programming (7 problems)

DP problems reward spotting overlapping subproblems and stating a clear recurrence. Start from the brute-force recursion, add memoization, then walk through the table you fill; the classic warm-ups here are the longest palindromic substring and maximum subarray.

General (16 problems)

This bucket is mostly brainteasers, probability puzzles, and math-flavored questions like the Monty Hall problem. Interviewers care about your reasoning out loud more than a memorized answer, so state your assumptions and sanity-check the result.

Graphs (2 problems)

Graph rounds test traversal with BFS and DFS plus one weighted or connectivity algorithm. Be fluent in topological sort for ordering problems and union-find for connected components, since one of the two shows up in most graph interviews.

Hash Table (1 problems)

Hash-map questions probe collision handling, load factor, and when constant-time lookup is worth the extra memory. The LRU cache is the canonical example, pairing a map with a doubly linked list to get O(1) get and put.

Heap (1 problems)

Heaps come up for top-K and streaming-median problems where you need the largest or smallest element fast. Remember that push and pop are O(log n) while peeking at the root is O(1).

Linked List (1 problems)

Linked-list questions test pointer discipline: reversing a list, detecting a cycle with fast and slow pointers, and splicing nodes without losing the rest. Draw the pointers on paper before you write any code.

Queue (1 problems)

Queues show up in BFS and sliding-window problems, and the deque variant lets you push and pop from both ends in O(1). Sliding-window maximum is the standard test of whether you can keep a monotonic deque correct.

Strings (2 problems)

String problems check careful indexing, in-place edits, and edge cases around whitespace and character encoding. Clarify whether the input is mutable and whether comparisons are case-sensitive before you start coding.

Trie (1 problems)

Tries trade memory for fast prefix lookups, which makes them the structure to reach for in autocomplete and word-search-grid problems. Be ready to compare the space cost against a plain hash set of words.

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

1972 Soviet postage stamp commemorating the Mars 2 probe

worth a read

Mars For The Rest of Us — a weekly-or-more deep dive on the technical side of Mars exploration: rocket propulsion, microbiology, mission architecture, and everything in between. Written by Maciej Ceglowski.

Read it on Substack
Scroll to Top