Count the number of islands after each addLand operation using incremental Union-Find with path compression. Amazon tests this to evaluate dynamic graph connectivity and disjoint set data structures.
Design a class to find the kth largest element in a stream using a min-heap of size k. Amazon tests this to evaluate heap design, streaming data patterns, and online algorithm thinking.
Find the minimum CPU intervals to finish all tasks with a cooldown constraint. Amazon tests this greedy heap problem to evaluate CPU scheduling knowledge and frequency-based optimization.
Find the longest substring containing at most k distinct characters using a sliding window with a frequency map. Google asks this to test sliding window mastery and hashmap-based window shrinking.
Generate all valid combinations of n pairs of parentheses using backtracking with open and close counters. Meta asks this to test recursive thinking, pruning, and combinatorial generation under time pressure.