# Problems by Topic

Source: https://www.techinterview.org/problems-by-topic/
Updated: 2026-07-11 · techinterview.org

Problems by Topic

Browse our [59 interview problems](/problem-index/) organized by data structure and algorithm topic. Perfect for focused practice.

## Available Topics

- [Algorithms](#algorithms) (19 problems)
- [Arrays](#arrays) (8 problems)
- [Data Structures](#data-structures) (22 problems)
- [Dynamic Programming](#dynamic-programming) (7 problems)
- [General](#general) (16 problems)
- [Graphs](#graphs) (2 problems)
- [Hash Table](#hash-table) (1 problems)
- [Heap](#heap) (1 problems)
- [Linked List](#linked-list) (1 problems)
- [Queue](#queue) (1 problems)
- [Strings](#strings) (2 problems)
- [Trie](#trie) (1 problems)

## 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](/big-o-cheat-sheet/) 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](/algorithm-patterns-cheat-sheet/).

- [Bit Manipulation: Essential Tricks and Techniques](/post/3233460816/bit-manipulation-interview-patterns/)
- [Bumblebee](https://www.techinterview.org/post/526342692/bumblebee/)
- [Card Trick Without the Trick](https://www.techinterview.org/post/526296398/card-trick-without-the-trick/)
- [Check if a Linked list is a Palindrome or Not](https://www.techinterview.org/post/3233459641/check-if-a-linked-list-is-a-palindrome-or-not/)
- [Coin Rolls](https://www.techinterview.org/post/508833401/coin-rolls/)
- [Cube](https://www.techinterview.org/post/518750698/cube/)
- [Dijkstra's Shortest Path Algorithm](/post/3233463789/shortest-path-algorithm-patterns/)
- [Find Longest Palindrome In A String](https://www.techinterview.org/post/3233459618/find-longest-palindrome-in-a-string/)
- [int atoi( char* pStr )](https://www.techinterview.org/post/526339864/int-atoi-char-pstr/)
- [Kadane's Algorithm: Maximum Subarray Sum](/post/3233466767/array-advanced-patterns/)
- [Palindromes](https://www.techinterview.org/post/526332105/palindromes/)
- [Print String Permutations](https://www.techinterview.org/post/3233459701/print-string-permutations/)
- [Reverse a doubly linked list](https://www.techinterview.org/post/3233459635/reverse-a-doubly-linked-list/)
- [Reverse a String](https://www.techinterview.org/post/526374214/reverse-a-string/)
- [Right Rotate an array by k elements](https://www.techinterview.org/post/3233459583/right-rotate-an-array-by-k-elements/)
- [Sliding Window Maximum](/post/3233466720/priority-queue-patterns/)
- [Sum it Up](https://www.techinterview.org/post/526329049/sum-it-up/)
- [Treasure Island](https://www.techinterview.org/post/521415913/treasure-island/)
- [Word Search in Grid](/post/3233465934/trie-advanced-interview-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](/post/3233474160/coding-interview-two-pointers-sliding-window-patterns-array-string-problems-fast-slow-pointer-variable-window/) pass, so reach for that before nesting loops.

- [Amazon Interview Question: Count Negative Integers in Matrix](https://www.techinterview.org/post/3233459698/amazon-interview-question-count-negative-integers-in-matrix/)
- [Box 'o Numbers](https://www.techinterview.org/post/489558891/box-o-numbers/)
- [Chessboard](https://www.techinterview.org/post/526280776/chessboard/)
- [Missing or Duplicate Number in an Array](https://www.techinterview.org/post/3233459624/missing-or-duplicate-number-in-an-array/)
- [Probability Distribution Function](https://www.techinterview.org/post/3233459639/probability-distribution-function/)
- [Reverse a String](https://www.techinterview.org/post/526374214/reverse-a-string/)
- [Right Rotate an array by k elements](https://www.techinterview.org/post/3233459583/right-rotate-an-array-by-k-elements/)
- [Sum Up a Pair in Array](https://www.techinterview.org/post/3233459633/sum-up-a-pair-in-array/)

## 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.

- [Building a Stack with a getMax() function](https://www.techinterview.org/post/3233459129/building-a-stack-with-a-getmax-function/)
- [Check if a Linked list is a Palindrome or Not](https://www.techinterview.org/post/3233459641/check-if-a-linked-list-is-a-palindrome-or-not/)
- [Classic Weighing](https://www.techinterview.org/post/523914909/classic-weighing/)
- [Find Out if a Linked List has a Cycle](https://www.techinterview.org/post/3233459674/find-out-if-a-linked-list-has-a-cycle/)
- [Find The Depth of a Binary Tree](https://www.techinterview.org/post/3233459627/find-the-depth-of-a-binary-tree/)
- [How many floors can an egg be dropped without breaking?](https://www.techinterview.org/post/3233459133/dropping-an-egg/)
- [Implement a rate limiter](https://www.techinterview.org/post/3233459770/implement-a-rate-limiter/)
- [Implement LRU Cache](/post/3233472889/lld-lru-cache/)
- [Implement Trie (Prefix Tree)](/post/3233466827/trie-patterns/)
- [Linked List](https://www.techinterview.org/post/3233466900/linked-list-patterns/)
- [Missing country code](https://www.techinterview.org/post/3233459746/missing-country-code/)
- [Missing or Duplicate Number in an Array](https://www.techinterview.org/post/3233459624/missing-or-duplicate-number-in-an-array/)
- [Probability Distribution Function](https://www.techinterview.org/post/3233459639/probability-distribution-function/)
- [Red Marbles, Blue Marbles](https://www.techinterview.org/post/526363745/red-marbles-blue-marbles/)
- [Reverse a doubly linked list](https://www.techinterview.org/post/3233459635/reverse-a-doubly-linked-list/)
- [Reverse a String](https://www.techinterview.org/post/526374214/reverse-a-string/)
- [Right Rotate an array by k elements](https://www.techinterview.org/post/3233459583/right-rotate-an-array-by-k-elements/)
- [Serialize and Deserialize a Binary Tree](https://www.techinterview.org/post/3233459646/serialize-and-deserialize-a-binary-tree/)
- [Sum Up a Pair in Array](https://www.techinterview.org/post/3233459633/sum-up-a-pair-in-array/)
- [Treasure Island](https://www.techinterview.org/post/521415913/treasure-island/)
- [Union-Find (Disjoint Set Union)](/post/3233464033/union-find-dsu-interview-patterns/)
- [Write a program for producer-consumer problem](https://www.techinterview.org/post/3233459644/write-a-program-for-producer-consumer-problem/)

## 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.

- [Find Longest Palindrome In A String](https://www.techinterview.org/post/3233459618/find-longest-palindrome-in-a-string/)
- [Fruit Jar Problem](https://www.techinterview.org/post/3233459687/fruit-jar-problem/)
- [How many floors can an egg be dropped without breaking?](https://www.techinterview.org/post/3233459133/dropping-an-egg/)
- [Kadane's Algorithm: Maximum Subarray Sum](/post/3233466767/array-advanced-patterns/)
- [Palindromes](https://www.techinterview.org/post/526332105/palindromes/)
- [Prime number problem](https://www.techinterview.org/post/3233459742/prime-number-problem-2/)
- [Red Marbles, Blue Marbles](https://www.techinterview.org/post/526363745/red-marbles-blue-marbles/)

## 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.

- [100 Factorial](https://www.techinterview.org/post/491337394/100-factorial/)
- [Check If a Number is Power of Two](https://www.techinterview.org/post/3233459629/check-if-a-number-is-power-of-two/)
- [Clock](https://www.techinterview.org/post/521425053/clock/)
- [Compute X^Y For Floats and Negative Values](https://www.techinterview.org/post/3233459637/compute-xy-for-floats-and-negative-values/)
- [Function that Multiples 2 Integers](https://www.techinterview.org/post/3233459676/function-that-multiples-2-integers/)
- [Fuse on Fire](https://www.techinterview.org/post/526289631/fuse-on-fire/)
- [Getting a fair result with an unfair coin](https://www.techinterview.org/post/3233458616/getting-a-fair-result-with-an-unfair-coin/)
- [Gold Chain](https://www.techinterview.org/post/521433747/gold-chain/)
- [Hard River Crossing](https://www.techinterview.org/post/523919913/hard-river-crossing/)
- [Implement a Function to Return a Ratio](https://www.techinterview.org/post/3233459671/implement-a-function-to-return-a-ratio/)
- [Monty Hall Problem](https://www.techinterview.org/post/523909089/monty-hall-problem/)
- [Server to Process  Fair Number of Functions](https://www.techinterview.org/post/3233459683/server-to-process-fair-number-of-functions/)
- [Storing 1 million phone numbers](https://www.techinterview.org/post/1731330243/storing-1-million-phone-numbers/)
- [Topological Sort](/post/3233461698/topological-sort-interview-patterns/)
- [Write a Function for r and 5()](https://www.techinterview.org/post/3233459678/write-a-function-for-r-and-5/)
- [XOR using NAND gates](https://www.techinterview.org/post/489166573/xor-using-nand-gates/)

## Graphs (2 problems)
Graph rounds test traversal with BFS and DFS plus one weighted or connectivity algorithm. Be fluent in [topological sort](/post/3233461698/topological-sort-interview-patterns/) for ordering problems and [union-find](/post/3233474181/coding-interview-union-find-disjoint-set-deep-dive-path-compression-union-by-rank-connected-components-kruskal-accounts-merge/) for connected components, since one of the two shows up in most graph interviews.

- [Dijkstra's Shortest Path Algorithm](/post/3233463789/shortest-path-algorithm-patterns/)
- [Union-Find (Disjoint Set Union)](/post/3233464033/union-find-dsu-interview-patterns/)

## 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.

- [Implement LRU Cache](/post/3233472889/lld-lru-cache/)

## 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).

- [Dijkstra's Shortest Path Algorithm](/post/3233463789/shortest-path-algorithm-patterns/)

## 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.

- [Implement LRU Cache](/post/3233472889/lld-lru-cache/)

## 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.

- [Sliding Window Maximum](/post/3233466720/priority-queue-patterns/)

## 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.

- [Boolean String Value](https://www.techinterview.org/post/3233459765/boolean-string-value/)
- [Removing a Character from a String](https://www.techinterview.org/post/3233459622/removing-a-character-from-a-string/)

## 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.

- [Implement Trie (Prefix Tree)](/post/3233466827/trie-patterns/)
