Master swapping the kth node from start and end in a linked list using the two-pointer technique. A clean O(n) interview question asked at Amazon and Bloomberg that tests linked list traversal confidence and pointer discipline.
Count the number of connected components in a linked list defined by a given set of values using a single traversal and O(1) HashSet lookups. A clean O(n) interview problem at Google, Amazon, and Bloomberg that tests your ability to convert a graph concept into a simple linear scan.
LeetCode 547 Number of Provinces is the canonical connected-components question. Learn the DFS, BFS, and Union Find solutions, master the adjacency-matrix walk, and rehearse the FAANG interview script.
LC 83 Remove Duplicates from Sorted List is a foundational linked list interview problem asked at Bloomberg and Microsoft. Learn the single-pass pointer walk solution with Python and JavaScript, a visual dry run, common traps, and how to extend it to the harder variant (LC 82).
LC 24 Swap Nodes in Pairs is a medium linked list interview problem at Microsoft and Bloomberg that tests precise multi-step pointer manipulation. Learn the iterative dummy-head approach and the recursive solution with Python and JavaScript, detailed visual dry run, and interview tips.
LC 86 Partition List is a medium interview problem at Bloomberg and Amazon that extends the dummy-head two-chain pattern to partition by value comparison. Learn the stable O(n) solution with Python and JavaScript, visual dry run, and critical edge cases including the tail-cycle trap.
LC 82 Remove Duplicates from Sorted List II is a medium interview problem at Google, Amazon, and Bloomberg where you remove ALL nodes that appear more than once from a sorted list. Learn the dummy-head predecessor skip pattern with Python and JavaScript, step-by-step dry run, and the critical difference from LC 83.
Crack LeetCode 363 Max Sum of Rectangle No Larger Than K by fixing two row boundaries to collapse 2D into 1D, then using prefix sums plus a sorted set (or BIT/segment tree) to find the best subarray sum bounded above by K.
Design a stack that supports push, pop, top, and getMin in O(1) time using a parallel min-tracking stack. A classic FAANG design interview problem testing stack invariants and auxiliary state maintenance.
Calculate the stock price span using a monotonic decreasing stack that stores (price, span) pairs and accumulates spans in O(1) amortized time. A classic streaming design problem that tests span accumulation and the monotonic stack pattern.
Simulate asteroid collisions where right-moving asteroids accumulate on the stack and left-moving ones destroy smaller ones on collision. A clean application of the collision-simulation stack pattern asked at Amazon and Bloomberg.
Solve LeetCode 456 132 Pattern in O(n) using a monotonic stack scanned from right to left while tracking the best second-largest. A FAANG interview favorite at Bloomberg, Amazon, and Google.
LeetCode 101 — Symmetric Tree, asked at Amazon, Microsoft and Bloomberg. Compare opposite subtrees with a two-pointer recursive helper to check mirror symmetry in O(n) time.
LeetCode 96 Unique Binary Search Trees asks for the count of structurally unique BSTs storing 1..n. Solve it in O(n^2) using Catalan number DP — a favorite Amazon and Google interview question.
LeetCode 977 Squares of a Sorted Array is a classic Google and Bloomberg two pointer question. Squaring negatives flips the sort order, so we merge from the outside in to produce a sorted output in O(n) time without re-sorting.
LeetCode 88 Merge Sorted Array is the classic three pointer in-place merge problem at Microsoft, Bloomberg, and Amazon. Walk both arrays from the end into the trailing empty slots to achieve O(m plus n) time with O(1) extra space.