Curated solutions, patterns, and implementations for technical coding interviews across Data Structures and Algorithms, Systems, and Backend Engineering.
- Two Sum (Easy) - One-pass hash map
- Palindrome Number (Easy) - Base-10 digit reversal
- Roman to Integer (Easy) - Subtractive notation
- Group Anagrams (Medium) - Hash map with sorted string key
- Longest Consecutive Sequence (Medium) - Hash set sequence start check
- Contains Duplicate (Easy) - Set length comparison
- Product of Array Except Self (Medium) - Prefix and postfix products
- Valid Anagram (Easy) - Character count with Counter
- Top K Frequent Elements (Medium) - Frequency count with Counter
- Logger Rate Limiter (Easy) - Hash map tracking next allowed timestamp per message
- Contiguous Array (Medium) - Prefix sum with 0 mapped to -1
- Subarray Sum Equals K (Medium) - Prefix sum frequency hash map
- Maximum Subarray (Medium) - Kadane's algorithm for maximum contiguous sum
- Concatenation of Array (Easy) - List concatenation
- Fizz Buzz (Easy) - Classical modulo simulation
2. Two Pointers
- Container With Most Water (Medium) - Inward two pointers with greedy area check
- 3Sum (Medium) - Sort and two pointers
- Remove Duplicates from Sorted Array (Easy) - Fast and slow pointers
- Trapping Rain Water (Hard) - Two pointers tracking max bounds
- Merge Sorted Array (Easy) - Three pointers from the end
- Valid Palindrome (Easy) - Two pointers inwards
- Two Sum II - Input Array Is Sorted (Medium) - Inward two pointers on sorted array
- Move Zeroes (Easy) - Fast and slow pointers in-place swap
- Move Pieces to Obtain a String (Medium) - Two pointers with L/R relative order and index invariants
- Longest Substring Without Repeating Characters (Medium) - Sliding window with hash set / direct address table
- Longest Repeating Character Replacement (Medium) - Dynamic sliding window tracking max frequency
- Permutation in String (Medium) - Fixed-size sliding window with frequency delta
- Minimum Window Substring (Hard) - Dynamic sliding window with debt counter
- Sliding Window Maximum (Hard) - Monotonic deque tracking window maximums
- Best Time to Buy and Sell Stock (Easy) - One-pass minimum tracking
- Maximum Points You Can Obtain from Cards (Medium) - Prefix/suffix sliding window of size k
- Minimum Difference Between Highest and Lowest of K Scores (Easy) - Sort and contiguous window of size k
4. Stack
- Valid Parentheses (Easy) - Stack matching with expected brackets
- Simplify Path (Medium) - Directory stack canonical path resolution
- Largest Rectangle in Histogram (Hard) - Monotonic increasing index stack with sentinel
- Evaluate Reverse Polish Notation (Medium) - Postfix evaluation with operand stack
- Min Stack (Medium) - Constant-time getMin tracking via pair stack
- Decode String (Medium) - Nested string multiplier stack
- Daily Temperatures (Medium) - Monotonic decreasing stack of indices
- Car Fleet (Medium) - Reverse position sort with arrival time bottleneck tracking
- Number of Visible People in a Queue (Hard) - Right-to-left monotonic decreasing stack
- Median of Two Sorted Arrays (Hard) - Binary search on partition
- Binary Search (Easy) - Classic binary search
- Search in Rotated Sorted Array (Medium) - Pivot-guided binary search checking sorted half
- Find Minimum in Rotated Sorted Array (Medium) - Binary search with right bound comparison
- Koko Eating Bananas (Medium) - Binary search on answer speed range
- Capacity To Ship Packages Within D Days (Medium) - Binary search on capacity partition bound
6. Linked List
- Add Two Numbers (Medium) - Column addition with carry
- Merge Two Sorted Lists (Easy) - Pointer merging with dummy head
- Linked List Cycle (Easy) - Floyd's cycle detection
- Reverse Linked List (Easy) - Iterative pointer reversal
- Reorder List (Medium) - Fast/slow middle finding, in-place reversal, and zipper merge
- Merge k Sorted Lists (Hard) - Sequential merge / divide and conquer / min-heap
7. Trees
- Same Tree (Easy) - Recursive comparison
- Maximum Depth of Binary Tree (Easy) - DFS height
- Balanced Binary Tree (Easy) - Bottom-up height check
- Binary Tree Maximum Path Sum (Hard) - Bottom-up subtree max gain with global path update
- Invert Binary Tree (Easy) - Recursive swap
- Find Leaves of Binary Tree (Medium) - Bottom-up node height grouping
- Diameter of Binary Tree (Easy) - DFS max path
- Subtree of Another Tree (Easy) - Recursive subtree and structure equality check
- Delete Nodes And Return Forest (Medium) - Post-order DFS disconnecting deleted nodes
- Step-By-Step Directions From a Binary Tree Node to Another (Medium) - Root-to-node DFS paths with lowest common prefix stripping
- Find Median from Data Stream (Hard) - Two balanced heaps (max-heap lower half, min-heap upper half)
- K Closest Points to Origin (Medium) - Euclidean distance with min-heap
- Kth Largest Element in a Stream (Easy) - Min-heap of size k
- Last Stone Weight (Easy) - Max-heap with negated values
9. Palindromes
- Longest Palindromic Substring (Medium) - Expand around center
- Palindromic Substrings (Medium) - Expand around center counting all valid palindromes
10. Backtracking
- Subsets (Medium) - Decision tree generating power set
- Letter Combinations of a Phone Number (Medium) - Iterative expansion and recursion
- Combination Sum (Medium) - Decision tree with element reuse and undo
- Word Search (Medium) - 2D grid DFS backtracking with visited set
- Word Search II (Hard) - Trie prefix tree combined with 2D grid backtracking
11. Trie
- Implement Trie (Prefix Tree) (Medium) - Prefix tree with insert, search, and startsWith
- Design Add and Search Words Data Structure (Medium) - Trie with DFS wildcard matching for '.'
12. Graphs
- Number of Islands (Medium) - 2D grid Flood Fill (DFS sinking)
- Clone Graph (Medium) - Deep copy of undirected graph using DFS and hash map
- Evaluate Division (Medium) - Weighted directed graph BFS path product
- Battleships in a Board (Medium) - O(1) space top-left ship head detection
- Rotting Oranges (Medium) - Multi-source 2D grid BFS
- Parallel Courses (Medium) - Kahn's topological sort BFS wave counting
- Shortest Path in a Grid with Obstacles Elimination (Hard) - State-space BFS tracking (row, col, remaining_k)
- Find All Possible Recipes from Given Supplies (Medium) - Topological sort BFS with in-degree dependency graph
13. Intervals
- Merge Intervals (Medium) - Sort intervals by start time and merge overlaps
- Insert Interval (Medium) - Binary insert and linear overlap merge
- Meeting Rooms II (Medium) - Sort by start time with min-heap tracking earliest end time
- My Calendar I (Medium) - Half-open interval overlap detection
- Corporate Flight Bookings (Medium) - Difference array prefix sum sweep
14. Bit Manipulation
- Sort Integers by The Number of 1 Bits (Easy) - Hamming weight sorting via bit_count()
- Climbing Stairs (Easy) - Fibonacci state transition with constant space
- House Robber (Medium) - Recurrence with non-adjacent selection
- House Robber II (Medium) - Circular array subproblem reduction
- Decode Ways (Medium) - Forward bottom-up tabulation with single and double digit transitions
- Coin Change (Medium) - Bottom-up unbounded knapsack with running minimum
- Maximum Product Subarray (Medium) - Kadane's variation tracking min and max bounds for sign flips
- Word Break (Medium) - Bottom-up suffix matching with dictionary validation
- Longest Increasing Subsequence (Medium) - O(n^2) DP checking all subsequent larger candidates
- Longest String Chain (Medium) - Top-down memoized DFS over single-character predecessor deletions
- Unique Paths (Medium) - 2D grid path counting with top and left transition
- Minimum Path Sum (Medium) - 2D grid minimum cost path DP
- Longest Increasing Path in a Matrix (Hard) - Top-down memoized grid DFS over strictly increasing neighbors
- Longest Common Subsequence (Medium) - 2D matrix matching with diagonal and max transitions
17. Greedy
- Jump Game (Medium) - Greedy backward goal shifting
Each file includes test cases and can be run directly:
python3 01_arrays_and_hashing/001_two_sum.pyAll source code, algorithm implementations, and test cases in this repository are authored and curated by Arsenii Zarudniuk (with AI-assisted documentation and test generation) and are licensed under the MIT License.
Problem titles, reference numbers, and brief algorithmic summaries are included strictly for educational indexing and study purposes. No paid editorial materials or proprietary platform content are reproduced in this repository.