X Interview Questions — 52 DSA Problems
45 problems with full solutions in Python, Java, C++, JavaScript, Go, Rust.
Most frequently asked X LeetCode questions for software engineering interviews.
- Insert Delete GetRandom O(1) (MEDIUM) — Array, Hash Table, Math, Design, Randomized
- Flatten Nested List Iterator (MEDIUM) — Stack, Tree, Depth-First Search, Design, Queue, Iterator
- Trapping Rain Water (HARD) — Array, Two Pointers, Dynamic Programming, Stack, Monotonic Stack
- Design Twitter (MEDIUM) — Hash Table, Linked List, Design, Heap (Priority Queue)
- Tweet Counts Per Frequency (MEDIUM) — Hash Table, Binary Search, Design, Sorting, Ordered Set
- Merge Intervals (MEDIUM) — Array, Sorting
- Implement Trie (Prefix Tree) (MEDIUM) — Hash Table, String, Design, Trie
- Best Meeting Point (HARD) — Array, Math, Sorting, Matrix
- LRU Cache (MEDIUM) — Hash Table, Linked List, Design, Doubly-Linked List
- Investments in 2016 (MEDIUM) — Database
- Customer Placing the Largest Number of Orders (EASY) — Database
- Minimum Genetic Mutation (MEDIUM) — Hash Table, String, Breadth-First Search
- Minimum Number of Steps to Make Two Strings Anagram (MEDIUM) — Hash Table, String, Counting
- Validate IP Address (MEDIUM) — String
- Count Student Number in Departments (MEDIUM) — Database
- Rectangles Area (MEDIUM) — Database
- Invalid Tweets (EASY) — Database
- Tree Node (MEDIUM) — Database
- Number of Black Blocks (MEDIUM) — Array, Hash Table, Enumeration
- Masking Personal Information (MEDIUM) — String
- Design Authentication Manager (MEDIUM) — Hash Table, Linked List, Design, Doubly-Linked List
- Minimum Elements to Add to Form a Given Sum (MEDIUM) — Array, Greedy
- Binary Gap (EASY) — Bit Manipulation
- Finding the Users Active Minutes (MEDIUM) — Array, Hash Table
- Process Tasks Using Servers (MEDIUM) — Array, Heap (Priority Queue)
- Remove All Occurrences of a Substring (MEDIUM) — String, Stack, Simulation
- Count Sub Islands (MEDIUM) — Array, Depth-First Search, Breadth-First Search, Union Find, Matrix
- Trapping Rain Water II (HARD) — Array, Breadth-First Search, Heap (Priority Queue), Matrix
- Regular Expression Matching (HARD) — String, Dynamic Programming, Recursion
- Kth Smallest Element in a Sorted Matrix (MEDIUM) — Array, Binary Search, Sorting, Heap (Priority Queue), Matrix
- Integer to Roman (MEDIUM) — Hash Table, Math, String
- Valid Parentheses (EASY) — String, Stack
- Merge k Sorted Lists (HARD) — Linked List, Divide and Conquer, Heap (Priority Queue), Merge Sort
- Multiply Strings (MEDIUM) — Math, String, Simulation
- Wildcard Matching (HARD) — String, Dynamic Programming, Greedy, Recursion
- Permutation Sequence (HARD) — Math, Recursion
- Pascal's Triangle (EASY) — Array, Dynamic Programming
- Word Break II (HARD) — Array, Hash Table, String, Dynamic Programming, Backtracking, Trie, Memoization
- Time Needed to Buy Tickets (EASY) — Array, Queue, Simulation
- Max Points on a Line (HARD) — Array, Hash Table, Math, Geometry
- One Edit Distance (MEDIUM) — Two Pointers, String
- Happy Number (EASY) — Hash Table, Math, Two Pointers
- Reverse Linked List (EASY) — Linked List, Recursion
- The Skyline Problem (HARD) — Array, Divide and Conquer, Binary Indexed Tree, Segment Tree, Line Sweep, Heap (Priority Queue), Ordered Set
- Lowest Common Ancestor of a Binary Search Tree (MEDIUM) — Tree, Depth-First Search, Binary Search Tree, Binary Tree
- Flatten 2D Vector (MEDIUM) — Array, Two Pointers, Design, Iterator
- Alien Dictionary (HARD) — Array, String, Depth-First Search, Breadth-First Search, Graph, Topological Sort
- Design Skiplist (HARD) — Linked List, Design
- Number of Connected Components in an Undirected Graph (MEDIUM) — Depth-First Search, Breadth-First Search, Union Find, Graph
- Random Pick with Weight (MEDIUM) — Array, Math, Binary Search, Prefix Sum, Randomized
X
X
52 questions tracked45 with solutions
Frequency scoreSorted highest → lowest frequency✓ Our Solution = we have a detailed walkthrough
Showing 52 of 52 questions
1ArrayHash TableMathDesign+1
2StackTreeDepth-First SearchDesign+2
3ArrayTwo PointersDynamic ProgrammingStack+1
4Hash TableLinked ListDesignHeap (Priority Queue)
5Hash TableBinary SearchDesignSorting+1
7Hash TableStringDesignTrie
8HardBest Meeting Point
ArrayMathSortingMatrix
9Hash TableLinked ListDesignDoubly-Linked List
12Hash TableStringBreadth-First Search
13MediumMinimum Number of Steps to Make Two Strings Anagram✓ Our Solution Hash TableStringCounting
15MediumCount Student Number in Departments
Database
16MediumRectangles Area
Database
19ArrayHash TableEnumeration
21Hash TableLinked ListDesignDoubly-Linked List
25ArrayHeap (Priority Queue)
27ArrayDepth-First SearchBreadth-First SearchUnion Find+1
28ArrayBreadth-First SearchHeap (Priority Queue)Matrix
29StringDynamic ProgrammingRecursion
30ArrayBinary SearchSortingHeap (Priority Queue)+1
33Linked ListDivide and ConquerHeap (Priority Queue)Merge Sort
35StringDynamic ProgrammingGreedyRecursion
38ArrayHash TableStringDynamic Programming+3
40ArrayHash TableMathGeometry
41MediumOne Edit Distance
Two PointersString
42Hash TableMathTwo Pointers
44ArrayDivide and ConquerBinary Indexed TreeSegment Tree+3
45TreeDepth-First SearchBinary Search TreeBinary Tree
46MediumFlatten 2D Vector
ArrayTwo PointersDesignIterator
47HardAlien Dictionary
ArrayStringDepth-First SearchBreadth-First Search+2
49MediumNumber of Connected Components in an Undirected Graph
Depth-First SearchBreadth-First SearchUnion FindGraph
50ArrayMathBinary SearchPrefix Sum+1
51ArrayDepth-First SearchBreadth-First SearchUnion Find+1
52ArrayBreadth-First SearchMatrix