1-week interview sprint
Four problems a day, one pattern family at a time — arrays to dynamic programming in seven days.
- Two Sum Find the indices of the two numbers that add up to a target.
- Contains Duplicate Return true if any value appears at least twice.
- Valid Anagram Check whether two strings are anagrams of each other.
- Group Anagrams Group words that are anagrams of each other.
- Valid Palindrome Is the string a palindrome, ignoring case and non-alphanumerics?
- 3Sum All unique triplets that sum to zero.
- Best Time to Buy and Sell Stock Max profit from one buy and one later sell.
- Longest Substring Without Repeating Characters Length of the longest substring with all-distinct characters.
- Valid Parentheses Check that brackets are balanced and properly nested.
- Min Stack A stack that returns its minimum in O(1).
- Binary Search Find a target in a sorted array in O(log n).
- Search in Rotated Sorted Array Binary search in a sorted array that was rotated.
- Reverse Linked List Reverse a singly linked list.
- Merge Two Sorted Lists Merge two sorted linked lists into one sorted list.
- Linked List Cycle Detect whether a linked list has a cycle (Floyd's algorithm).
- Remove Nth Node From End of List Delete the n-th node from the end in one pass.
- Maximum Depth of Binary Tree Number of nodes on the longest root-to-leaf path.
- Invert Binary Tree Mirror a binary tree.
- Binary Tree Level Order Traversal Values of a binary tree, level by level (BFS).
- Validate Binary Search Tree Check the BST property across the whole tree.
- Number of Islands Count connected groups of land cells in a grid.
- Course Schedule Can all courses be finished given prerequisites? (cycle detection)
- Kth Largest Element in an Array The k-th largest value without fully sorting.
- Merge Intervals Merge all overlapping intervals.
- Climbing Stairs Ways to climb n stairs taking 1 or 2 steps at a time.
- House Robber Max sum of non-adjacent elements.
- Coin Change Fewest coins that make up an amount.
- Subsets All subsets (the power set) of distinct integers.