Two Sum is the most asked interview problem at Google, Amazon and Meta. Learn every approach from O(n²) brute force to O(n) HashMap with C, C++, Java, JavaScript and Python solutions.
Group anagrams, find anagram indices, and count anagram occurrences. Three approaches: sort key O(nk log k), frequency tuple O(nk), and sliding window O(n+k).
Comprehensive coverage of Two Sum, Two Sum II (sorted), 3Sum, and 4Sum. Amazon frequently tests these variants to gauge understanding of hashmap vs two-pointer trade-offs.
Create a deep copy of an undirected graph using DFS with a HashMap to track visited/cloned nodes. Meta tests this to evaluate graph traversal and pointer manipulation.
Implement an LFU cache with O(1) get and put. Uses two hashmaps and per-frequency doubly linked lists to track access frequency and recency simultaneously.
Design a key-value store that returns values at or before a given timestamp. Uses a hashmap of sorted (timestamp, value) lists with binary search for O(log n) get.
Design an in-memory key-value database that supports set, get, delete, and rank operations. Demonstrates combining hashmaps with sorted structures for efficient multi-key queries.
Design a URL shortener like TinyURL that encodes long URLs to short codes and decodes them back. Uses base-62 encoding with a counter or random string generation.