{"behavioral_hash":"eb64caac51cf0f70","bughunt_hash":"3daf3f68cbc5af39","bughunts":[{"id":"arrays-new-low-reset","pattern":"arrays","problem":"best-time-to-buy-and-sell-stock","title":"A new low wipes the profit"},{"id":"arrays-merge-inside","pattern":"arrays","problem":"merge-intervals","title":"An interval swallowed whole"},{"id":"strings-prefix-past-the-end","pattern":"strings","problem":"longest-common-prefix","title":"Off the end of the shorter word"},{"id":"strings-split-on-space","pattern":"strings","problem":"reverse-words-in-a-string","title":"split(' ') keeps the empty words"},{"id":"hashmaps-prefix-zero","pattern":"hash-maps","problem":"subarray-sum-equals-k","title":"The subarray that starts at index 0"},{"id":"hashmaps-oldest-index","pattern":"hash-maps","problem":"contains-duplicate-ii","title":"Remembering the wrong copy"},{"id":"twopointers-move-taller","pattern":"two-pointers","problem":"container-with-most-water","title":"Moving the taller wall"},{"id":"twopointers-unguarded-skip","pattern":"two-pointers","problem":"valid-palindrome","title":"Skipping off the end"},{"id":"window-if-not-while","pattern":"sliding-window","problem":"minimum-size-subarray-sum","title":"Shrinking only once"},{"id":"window-one-too-many","pattern":"sliding-window","problem":"permutation-in-string","title":"The window that grew one too many"},{"id":"fastslow-first-middle","pattern":"fast-slow-pointers","problem":"middle-of-the-linked-list","title":"The other middle"},{"id":"fastslow-race-never-starts","pattern":"fast-slow-pointers","problem":"happy-number","title":"The race that never starts"},{"id":"lists-lost-next","pattern":"linked-lists","problem":"reverse-linked-list","title":"The pointer you overwrote"},{"id":"lists-remove-the-head","pattern":"linked-lists","problem":"remove-nth-node-from-end-of-list","title":"When the node to remove is the head"},{"id":"stacks-unclosed","pattern":"stacks","problem":"valid-parentheses","title":"Brackets left open"},{"id":"stacks-equal-is-not-warmer","pattern":"stacks","problem":"daily-temperatures","title":"An equal day is not a warmer day"},{"id":"bsearch-insert-at-end","pattern":"binary-search","problem":"search-insert-position","title":"Nowhere to insert at the end"},{"id":"bsearch-rotated-wrong-end","pattern":"binary-search","problem":"find-minimum-in-rotated-sorted-array","title":"Comparing with the wrong end"},{"id":"trees-bst-only-children","pattern":"trees","problem":"validate-binary-search-tree","title":"Checking only the children"},{"id":"trees-diameter-through-root","pattern":"trees","problem":"diameter-of-binary-tree","title":"The longest path skips the root"},{"id":"tries-prefix-is-not-word","pattern":"tries","problem":"implement-trie-prefix-tree","title":"Every prefix is a word?"},{"id":"tries-marker-as-letter","pattern":"tries","problem":"design-add-and-search-words-data-structure","title":"The end marker is not a letter"},{"id":"heaps-keeps-the-farthest","pattern":"heaps","problem":"k-closest-points-to-origin","title":"A min-heap that keeps the farthest"},{"id":"heaps-remainder-sign","pattern":"heaps","problem":"last-stone-weight","title":"The remainder goes in with the wrong sign"},{"id":"backtrack-shared-path","pattern":"backtracking","problem":"subsets","title":"Every answer is the same list"},{"id":"backtrack-no-reuse","pattern":"backtracking","problem":"combination-sum","title":"Each number used only once"},{"id":"graphs-diagonal-neighbours","pattern":"graphs","problem":"number-of-islands","title":"Islands that touch at a corner"},{"id":"graphs-seen-is-not-on-path","pattern":"graphs","problem":"course-schedule","title":"Seen before is not a cycle"},{"id":"dp-robber-never-skips","pattern":"dp-1d","problem":"house-robber","title":"A robber who never skips twice"},{"id":"dp-greedy-coins","pattern":"dp-1d","problem":"coin-change","title":"Greedy is not always optimal"},{"id":"dp2-paths-zero-row","pattern":"dp-2d","problem":"unique-paths","title":"A first row with no paths"},{"id":"dp2-lcs-diagonal-only","pattern":"dp-2d","problem":"longest-common-subsequence","title":"On a mismatch, look in two directions"},{"id":"intervals-room-free-at-end","pattern":"intervals","problem":"meeting-rooms-ii","title":"The room is free when the meeting ends"},{"id":"intervals-keep-first-start","pattern":"intervals","problem":"non-overlapping-intervals","title":"Keeping the interval that starts first"},{"id":"bits-precedence","pattern":"bit-manipulation","problem":"counting-bits","title":"+ binds tighter than \u0026"},{"id":"bits-missing-n","pattern":"bit-manipulation","problem":"missing-number","title":"The number nobody's index covers"},{"id":"greedy-reach-before-check","pattern":"greedy","problem":"jump-game","title":"Growing the frontier from an index you can't stand on"},{"id":"greedy-gas-restart-here","pattern":"greedy","problem":"gas-station","title":"Restarting at the station that ran dry"},{"id":"matrix-transpose-twice","pattern":"matrix-math","problem":"rotate-image","title":"A transpose that swaps every pair twice"},{"id":"matrix-zeroes-clear-early","pattern":"matrix-math","problem":"set-matrix-zeroes","title":"Clearing the marker row before it's read"},{"id":"design-lru-get-no-refresh","pattern":"ds-design","problem":"lru-cache","title":"A get that doesn't count as a use"},{"id":"design-random-remove-last","pattern":"ds-design","problem":"insert-delete-getrandom-o1","title":"Removing the last element writes it back"},{"id":"advanced-graphs-itinerary-on-arrival","pattern":"advanced-graphs","problem":"reconstruct-itinerary","title":"Writing airports down on arrival"},{"id":"advanced-graphs-effort-sum","pattern":"advanced-graphs","problem":"path-with-minimum-effort","title":"Adding up the steps instead of taking the largest"}],"decks":[{"blurb":"See the problem, recall the move. One card per problem, scheduled like every other deck.","cards":["hooks.remove-element","hooks.remove-duplicates-from-sorted-array","hooks.plus-one","hooks.two-sum","hooks.best-time-to-buy-and-sell-stock","hooks.contains-duplicate","hooks.merge-sorted-array","hooks.next-permutation","hooks.pascals-triangle","hooks.intersection-of-two-arrays-ii","hooks.valid-mountain-array","hooks.maximum-subarray","hooks.product-of-array-except-self","hooks.insert-interval","hooks.merge-intervals","hooks.reverse-string","hooks.valid-anagram","hooks.longest-common-prefix","hooks.encode-and-decode-strings","hooks.first-unique-character-in-a-string","hooks.ransom-note","hooks.custom-sort-string","hooks.find-the-index-of-the-first-occurrence-in-a-string","hooks.repeated-substring-pattern","hooks.reverse-words-in-a-string","hooks.string-to-integer-atoi","hooks.integer-to-english-words","hooks.intersection-of-two-arrays","hooks.contains-duplicate-ii","hooks.dot-product-of-two-sparse-vectors","hooks.isomorphic-strings","hooks.word-pattern","hooks.group-anagrams","hooks.top-k-frequent-elements","hooks.valid-sudoku","hooks.longest-consecutive-sequence","hooks.subarray-sum-equals-k","hooks.contiguous-array","hooks.4sum-ii","hooks.brick-wall","hooks.valid-palindrome","hooks.valid-palindrome-ii","hooks.reverse-vowels-of-a-string","hooks.move-zeroes","hooks.squares-of-a-sorted-array","hooks.two-sum-ii-input-array-is-sorted","hooks.container-with-most-water","hooks.3sum","hooks.4sum","hooks.sort-colors","hooks.trapping-rain-water","hooks.maximum-average-subarray-i","hooks.permutation-in-string","hooks.find-all-anagrams-in-a-string","hooks.max-consecutive-ones-iii","hooks.longest-substring-without-repeating-characters","hooks.longest-repeating-character-replacement","hooks.fruit-into-baskets","hooks.longest-substring-with-at-most-k-distinct-characters","hooks.grumpy-bookstore-owner","hooks.maximum-points-you-can-obtain-from-cards","hooks.longest-turbulent-subarray","hooks.minimum-size-subarray-sum","hooks.sliding-window-maximum","hooks.minimum-window-substring","hooks.substring-with-concatenation-of-all-words","hooks.linked-list-cycle","hooks.middle-of-the-linked-list","hooks.palindrome-linked-list","hooks.happy-number","hooks.linked-list-cycle-ii","hooks.find-the-duplicate-number","hooks.circular-array-loop","hooks.reverse-linked-list","hooks.merge-two-sorted-lists","hooks.remove-linked-list-elements","hooks.remove-duplicates-from-sorted-list","hooks.intersection-of-two-linked-lists","hooks.delete-the-middle-node-of-a-linked-list","hooks.remove-nth-node-from-end-of-list","hooks.swap-nodes-in-pairs","hooks.add-two-numbers","hooks.remove-duplicates-from-sorted-list-ii","hooks.partition-list","hooks.odd-even-linked-list","hooks.reverse-linked-list-ii","hooks.rotate-list","hooks.split-linked-list-in-parts","hooks.reorder-list","hooks.copy-list-with-random-pointer","hooks.sort-list","hooks.flatten-a-multilevel-doubly-linked-list","hooks.reverse-nodes-in-k-group","hooks.merge-k-sorted-lists","hooks.valid-parentheses","hooks.baseball-game","hooks.backspace-string-compare","hooks.remove-all-adjacent-duplicates-in-string","hooks.next-greater-element-i","hooks.min-stack","hooks.evaluate-reverse-polish-notation","hooks.basic-calculator-ii","hooks.simplify-path","hooks.daily-temperatures","hooks.car-fleet","hooks.next-greater-element-ii","hooks.asteroid-collision","hooks.decode-string","hooks.minimum-remove-to-make-valid-parentheses","hooks.online-stock-span","hooks.buildings-with-an-ocean-view","hooks.sum-of-subarray-minimums","hooks.largest-rectangle-in-histogram","hooks.maximal-rectangle","hooks.binary-search","hooks.first-bad-version","hooks.search-insert-position","hooks.valid-perfect-square","hooks.sqrtx","hooks.find-smallest-letter-greater-than-target","hooks.search-a-2d-matrix","hooks.find-first-and-last-position-of-element-in-sorted-array","hooks.search-in-rotated-sorted-array","hooks.find-minimum-in-rotated-sorted-array","hooks.search-in-rotated-sorted-array-ii","hooks.find-peak-element","hooks.time-based-key-value-store","hooks.koko-eating-bananas","hooks.capacity-to-ship-packages-within-d-days","hooks.successful-pairs-of-spells-and-potions","hooks.find-k-closest-elements","hooks.random-pick-with-weight","hooks.median-of-two-sorted-arrays","hooks.split-array-largest-sum","hooks.minimize-max-distance-to-gas-station","hooks.maximum-depth-of-binary-tree","hooks.minimum-depth-of-binary-tree","hooks.invert-binary-tree","hooks.same-tree","hooks.symmetric-tree","hooks.path-sum","hooks.diameter-of-binary-tree","hooks.balanced-binary-tree","hooks.subtree-of-another-tree","hooks.range-sum-of-bst","hooks.binary-tree-level-order-traversal","hooks.binary-tree-right-side-view","hooks.binary-tree-zigzag-level-order-traversal","hooks.binary-tree-vertical-order-traversal","hooks.count-good-nodes-in-binary-tree","hooks.sum-root-to-leaf-numbers","hooks.all-nodes-distance-k-in-binary-tree","hooks.kth-smallest-element-in-a-bst","hooks.validate-binary-search-tree","hooks.lowest-common-ancestor-of-a-binary-search-tree","hooks.lowest-common-ancestor-of-a-binary-tree","hooks.lowest-common-ancestor-of-a-binary-tree-iii","hooks.construct-binary-tree-from-preorder-and-inorder-traversal","hooks.binary-tree-maximum-path-sum","hooks.serialize-and-deserialize-binary-tree","hooks.implement-trie-prefix-tree","hooks.design-add-and-search-words-data-structure","hooks.search-suggestions-system","hooks.word-search-ii","hooks.last-stone-weight","hooks.kth-largest-element-in-a-stream","hooks.k-closest-points-to-origin","hooks.kth-largest-element-in-an-array","hooks.top-k-frequent-words","hooks.task-scheduler","hooks.reorganize-string","hooks.design-twitter","hooks.find-median-from-data-stream","hooks.subsets","hooks.combination-sum","hooks.permutations","hooks.subsets-ii","hooks.combination-sum-ii","hooks.word-search","hooks.palindrome-partitioning","hooks.letter-combinations-of-a-phone-number","hooks.generate-parentheses","hooks.n-queens","hooks.number-of-islands","hooks.max-area-of-island","hooks.surrounded-regions","hooks.rotting-oranges","hooks.walls-and-gates","hooks.pacific-atlantic-water-flow","hooks.detonate-the-maximum-bombs","hooks.clone-graph","hooks.course-schedule","hooks.course-schedule-ii","hooks.graph-valid-tree","hooks.number-of-connected-components-in-an-undirected-graph","hooks.number-of-provinces","hooks.redundant-connection","hooks.accounts-merge","hooks.network-delay-time","hooks.cheapest-flights-within-k-stops","hooks.shortest-path-in-binary-matrix","hooks.minimum-knight-moves","hooks.word-ladder","hooks.alien-dictionary","hooks.climbing-stairs","hooks.min-cost-climbing-stairs","hooks.house-robber","hooks.house-robber-ii","hooks.decode-ways","hooks.coin-change","hooks.combination-sum-iv","hooks.word-break","hooks.longest-increasing-subsequence","hooks.partition-equal-subset-sum","hooks.longest-palindromic-substring","hooks.palindromic-substrings","hooks.maximum-product-subarray","hooks.unique-paths","hooks.unique-paths-ii","hooks.longest-common-subsequence","hooks.edit-distance","hooks.best-time-to-buy-and-sell-stock-with-cooldown","hooks.coin-change-ii","hooks.target-sum","hooks.interleaving-string","hooks.longest-increasing-path-in-a-matrix","hooks.distinct-subsequences","hooks.burst-balloons","hooks.regular-expression-matching","hooks.meeting-rooms","hooks.interval-list-intersections","hooks.non-overlapping-intervals","hooks.meeting-rooms-ii","hooks.minimum-interval-to-include-each-query","hooks.single-number","hooks.number-of-1-bits","hooks.counting-bits","hooks.missing-number","hooks.reverse-bits","hooks.sum-of-two-integers","hooks.reverse-integer","hooks.maximum-units-on-a-truck","hooks.jump-game","hooks.jump-game-ii","hooks.gas-station","hooks.partition-labels","hooks.minimum-number-of-arrows-to-burst-balloons","hooks.hand-of-straights","hooks.merge-triplets-to-form-target-triplet","hooks.valid-parenthesis-string","hooks.rotate-image","hooks.spiral-matrix","hooks.set-matrix-zeroes","hooks.game-of-life","hooks.powx-n","hooks.multiply-strings","hooks.detect-squares","hooks.robot-bounded-in-circle","hooks.moving-average-from-data-stream","hooks.logger-rate-limiter","hooks.lru-cache","hooks.insert-delete-getrandom-o1","hooks.snapshot-array","hooks.design-hit-counter","hooks.stock-price-fluctuation","hooks.lfu-cache","hooks.path-with-minimum-effort","hooks.swim-in-rising-water","hooks.min-cost-to-connect-all-points","hooks.evaluate-division","hooks.bus-routes","hooks.reconstruct-itinerary","hooks.critical-connections-in-a-network"],"hash":"2a029e64a71a959a","id":"hooks","name":"Memory hooks"},{"blurb":"Each principle or signal a company grades: say what it means and which of your stories shows it.","cards":["behavioral.customer-obsession","behavioral.ownership","behavioral.invent-and-simplify","behavioral.are-right-a-lot","behavioral.learn-and-be-curious","behavioral.hire-and-develop-the-best","behavioral.insist-on-the-highest-standards","behavioral.think-big","behavioral.bias-for-action","behavioral.frugality","behavioral.earn-trust","behavioral.dive-deep","behavioral.have-backbone-disagree-and-commit","behavioral.deliver-results","behavioral.strive-to-be-earths-best-employer","behavioral.success-and-scale-bring-broad-responsibility","behavioral.thriving-in-ambiguity","behavioral.valuing-feedback","behavioral.challenging-the-status-quo","behavioral.putting-users-first","behavioral.doing-the-right-thing","behavioral.caring-about-the-team","behavioral.resolving-conflicts","behavioral.driving-results","behavioral.embracing-ambiguity","behavioral.growing-continuously","behavioral.communicating-effectively"],"hash":"e2da0370166ecef9","id":"behavioral","name":"Behavioral principles"}],"designs":[{"hash":"81370434dc2729ba","id":"url-shortener","kind":"hld","reported_at":["Amazon","Google","Microsoft"],"rubric_size":8,"summary":"Short codes for long links, at read-heavy scale: code generation without collisions, a cache in front of a partitioned store, and redirects in a few milliseconds.","title":"Design a URL shortener"},{"hash":"de1d4b72daf5503f","id":"rate-limiter","kind":"hld","reported_at":["Meta","Amazon","Netflix","Stripe"],"rubric_size":7,"summary":"Per-user and per-key limits enforced across many API servers: the token bucket, an atomic shared counter, where the limiter sits, and what happens when its store is down.","title":"Design a distributed rate limiter"},{"hash":"5ceea96545cc58c5","id":"distributed-cache","kind":"hld","reported_at":["Meta","Amazon","Google"],"rubric_size":6,"summary":"A Redis-like cache across many nodes: partitioning with consistent hashing, replication and failover, eviction, and the hot-key and rebalancing problems.","title":"Design a distributed key-value cache"},{"hash":"9da9d8c4dc5d168f","id":"leaderboard","kind":"hld","reported_at":["Amazon","Meta","Google"],"rubric_size":6,"summary":"Top-N and \u0026#39;my rank\u0026#39; for tens of millions of players in real time: Redis sorted sets, sharding a single ranking, approximate ranks at the tail, and periodic seasons.","title":"Design a real-time game leaderboard"},{"hash":"f566d7e67286e334","id":"notification-system","kind":"hld","reported_at":["Amazon","Meta","Uber"],"rubric_size":7,"summary":"Push, email and SMS from many producer services: one API, user preferences and rate limits, per-channel queues and workers, retries without double-sending.","title":"Design a notification system"},{"hash":"130c31915246ca0e","id":"news-feed","kind":"hld","reported_at":["Meta","Google","Amazon"],"rubric_size":8,"summary":"Posts from the people you follow, newest first, in under 200 ms: fan-out on write versus read, the celebrity problem, feed storage and pagination.","title":"Design a news feed"},{"hash":"ee2522f3252f44de","id":"chat","kind":"hld","reported_at":["Meta","Amazon","Microsoft"],"rubric_size":7,"summary":"One-to-one and group messages delivered in real time: WebSocket gateways, routing a message to the right connection, ordering per conversation, offline delivery and read receipts.","title":"Design a chat service"},{"hash":"6e04dd6eeae4c28d","id":"file-storage","kind":"hld","reported_at":["Google","Microsoft","Amazon"],"rubric_size":7,"summary":"Dropbox-style upload, download and sync across devices: chunking and content hashes, metadata versus blob storage, sync notifications and conflict handling.","title":"Design file storage and sync"},{"hash":"9f3d529666e8e308","id":"web-crawler","kind":"hld","reported_at":["Google","Microsoft","Meta"],"rubric_size":7,"summary":"Fetching a billion pages politely: the URL frontier with per-host queues, deduplication of URLs and content, robots.txt, and recovering from crashes.","title":"Design a web crawler"},{"hash":"3f20bdf7289b0bd2","id":"ticket-booking","kind":"hld","reported_at":["Amazon","Meta","Uber"],"rubric_size":7,"summary":"Selling seats for concerts and games without double-booking: seat holds with expiry, a virtual waiting room for on-sale spikes, and payment as a separate step.","title":"Design a ticket booking system"},{"hash":"e9eec7431bba24fc","id":"ride-hailing","kind":"hld","reported_at":["Uber","Amazon","Google"],"rubric_size":7,"summary":"Matching riders with nearby drivers in seconds: location updates at scale, geospatial indexing with geohash cells, the matching flow and the trip state machine.","title":"Design a ride-hailing service"},{"hash":"2063dd18fb8cba7f","id":"ad-click-aggregator","kind":"hld","reported_at":["Meta","Google","Amazon"],"rubric_size":8,"summary":"Counting billions of ad clicks per day for advertiser dashboards: an event log, stream aggregation in time windows, exactly-once counting, late events and a batch reconciliation path.","title":"Design an ad click aggregator"},{"hash":"31535333115cd05a","id":"parking-lot","kind":"lld","reported_at":["Amazon","Microsoft","Google"],"rubric_size":8,"summary":"The classic object-oriented round: spot sizes and vehicles, nearest-fitting spot assignment with a heap per size, tickets, and pricing as a swappable strategy.","title":"Design a parking lot"},{"hash":"6c5b9784f1401042","id":"amazon-locker","kind":"lld","reported_at":["Amazon"],"rubric_size":8,"summary":"Amazon\u0026#39;s favourite object-oriented prompt: assigning packages to the smallest fitting locker, one-time pickup codes, expiry and returns.","title":"Design a package locker station"},{"hash":"a7078c50d5b18eac","id":"splitwise","kind":"lld","reported_at":["Amazon","Microsoft","Uber"],"rubric_size":8,"summary":"Splitwise in code: expenses with equal, exact and percent splits as strategies, integer cents, net balances, and settling up with at most n − 1 payments.","title":"Design an expense-sharing app"},{"hash":"6cb43c92b59e25f7","id":"file-search","kind":"lld","reported_at":["Amazon"],"rubric_size":8,"summary":"Amazon\u0026#39;s \u0026#39;implement find\u0026#39; prompt: a file tree, filters by size, extension and name that combine with and, or and not, and an iterative walk that survives deep trees.","title":"Design a file search (find) library"}],"generated_at":"2026-10-27T08:46:26.84396Z","lessons":[{"group":"study","hash":"21381a5fb263fd59","id":"how-to-study","minutes":9,"summary":"Three rules, the cue → pattern table you\u0026#39;re building, why the route runs in this order, and a daily routine that turns solved problems into reflexes.","title":"How to study with Invariant"},{"group":"foundations","hash":"e28c8724c69f8caa","id":"big-o","minutes":12,"summary":"How fast the work grows, how to count it from code, how to read the intended complexity off the constraints, and the space, amortized and worst-case details interviewers listen for.","title":"Big-O for humans"},{"group":"foundations","hash":"9af1d9971b4763f0","id":"python-cost-model","minutes":14,"summary":"What each list, dict, set, deque and heap operation really costs, the two quadratic traps interviewers catch weekly, and the standard-library pieces worth having in muscle memory.","title":"Python's cost model and the interview toolbox"},{"group":"foundations","hash":"3713f2ee45611882","id":"recursion","minutes":13,"summary":"Base case plus a smaller call, the leap of faith, what the call stack costs, how to read complexity off the recursion tree, and when to turn it into a loop.","title":"Recursion without getting lost"},{"group":"foundations","hash":"e1b7933f4a8f8e5d","id":"sorting","minutes":13,"summary":"Which properties of a sort matter, merge sort and quicksort as knowledge checks, quickselect, beating n log n with counting, and custom keys and comparators in Python.","title":"Sorting, and when it buys you an algorithm"},{"group":"foundations","hash":"9d7f925932af2109","id":"math","minutes":12,"summary":"GCD, primes and the sieve, fast exponentiation, modular arithmetic, combinatorics, digit loops and random sampling — each with the one-line reason it works.","title":"Math and number theory you actually need"},{"group":"foundations","hash":"eff6b6e50cd920e0","id":"string-algorithms","minutes":12,"summary":"KMP\u0026#39;s failure table, Rabin–Karp rolling hashes, the three ways to find palindromes, and the Python string idioms that keep string code linear.","title":"String algorithms worth knowing"},{"group":"foundations","hash":"2766f904d1ff9749","id":"advanced-structures","minutes":10,"summary":"Fenwick trees and segment trees for prefix sums with updates, what LFU, skip lists, B-trees and Bloom filters are for, and how to tell when one of them is the intended answer.","title":"Advanced structures (recognize, rarely implement)"},{"group":"interview","hash":"5640228bdb6162bd","id":"recognize-the-pattern","minutes":8,"summary":"The cue → pattern table to review before every interview, the four-question triage for a problem you haven\u0026#39;t seen, and the look-alikes that trip people up.","title":"Recognize the pattern in three seconds"},{"group":"interview","hash":"2e2992c973991e74","id":"interviews-in-2026","minutes":11,"summary":"What a mid-level loop looks like at Google, Meta, Amazon, Microsoft and the online-assessment companies, what changed since 2024, and what that means for how you practice.","title":"How coding interviews work in 2026"},{"group":"interview","hash":"3235f69dc3de766e","id":"in-the-room","minutes":10,"summary":"The sequence that earns points in a 45-minute coding round, what to do when you\u0026#39;re stuck, and how to verify code by hand when there\u0026#39;s no Run button.","title":"In the room: eight moves and a dry run"},{"group":"interview","hash":"b744d0be849330ee","id":"online-assessments","minutes":10,"summary":"The formats you\u0026#39;ll meet, how hidden tests and efficiency gates decide them, a time plan for two problems in 90 minutes, and how progressive CodeSignal projects work.","title":"Online assessments: HackerRank and CodeSignal"},{"group":"interview","hash":"ebfca73edb50362c","id":"ai-assisted-rounds","minutes":9,"summary":"How Meta\u0026#39;s AI-enabled round and Google\u0026#39;s code-comprehension pilot are reported to work, the four things interviewers grade, the failure mode that sinks most candidates, and a weekly practice routine.","title":"AI-assisted rounds: what's graded and how to prepare"},{"group":"interview","hash":"79fbbab3d9d3e370","id":"rest-api-tasks","minutes":9,"summary":"The football API the HackerRank REST tasks call, its exact contract, one pagination helper you can write in three minutes, and the three moves that solve every task: sweep, filter in the query, read the total.","title":"REST API tasks: paginate, filter, count"},{"group":"design","hash":"ef3a0388057d4e5b","id":"the-design-round","minutes":9,"summary":"What mid-level design rounds look like at Meta, Amazon and Microsoft, the six steps that structure your 45 minutes, and what interviewers grade at each step.","title":"The system design round: a 45-minute plan"},{"group":"design","hash":"a0cb3b492b5a5440","id":"estimation","minutes":9,"summary":"The handful of numbers worth memorizing, how to turn daily users into requests per second and storage, and a worked example — only the estimates that change a decision.","title":"Back-of-the-envelope estimation"},{"group":"design","hash":"ba05fd54844486f8","id":"scaling-basics","minutes":9,"summary":"How one server becomes many: stateless application servers behind a load balancer, where state goes instead, and the CDN and blob storage that keep big files off your servers.","title":"Scaling basics: load balancers, stateless services, CDNs"},{"group":"design","hash":"82f14c986650200e","id":"caching","minutes":10,"summary":"Cache-aside, write-through and write-back, eviction and TTLs, how stale data creeps in, and the stampede and hot-key problems interviewers ask about.","title":"Caching without lying to users"},{"group":"design","hash":"d2c4c9df2898183f","id":"databases","minutes":12,"summary":"SQL or NoSQL for a given access pattern, what an index costs, leader–follower replication and its lag, how to pick a shard key, and consistent hashing.","title":"Databases: choosing, indexing, replicating, sharding"},{"group":"design","hash":"f71919c981c73da0","id":"consistency","minutes":10,"summary":"CAP in one honest paragraph, the consistency levels you can promise, why every write API should be idempotent, and the outbox and saga patterns for work that spans services.","title":"Consistency, idempotency and distributed transactions"},{"group":"design","hash":"c1558564ae6d5d7d","id":"messaging","minutes":10,"summary":"When to move work out of the request, queues versus logs like Kafka, partitions and ordering, retries and dead-letter queues, and fan-out on write versus on read.","title":"Queues, streams and fan-out"},{"group":"design","hash":"3a001e9e9bbc2381","id":"reliability","minutes":10,"summary":"SLOs and error budgets, the token bucket and its cousins, timeouts, retries and circuit breakers, and what to monitor so you hear about a failure before your users do.","title":"Reliability: rate limits, failures and observability"}],"method":[{"body":"Don't jump to code. Restate it in one sentence.","key":"read","title":"Read the problem"},{"body":"Types, sizes, return value. Draw one or two examples by hand.","key":"io","title":"Inputs \u0026 outputs"},{"body":"Ask about constraints and edge cases: empty, duplicates, negatives, max size, ASCII vs Unicode, case.","key":"clarify","title":"Clarify"},{"body":"Split into sub-problems, solve a simpler version, list several ideas, go from high level to low level.","key":"think","title":"Think"},{"body":"State the brute force and its cost. Check it against n: 10⁵ needs O(n log n) or better.","key":"complexity","title":"Complexity"},{"body":"What work is repeated? Can sorting, a hash map, or two pointers remove it?","key":"better","title":"Look for better"},{"body":"Write the plan as short pseudo-code first.","key":"paper_code","title":"Code on paper"},{"body":"Trace a new example and the corner cases before running anything.","key":"paper_debug","title":"Debug on paper"},{"body":"Clear names, guard clauses, no dead code.","key":"clean_code","title":"Clean code"},{"body":"Positive, negative, and edge cases. Say why each one matters.","key":"tests","title":"Test"}],"patterns":[{"blurb":"Indexing, in-place writes, running state, prefix/suffix, sorting and merging.","cards":["arrays.in-place-move","arrays.two-sum-order","arrays.kadane-recurrence","arrays.kadane-negative","arrays.merge-from-back","arrays.product-except-self","arrays.merge-intervals-steps","arrays.insert-interval-phases","arrays.stock-state","arrays.plus-one-edge","arrays.pascal-rule","arrays.mountain-check","arrays.intersection-sorted","arrays.duplicate-tradeoff","arrays.dedupe-rule","arrays.complexity-budget","arrays.backpack"],"counts":{"easy":10,"hard":0,"medium":5,"total":15},"hash":"c5dce9b008e32b86","id":"arrays","name":"Arrays","num":1,"problems":["remove-element","remove-duplicates-from-sorted-array","plus-one","two-sum","best-time-to-buy-and-sell-stock","contains-duplicate","merge-sorted-array","next-permutation","pascals-triangle","intersection-of-two-arrays-ii","valid-mountain-array","maximum-subarray","product-of-array-except-self","insert-interval","merge-intervals"],"ready":true},{"blurb":"Manipulation, parsing, and ASCII/frequency arrays.","cards":["strings.one-question","strings.immutable","strings.count-26","strings.anagram-proof","strings.first-unique","strings.ransom","strings.lcp-vertical","strings.find-naive","strings.kmp-fail","strings.doubling","strings.period","strings.split","strings.reverse-words-inplace","strings.atoi-phases","strings.atoi-overflow","strings.reverse-string"],"counts":{"easy":7,"hard":1,"medium":4,"total":12},"hash":"e779e7346770b535","id":"strings","name":"Strings","num":2,"problems":["reverse-string","valid-anagram","longest-common-prefix","encode-and-decode-strings","first-unique-character-in-a-string","ransom-note","custom-sort-string","find-the-index-of-the-first-occurrence-in-a-string","repeated-substring-pattern","reverse-words-in-a-string","string-to-integer-atoi","integer-to-english-words"],"ready":true},{"blurb":"O(1) lookups, frequency counting, index tracking, prefix-sum maps.","cards":["hash-maps.one-question","hash-maps.cost","hash-maps.hashable","hash-maps.contains-dup-ii","hash-maps.bijection","hash-maps.word-pattern-length","hash-maps.anagram-key","hash-maps.top-k-bucket","hash-maps.sudoku","hash-maps.consecutive","hash-maps.prefix-sum","hash-maps.contiguous","hash-maps.four-sum-ii","hash-maps.brick-wall","hash-maps.window-vs-prefix","hash-maps.lookup-first"],"counts":{"easy":4,"hard":0,"medium":9,"total":13},"hash":"375dfd88207de20b","id":"hash-maps","name":"Hash Maps","num":3,"problems":["intersection-of-two-arrays","contains-duplicate-ii","dot-product-of-two-sparse-vectors","isomorphic-strings","word-pattern","group-anagrams","top-k-frequent-elements","valid-sudoku","longest-consecutive-sequence","subarray-sum-equals-k","contiguous-array","4sum-ii","brick-wall"],"ready":true},{"blurb":"Converging from the ends, read/write pointers, three-way partition.","cards":["two-pointers.one-question","two-pointers.why-linear","two-pointers.lt-vs-le","two-pointers.two-sum-ii-proof","two-pointers.container-proof","two-pointers.rain-rule","two-pointers.palindrome-ii","two-pointers.dutch-flag","two-pointers.move-zeroes-invariant","two-pointers.three-sum-dupes","two-pointers.k-sum","two-pointers.sorted-squares","two-pointers.guards","two-pointers.four-sum-j"],"counts":{"easy":5,"hard":1,"medium":5,"total":11},"hash":"38524142d7b0a52c","id":"two-pointers","name":"Two Pointers","num":4,"problems":["valid-palindrome","valid-palindrome-ii","reverse-vowels-of-a-string","move-zeroes","squares-of-a-sorted-array","two-sum-ii-input-array-is-sorted","container-with-most-water","3sum","4sum","sort-colors","trapping-rain-water"],"ready":true},{"blurb":"Contiguous subarrays and substrings with fixed or variable windows.","cards":["sliding-window.one-question","sliding-window.why-linear","sliding-window.longest-template","sliding-window.shortest-template","sliding-window.negatives","sliding-window.lc3","sliding-window.lc424","sliding-window.lc1004","sliding-window.lc209","sliding-window.lc76","sliding-window.lc567","sliding-window.lc239","sliding-window.deque-amortized","sliding-window.exactly-k","sliding-window.lc1052","sliding-window.lc30"],"counts":{"easy":1,"hard":3,"medium":11,"total":15},"hash":"07a0f2ee7e963f84","id":"sliding-window","name":"Sliding Window","num":5,"problems":["maximum-average-subarray-i","permutation-in-string","find-all-anagrams-in-a-string","max-consecutive-ones-iii","longest-substring-without-repeating-characters","longest-repeating-character-replacement","fruit-into-baskets","longest-substring-with-at-most-k-distinct-characters","grumpy-bookstore-owner","maximum-points-you-can-obtain-from-cards","longest-turbulent-subarray","minimum-size-subarray-sum","sliding-window-maximum","minimum-window-substring","substring-with-concatenation-of-all-words"],"ready":true},{"blurb":"Cycle detection and midpoints with two speeds.","cards":["fast-slow-pointers.one-question","fast-slow-pointers.why-meet","fast-slow-pointers.entrance-proof","fast-slow-pointers.guard","fast-slow-pointers.middle","fast-slow-pointers.happy","fast-slow-pointers.duplicate","fast-slow-pointers.duplicate-why-zero","fast-slow-pointers.palindrome","fast-slow-pointers.circular-loop","fast-slow-pointers.set-vs-floyd","fast-slow-pointers.identity","fast-slow-pointers.cycle-length"],"counts":{"easy":4,"hard":0,"medium":3,"total":7},"hash":"3ebfff0f7e9704f4","id":"fast-slow-pointers","name":"Fast \u0026 Slow Pointers","num":6,"problems":["linked-list-cycle","middle-of-the-linked-list","palindrome-linked-list","happy-number","linked-list-cycle-ii","find-the-duplicate-number","circular-array-loop"],"ready":true},{"blurb":"Pointer rewiring, dummy nodes, reversal, merging.","cards":["linked-lists.one-question","linked-lists.dummy","linked-lists.reverse","linked-lists.prev-after-delete","linked-lists.nth-end","linked-lists.middle-delete","linked-lists.rotate","linked-lists.intersection","linked-lists.merge-two","linked-lists.merge-k","linked-lists.sort-list","linked-lists.reverse-k","linked-lists.reverse-range","linked-lists.random-copy","linked-lists.flatten","linked-lists.add-two","linked-lists.reorder","linked-lists.terminate"],"counts":{"easy":5,"hard":2,"medium":14,"total":21},"hash":"ab3fd0cb515bd645","id":"linked-lists","name":"Linked Lists","num":7,"problems":["reverse-linked-list","merge-two-sorted-lists","remove-linked-list-elements","remove-duplicates-from-sorted-list","intersection-of-two-linked-lists","delete-the-middle-node-of-a-linked-list","remove-nth-node-from-end-of-list","swap-nodes-in-pairs","add-two-numbers","remove-duplicates-from-sorted-list-ii","partition-list","odd-even-linked-list","reverse-linked-list-ii","rotate-list","split-linked-list-in-parts","reorder-list","copy-list-with-random-pointer","sort-list","flatten-a-multilevel-doubly-linked-list","reverse-nodes-in-k-group","merge-k-sorted-lists"],"ready":true},{"blurb":"LIFO matching, simulation, monotonic stacks.","cards":["stacks.one-question","stacks.amortized","stacks.valid-parens","stacks.backspace","stacks.adjacent-dupes","stacks.min-stack","stacks.rpn","stacks.next-greater","stacks.daily-temps","stacks.circular","stacks.nge1","stacks.asteroid","stacks.decode","stacks.span","stacks.histogram","stacks.maximal-rectangle","stacks.baseball","stacks.min-remove","stacks.calculator","stacks.car-fleet"],"counts":{"easy":5,"hard":2,"medium":13,"total":20},"hash":"1d1b09076fe8d499","id":"stacks","name":"Stacks","num":8,"problems":["valid-parentheses","baseball-game","backspace-string-compare","remove-all-adjacent-duplicates-in-string","next-greater-element-i","min-stack","evaluate-reverse-polish-notation","basic-calculator-ii","simplify-path","daily-temperatures","car-fleet","next-greater-element-ii","asteroid-collision","decode-string","minimum-remove-to-make-valid-parentheses","online-stock-span","buildings-with-an-ocean-view","sum-of-subarray-minimums","largest-rectangle-in-histogram","maximal-rectangle"],"ready":true},{"blurb":"Halving sorted spaces, boundaries, and search on the answer.","cards":["binary-search.one-question","binary-search.first-true","binary-search.exact","binary-search.lower-upper","binary-search.insert","binary-search.first-bad","binary-search.sqrt","binary-search.matrix","binary-search.first-last","binary-search.rotated-search","binary-search.rotated-min","binary-search.rotated-dupes","binary-search.peak","binary-search.answer","binary-search.koko","binary-search.ship","binary-search.split","binary-search.median","binary-search.timemap","binary-search.k-closest"],"counts":{"easy":6,"hard":3,"medium":12,"total":21},"hash":"2719a1facd217294","id":"binary-search","name":"Binary Search","num":9,"problems":["binary-search","first-bad-version","search-insert-position","valid-perfect-square","sqrtx","find-smallest-letter-greater-than-target","search-a-2d-matrix","find-first-and-last-position-of-element-in-sorted-array","search-in-rotated-sorted-array","find-minimum-in-rotated-sorted-array","search-in-rotated-sorted-array-ii","find-peak-element","time-based-key-value-store","koko-eating-bananas","capacity-to-ship-packages-within-d-days","successful-pairs-of-spells-and-potions","find-k-closest-elements","random-pick-with-weight","median-of-two-sorted-arrays","split-array-largest-sum","minimize-max-distance-to-gas-station"],"ready":true},{"blurb":"Recursion, DFS orders, BFS levels, BST properties.","cards":["trees.one-question","trees.max-depth","trees.min-depth","trees.invert","trees.same","trees.symmetric","trees.path-sum","trees.diameter","trees.balanced","trees.subtree","trees.level-order","trees.right-view","trees.kth-bst","trees.validate-bst","trees.lca-bst","trees.build","trees.max-path","trees.serialize","trees.lca","trees.distance-k"],"counts":{"easy":10,"hard":2,"medium":13,"total":25},"hash":"0954e6a2ce6292ff","id":"trees","name":"Trees","num":10,"problems":["maximum-depth-of-binary-tree","minimum-depth-of-binary-tree","invert-binary-tree","same-tree","symmetric-tree","path-sum","diameter-of-binary-tree","balanced-binary-tree","subtree-of-another-tree","range-sum-of-bst","binary-tree-level-order-traversal","binary-tree-right-side-view","binary-tree-zigzag-level-order-traversal","binary-tree-vertical-order-traversal","count-good-nodes-in-binary-tree","sum-root-to-leaf-numbers","all-nodes-distance-k-in-binary-tree","kth-smallest-element-in-a-bst","validate-binary-search-tree","lowest-common-ancestor-of-a-binary-search-tree","lowest-common-ancestor-of-a-binary-tree","lowest-common-ancestor-of-a-binary-tree-iii","construct-binary-tree-from-preorder-and-inorder-traversal","binary-tree-maximum-path-sum","serialize-and-deserialize-binary-tree"],"ready":true},{"blurb":"Prefix trees for fast word and prefix search.","cards":["tries.one-question","tries.node","tries.search-vs-prefix","tries.cost","tries.wildcard","tries.word-search-ii","tries.duplicates","tries.prune","tries.array-children","tries.memory","tries.wildcard-cost","tries.when-not","tries.suggestions"],"counts":{"easy":0,"hard":1,"medium":3,"total":4},"hash":"0402d16c01e3b2b5","id":"tries","name":"Tries","num":11,"problems":["implement-trie-prefix-tree","design-add-and-search-words-data-structure","search-suggestions-system","word-search-ii"],"ready":true},{"blurb":"Dynamic ordering: top-k, streaming medians, scheduling.","cards":["heaps.one-question","heaps.costs","heaps.max","heaps.k-largest","heaps.k-smallest","heaps.tie","heaps.stones","heaps.kth-stream","heaps.scheduler","heaps.twitter","heaps.median","heaps.median-add","heaps.kth-array","heaps.topk-words","heaps.reorganize"],"counts":{"easy":2,"hard":1,"medium":6,"total":9},"hash":"c49f12cca94f43bd","id":"heaps","name":"Heap / Priority Queue","num":12,"problems":["last-stone-weight","kth-largest-element-in-a-stream","k-closest-points-to-origin","kth-largest-element-in-an-array","top-k-frequent-words","task-scheduler","reorganize-string","design-twitter","find-median-from-data-stream"],"ready":true},{"blurb":"Exploring decision trees: choose, recurse, un-choose.","cards":["backtracking.one-question","backtracking.template","backtracking.copy","backtracking.subsets","backtracking.dupes","backtracking.reuse","backtracking.prune","backtracking.perms","backtracking.word-search","backtracking.queens","backtracking.palindromes","backtracking.phone","backtracking.complexity","backtracking.parentheses"],"counts":{"easy":0,"hard":1,"medium":9,"total":10},"hash":"823fb4b3d5310233","id":"backtracking","name":"Backtracking","num":13,"problems":["subsets","combination-sum","permutations","subsets-ii","combination-sum-ii","word-search","palindrome-partitioning","letter-combinations-of-a-phone-number","generate-parentheses","n-queens"],"ready":true},{"blurb":"Grid DFS/BFS, topological sort, union-find, shortest paths.","cards":["graphs.one-question","graphs.visited","graphs.islands","graphs.surrounded","graphs.pacific","graphs.rotting","graphs.clone","graphs.kahn","graphs.prereq-direction","graphs.valid-tree","graphs.redundant","graphs.accounts","graphs.dijkstra","graphs.bellman","graphs.word-ladder","graphs.alien","graphs.walls-gates","graphs.bombs"],"counts":{"easy":0,"hard":2,"medium":19,"total":21},"hash":"5ec55d0135b2d044","id":"graphs","name":"Graphs","num":14,"problems":["number-of-islands","max-area-of-island","surrounded-regions","rotting-oranges","walls-and-gates","pacific-atlantic-water-flow","detonate-the-maximum-bombs","clone-graph","course-schedule","course-schedule-ii","graph-valid-tree","number-of-connected-components-in-an-undirected-graph","number-of-provinces","redundant-connection","accounts-merge","network-delay-time","cheapest-flights-within-k-stops","shortest-path-in-binary-matrix","minimum-knight-moves","word-ladder","alien-dictionary"],"ready":true},{"blurb":"Linear recurrences: the answer at i from the answers before it.","cards":["dp-1d.one-question","dp-1d.steps","dp-1d.stairs","dp-1d.robber","dp-1d.robber-ii","dp-1d.decode","dp-1d.coin-change","dp-1d.comb-iv","dp-1d.word-break","dp-1d.lis","dp-1d.partition","dp-1d.palindrome","dp-1d.max-product","dp-1d.min-cost-stairs"],"counts":{"easy":2,"hard":0,"medium":11,"total":13},"hash":"71ce31d4d5590f97","id":"dp-1d","name":"Dynamic Programming 1D","num":15,"problems":["climbing-stairs","min-cost-climbing-stairs","house-robber","house-robber-ii","decode-ways","coin-change","combination-sum-iv","word-break","longest-increasing-subsequence","partition-equal-subset-sum","longest-palindromic-substring","palindromic-substrings","maximum-product-subarray"],"ready":true},{"blurb":"Grids and two-sequence recurrences.","cards":["dp-2d.one-question","dp-2d.unique-paths","dp-2d.obstacles","dp-2d.lcs","dp-2d.edit","dp-2d.cooldown","dp-2d.coin-change-ii","dp-2d.target-sum","dp-2d.interleave","dp-2d.lip","dp-2d.distinct","dp-2d.balloons","dp-2d.regex"],"counts":{"easy":0,"hard":4,"medium":8,"total":12},"hash":"6b916f4fa8d5ff7e","id":"dp-2d","name":"Dynamic Programming 2D","num":16,"problems":["unique-paths","unique-paths-ii","longest-common-subsequence","edit-distance","best-time-to-buy-and-sell-stock-with-cooldown","coin-change-ii","target-sum","interleaving-string","longest-increasing-path-in-a-matrix","distinct-subsequences","burst-balloons","regular-expression-matching"],"ready":true},{"blurb":"Sorting, merging and sweeping ranges.","cards":["intervals.one-question","intervals.overlap","intervals.check","intervals.merge","intervals.merge-max","intervals.insert","intervals.greedy","intervals.greedy-proof","intervals.rooms","intervals.sweep","intervals.depth","intervals.touching","intervals.arrows","intervals.intersections","intervals.min-query"],"counts":{"easy":1,"hard":1,"medium":5,"total":7},"hash":"babb3e24ecc78fd4","id":"intervals","name":"Intervals","num":17,"problems":["meeting-rooms","insert-interval","merge-intervals","interval-list-intersections","non-overlapping-intervals","meeting-rooms-ii","minimum-interval-to-include-each-query"],"ready":true},{"blurb":"XOR tricks, masks and binary arithmetic.","cards":["bit-manipulation.one-question","bit-manipulation.xor-facts","bit-manipulation.single","bit-manipulation.missing","bit-manipulation.kernighan","bit-manipulation.lowest","bit-manipulation.power-two","bit-manipulation.counting","bit-manipulation.reverse","bit-manipulation.add","bit-manipulation.python-mask","bit-manipulation.overflow","bit-manipulation.not"],"counts":{"easy":5,"hard":0,"medium":2,"total":7},"hash":"515f265bc67930d8","id":"bit-manipulation","name":"Bit Manipulation","num":18,"problems":["single-number","number-of-1-bits","counting-bits","missing-number","reverse-bits","sum-of-two-integers","reverse-integer"],"ready":true},{"blurb":"Take the locally best step and prove it safe with an exchange argument, a frontier or a forced move.","cards":["greedy.one-question","greedy.exchange","greedy.stays-ahead","greedy.coin-trap","greedy.units","greedy.jump","greedy.jump2","greedy.gas","greedy.gas-total","greedy.kadane","greedy.partition","greedy.arrows","greedy.straights","greedy.triplets","greedy.vps","greedy.task"],"counts":{"easy":1,"hard":0,"medium":11,"total":12},"hash":"a87ef2c461f47c99","id":"greedy","name":"Greedy","num":19,"problems":["maximum-units-on-a-truck","maximum-subarray","jump-game","jump-game-ii","gas-station","partition-labels","minimum-number-of-arrows-to-burst-balloons","non-overlapping-intervals","hand-of-straights","task-scheduler","merge-triplets-to-form-target-triplet","valid-parenthesis-string"],"ready":true},{"blurb":"Index maps on grids, in-place markers, digit arithmetic, fast powers and small geometry.","cards":["matrix-math.one-question","matrix-math.rotate","matrix-math.rotate-map","matrix-math.counter","matrix-math.spiral","matrix-math.zeroes","matrix-math.life","matrix-math.life-rule","matrix-math.plus-one","matrix-math.multiply","matrix-math.pow","matrix-math.pow-proof","matrix-math.squares","matrix-math.robot","matrix-math.happy"],"counts":{"easy":2,"hard":0,"medium":8,"total":10},"hash":"5a97df7b841f0eb9","id":"matrix-math","name":"Matrix \u0026 Math","num":20,"problems":["plus-one","happy-number","rotate-image","spiral-matrix","set-matrix-zeroes","game-of-life","powx-n","multiply-strings","detect-squares","robot-bounded-in-circle"],"ready":true},{"blurb":"Classes whose operations must all be fast: combine a map with a list, a heap, a history or a window.","cards":["ds-design.one-question","ds-design.lru","ds-design.lru-key","ds-design.random","ds-design.random-last","ds-design.lfu","ds-design.lfu-min","ds-design.snapshot","ds-design.stock","ds-design.moving-average","ds-design.logger","ds-design.hits","ds-design.min-stack","ds-design.median","ds-design.ordered-dict"],"counts":{"easy":2,"hard":2,"medium":10,"total":14},"hash":"8f64b79be03d410f","id":"ds-design","name":"Data-Structure Design","num":21,"problems":["moving-average-from-data-stream","logger-rate-limiter","min-stack","lru-cache","insert-delete-getrandom-o1","time-based-key-value-store","snapshot-array","design-hit-counter","online-stock-span","implement-trie-prefix-tree","stock-price-fluctuation","design-twitter","find-median-from-data-stream","lfu-cache"],"ready":true},{"blurb":"Weighted shortest paths, bottleneck paths, spanning trees, Euler paths and bridges.","cards":["advanced-graphs.one-question","advanced-graphs.dijkstra","advanced-graphs.dijkstra-why","advanced-graphs.bellman","advanced-graphs.minimax","advanced-graphs.prim","advanced-graphs.kruskal","advanced-graphs.cut","advanced-graphs.division","advanced-graphs.bus","advanced-graphs.hierholzer","advanced-graphs.euler-exists","advanced-graphs.bridge","advanced-graphs.articulation","advanced-graphs.swim"],"counts":{"easy":0,"hard":4,"medium":5,"total":9},"hash":"143a3542b09adffd","id":"advanced-graphs","name":"Advanced Graphs","num":22,"problems":["network-delay-time","cheapest-flights-within-k-stops","path-with-minimum-effort","swim-in-rising-water","min-cost-to-connect-all-points","evaluate-division","bus-routes","reconstruct-itinerary","critical-connections-in-a-network"],"ready":true}],"plans":[{"blurb":"The Core problems only, the ones mid-level loops ask most. Choose it when your interviews are close.","hash":"50b05063b51996a6","length":12,"name":"Core sprint","problems":155},{"blurb":"Core, plus the Recommended problems in the highest-return patterns (two pointers, sliding window, binary search, graphs, backtracking, heaps, DP).","hash":"757aba7ccd9ec7e2","length":16,"name":"Core + high-return","problems":186},{"blurb":"Core and every Recommended problem. Optional problems are never scheduled in any plan, but stay one click away.","hash":"b6a0b810a712167b","length":20,"name":"The full route","problems":248}],"practicals":[{"format":"Progressive assessment (CodeSignal-style)","hash":"fe804d55e0540a15","id":"in-memory-db","levels":4,"minutes":90,"summary":"Build a small key-value store one level at a time: records with fields, then scans, then fields that expire, then backups you can restore. Each level\u0026#39;s tests include every earlier level, so a change that breaks old behaviour shows up at once.","title":"In-memory database"},{"format":"Progressive assessment (CodeSignal-style)","hash":"4f9ce246703f9cff","id":"bank-system","levels":3,"minutes":90,"summary":"Accounts, deposits and transfers; then a ranking of the biggest spenders; then card payments that pay 2% cashback a day later. The last level is about time: work that\u0026#39;s due has to happen before anything else.","title":"Bank system"}],"presets":[{"behavioral":false,"blurb":"Two Mediums in 45 minutes, no Run button. Speed and clean first attempts decide it.","company":"Meta","followups":false,"id":"meta","minutes":45,"name":"Meta coding round","run":false,"slots":[["medium"],["medium"]],"tips":["About 20 minutes each: say the approach and its cost within the first 5.","Code the optimal solution directly when you see it; mention the brute force in one sentence.","Trace one example out loud before you say you\u0026#39;re done; nobody runs the code for you."]},{"behavioral":false,"blurb":"One harder problem in 45 minutes, no Run button, then the follow-up questions that test depth.","company":"Google","followups":true,"id":"google","minutes":45,"name":"Google coding round","run":false,"slots":[["medium","hard"]],"tips":["Clarify the input first; Google interviewers reward the questions as much as the code.","Prove why the approach is correct (the invariant), not only that it passes the example.","Leave 10 minutes for the follow-ups; they decide between a hire and a strong hire."]},{"behavioral":true,"blurb":"A leadership-principle question first (about 10 minutes, STAR), then one Medium. Both are graded.","company":"Amazon","followups":false,"id":"amazon","minutes":60,"name":"Amazon coding round","run":false,"slots":[["medium"]],"tips":["Answer the behavioral question with a real story and your own actions; the Bar Raiser listens for \u0026#34;I\u0026#34;, not \u0026#34;we\u0026#34;.","In the coding part, readable names and small functions count; Amazon grades code you\u0026#39;d ship.","Say the trade-offs you made, the way you\u0026#39;d say them in a design review."]},{"behavioral":false,"blurb":"Two Mediums from the HackerRank track in 90 minutes with a Run button. Hidden tests run at the end, including large inputs, so a slow solution fails.","company":"HackerRank","followups":false,"id":"hackerrank-oa","minutes":90,"name":"HackerRank online assessment","run":true,"slots":[["medium"],["medium"]],"source":"hackerrank","tips":["Read both problems first and start with the one you see fastest.","The visible tests are easy; hidden ones check edge cases and size. State the complexity to yourself before submitting.","Partial credit counts in real OAs; a correct brute force beats an unfinished optimal one."]},{"behavioral":false,"blurb":"Four problems of rising difficulty in 70 minutes with a Run button, the format Uber and others screen with.","company":"CodeSignal","followups":false,"id":"codesignal-gca","minutes":70,"name":"CodeSignal general assessment","run":true,"slots":[["easy"],["easy","medium"],["medium"],["medium","hard"]],"tips":["Budget the clock: about 10, 15, 20 and 25 minutes.","The first two are implementation; don\u0026#39;t over-think them.","Problem four is often a known pattern in disguise; name it before coding."]}],"problems":[{"difficulty":"easy","hash":"e127583816be6e65","lc":27,"one_liner":"Copy every keeper to \u003ccode\u003enums[w]\u003c/code\u003e, advance w, return w.","patterns":["arrays"],"ready":true,"slug":"remove-element","source":"leetcode","technique":"In-place pointer overwrite","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Remove Element"},{"difficulty":"easy","hash":"b501ffb8628ef9cf","lc":26,"one_liner":"Keep nums[i] only if it differs from the last kept value \u003ccode\u003enums[w − 1]\u003c/code\u003e.","patterns":["arrays"],"ready":true,"slug":"remove-duplicates-from-sorted-array","source":"leetcode","technique":"Write index vs read index","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Remove Duplicates from Sorted Array"},{"difficulty":"easy","hash":"223da260ef402050","lc":66,"one_liner":"From the right: digit \u0026lt; 9 → +1 and return; 9 → 0 and carry on; all 9s → prepend 1.","patterns":["arrays","matrix-math"],"ready":true,"slug":"plus-one","source":"leetcode","technique":"Carry-over logic","tier":"core","tier_why":"On the NeetCode 150.","title":"Plus One"},{"difficulty":"easy","hash":"29f86ac70eed1312","lc":1,"one_liner":"One pass, map value → index; check \u003ccode\u003etarget − x\u003c/code\u003e \u003cstrong\u003ebefore\u003c/strong\u003e storing x.","patterns":["arrays"],"ready":true,"slug":"two-sum","source":"leetcode","technique":"Hash map complement lookup","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon.","title":"Two Sum"},{"difficulty":"easy","hash":"91a4f7edd244418e","lc":121,"one_liner":"Carry the cheapest price so far; profit today = price − min.","patterns":["arrays"],"ready":true,"slug":"best-time-to-buy-and-sell-stock","source":"leetcode","technique":"Track min price so far","tier":"core","tier_why":"On the NeetCode 150.","title":"Best Time to Buy and Sell Stock"},{"difficulty":"easy","hash":"97af323149809da0","lc":217,"one_liner":"Set of seen values; return True the moment one repeats.","patterns":["arrays"],"ready":true,"slug":"contains-duplicate","source":"leetcode","technique":"HashSet existence check","tier":"core","tier_why":"On the NeetCode 150.","title":"Contains Duplicate"},{"difficulty":"easy","hash":"a4b5c25a7e4ad988","lc":88,"one_liner":"Three pointers from the back; place the bigger tail at w; loop while nums2 has values.","patterns":["arrays"],"ready":true,"slug":"merge-sorted-array","source":"leetcode","technique":"Fill from the back","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Merge Sorted Array"},{"difficulty":"medium","hash":"b81d50a1f1ef7650","lc":31,"one_liner":"i = rightmost index with a[i] \u0026lt; a[i+1]; if found, swap a[i] with the rightmost a[j] \u0026gt; a[i]; reverse a[i+1:]. No ascent: reverse everything.","patterns":["arrays"],"ready":true,"slug":"next-permutation","source":"leetcode","technique":"Pivot from the right, swap, reverse","tier":"recommended","tier_why":"Named in Meta's list, but a one-off trick; Recommended.","title":"Next Permutation"},{"difficulty":"easy","hash":"16906575889eb89b","lc":118,"one_liner":"row[j] = prev[j − 1] + prev[j]; both ends are 1.","patterns":["arrays"],"ready":true,"slug":"pascals-triangle","source":"leetcode","technique":"Iterative row building","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Pascal's Triangle"},{"difficulty":"easy","hash":"97e2b00559874a84","lc":350,"one_liner":"Counter of the smaller array; walk the other and spend one count per match.","patterns":["arrays"],"ready":true,"slug":"intersection-of-two-arrays-ii","source":"leetcode","technique":"Frequency count or sorting","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Intersection of Two Arrays II"},{"difficulty":"easy","hash":"d6521a063f1946d9","lc":941,"one_liner":"Climb while rising; peak can\u0026#39;t be at either end; descend while falling; must reach the end.","patterns":["arrays"],"ready":true,"slug":"valid-mountain-array","source":"leetcode","technique":"Climb up, then climb down","tier":"optional","tier_why":"A single scan with a phase flag; Best Time to Buy and Sell Stock drills the same scan-with-state skill.","title":"Valid Mountain Array"},{"difficulty":"medium","hash":"1f25ad6b495b2060","lc":53,"one_liner":"\u003ccode\u003ecur = max(x, cur + x)\u003c/code\u003e; \u003ccode\u003ebest = max(best, cur)\u003c/code\u003e. Start both at nums[0].","patterns":["arrays","greedy"],"ready":true,"slug":"maximum-subarray","source":"leetcode","technique":"Kadane's algorithm","tier":"core","tier_why":"On the NeetCode 150.","title":"Maximum Subarray"},{"difficulty":"medium","hash":"eee9fc7a10eff6b9","lc":238,"one_liner":"Pass 1 writes the product of everything left of i; pass 2 multiplies by everything right of i.","patterns":["arrays"],"ready":true,"slug":"product-of-array-except-self","source":"leetcode","technique":"Prefix and suffix products","tier":"core","tier_why":"On the NeetCode 150; reported at Meta.","title":"Product of Array Except Self"},{"difficulty":"medium","hash":"5807ecbb29684b2a","lc":57,"one_liner":"Copy while end \u0026lt; new start; absorb while start ≤ new end; append; copy the rest.","patterns":["arrays","intervals"],"ready":true,"slug":"insert-interval","source":"leetcode","technique":"Left / overlap / right scan","tier":"core","tier_why":"On the NeetCode 150.","title":"Insert Interval"},{"difficulty":"medium","hash":"265c52fe448b7704","lc":56,"one_liner":"Sort by start; overlap with the last merged → extend its end with max; else append.","patterns":["arrays","intervals"],"ready":true,"slug":"merge-intervals","source":"leetcode","technique":"Sort by start + linear merge","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon, Google.","title":"Merge Intervals"},{"difficulty":"easy","hash":"ab38e4b132db40c9","lc":344,"one_liner":"l, r at the ends; swap s[l] and s[r]; move both inward while l \u0026lt; r.","patterns":["strings"],"ready":true,"slug":"reverse-string","source":"leetcode","technique":"Two pointers swap ends","tier":"optional","tier_why":"The converging swap that Valid Palindrome already drills.","title":"Reverse String"},{"difficulty":"easy","hash":"ea3c7199d0ee1f7a","lc":242,"one_liner":"Equal lengths; count +1 for s, −1 for t; an anagram never drives a counter below zero.","patterns":["strings"],"ready":true,"slug":"valid-anagram","source":"leetcode","technique":"Frequency array (26)","tier":"core","tier_why":"On the NeetCode 150.","title":"Valid Anagram"},{"difficulty":"easy","hash":"a12e6192b70ab368","lc":14,"one_liner":"Scan column j of every word; stop at the first word that is too short or disagrees.","patterns":["strings"],"ready":true,"slug":"longest-common-prefix","source":"leetcode","technique":"Horizontal scanning","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Longest Common Prefix"},{"difficulty":"medium","hash":"99883ed6a3014297","lc":271,"one_liner":"encode: \u0026#39;\u0026#39;.join(f\u0026#39;{len(s)}#{s}\u0026#39;); decode: read digits up to \u0026#39;#\u0026#39;, take that many characters, repeat.","patterns":["strings"],"ready":true,"slug":"encode-and-decode-strings","source":"leetcode","technique":"Length prefix: len + '#' + string","tier":"core","tier_why":"On the NeetCode 150.","title":"Encode and Decode Strings"},{"difficulty":"easy","hash":"0ba54f1f5c145ff6","lc":387,"one_liner":"Count all 26 letters, then return the first index whose letter has count 1.","patterns":["strings"],"ready":true,"slug":"first-unique-character-in-a-string","source":"leetcode","technique":"Frequency array lookup","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"First Unique Character in a String"},{"difficulty":"easy","hash":"3771f03794a7b619","lc":383,"one_liner":"Count the magazine\u0026#39;s letters; spend one per note letter; fail if any counter goes below zero.","patterns":["strings"],"ready":true,"slug":"ransom-note","source":"leetcode","technique":"Frequency array decrement","tier":"optional","tier_why":"The counting that Valid Anagram already drills.","title":"Ransom Note"},{"difficulty":"medium","hash":"c6b5e3d6b7491ed9","lc":791,"one_liner":"cnt = Counter(s); for c in order: emit c · cnt.pop(c, 0); then emit every remaining c · cnt[c].","patterns":["strings"],"ready":true,"slug":"custom-sort-string","source":"leetcode","technique":"Count, then emit in the given order","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Custom Sort String"},{"difficulty":"easy","hash":"3faa0da3f1121712","lc":28,"one_liner":"Try each start i ≤ n − m; KMP\u0026#39;s failure table lets the text index never move back: O(n + m).","patterns":["strings"],"ready":true,"slug":"find-the-index-of-the-first-occurrence-in-a-string","source":"leetcode","technique":"Sliding window or KMP","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Find the Index of the First Occurrence in a String"},{"difficulty":"easy","hash":"2b5a63049c972ca6","lc":459,"one_liner":"s is a repeated block iff s occurs in (s + s) with its first and last characters removed.","patterns":["strings"],"ready":true,"slug":"repeated-substring-pattern","source":"leetcode","technique":"(s+s)[1:-1].find(s)","tier":"optional","tier_why":"A one-off string-doubling trick; no source names it.","title":"Repeated Substring Pattern"},{"difficulty":"medium","hash":"4f6924c0e5b9fe65","lc":151,"one_liner":"Walk from the end: skip spaces, take the word, repeat; join the words with single spaces.","patterns":["strings"],"ready":true,"slug":"reverse-words-in-a-string","source":"leetcode","technique":"Split, reverse, join","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Reverse Words in a String"},{"difficulty":"medium","hash":"80373dc1a3d0b154","lc":8,"one_liner":"Skip spaces → one optional sign → digits until a non-digit; check overflow before each digit and clamp.","patterns":["strings"],"ready":true,"slug":"string-to-integer-atoi","source":"leetcode","technique":"State: sign, digits, overflow","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"String to Integer (atoi)"},{"difficulty":"hard","hash":"141d67c3da25dc98","lc":273,"one_liner":"Split the number into groups of three from the right; name each non-zero group (hundreds, tens, ones) and add its scale word.","patterns":["strings"],"ready":true,"slug":"integer-to-english-words","source":"leetcode","technique":"Groups of three digits + scale words","tier":"recommended","tier_why":"Named in an older community copy of Amazon's list; not on the NeetCode 150.","title":"Integer to English Words"},{"difficulty":"easy","hash":"15df38313daa2a42","lc":349,"one_liner":"Put one array in a set; collect values of the other that are in it (each once).","patterns":["hash-maps"],"ready":true,"slug":"intersection-of-two-arrays","source":"leetcode","technique":"Set intersection","tier":"optional","tier_why":"Set membership, which Contains Duplicate already drills.","title":"Intersection of Two Arrays"},{"difficulty":"easy","hash":"8c05f552011b781f","lc":219,"one_liner":"Remember each value\u0026#39;s last index; a repeat within k of it answers True.","patterns":["hash-maps"],"ready":true,"slug":"contains-duplicate-ii","source":"leetcode","technique":"Map value → last index","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Contains Duplicate II"},{"difficulty":"medium","hash":"4acfcab967da7970","lc":1570,"one_liner":"Keep {i: x for nonzero x}; dot product = Σ v · other[i] over the smaller map\u0026#39;s items that appear in the other.","patterns":["hash-maps"],"ready":true,"slug":"dot-product-of-two-sparse-vectors","source":"leetcode","technique":"Map of non-zero entries","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Dot Product of Two Sparse Vectors"},{"difficulty":"easy","hash":"4bb50485b3dba519","lc":205,"one_liner":"Walk both strings together; a map each way must stay consistent (s→t and t→s).","patterns":["hash-maps"],"ready":true,"slug":"isomorphic-strings","source":"leetcode","technique":"Two maps char ↔ char","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Isomorphic Strings"},{"difficulty":"easy","hash":"253aa12eec395944","lc":290,"one_liner":"Split into words; same count as letters; letter → word and word → letter must both stay consistent.","patterns":["hash-maps"],"ready":true,"slug":"word-pattern","source":"leetcode","technique":"Bijection char ↔ word","tier":"optional","tier_why":"The same two-way mapping check as Isomorphic Strings.","title":"Word Pattern"},{"difficulty":"medium","hash":"56dd9cd372f9bc07","lc":49,"one_liner":"Key each word by its sorted letters (or 26 counts); words with the same key form a group.","patterns":["hash-maps"],"ready":true,"slug":"group-anagrams","source":"leetcode","technique":"Sorted string or count key","tier":"core","tier_why":"On the NeetCode 150.","title":"Group Anagrams"},{"difficulty":"medium","hash":"c2199f6caf66e777","lc":347,"one_liner":"Count; bucket values by frequency (index = count); read buckets from the top until k values.","patterns":["hash-maps"],"ready":true,"slug":"top-k-frequent-elements","source":"leetcode","technique":"Bucket sort or min-heap","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon.","title":"Top K Frequent Elements"},{"difficulty":"medium","hash":"4d4e777324102a8c","lc":36,"one_liner":"One pass over the 81 cells; a digit already seen in its row, column or 3×3 box makes the board invalid.","patterns":["hash-maps"],"ready":true,"slug":"valid-sudoku","source":"leetcode","technique":"Sets per row / col / box","tier":"core","tier_why":"On the NeetCode 150.","title":"Valid Sudoku"},{"difficulty":"medium","hash":"8e24fdb2dd28673d","lc":128,"one_liner":"Put all values in a set; from each x with x − 1 missing, walk x + 1, x + 2, … and keep the longest run.","patterns":["hash-maps"],"ready":true,"slug":"longest-consecutive-sequence","source":"leetcode","technique":"Start only where n−1 is missing","tier":"core","tier_why":"On the NeetCode 150.","title":"Longest Consecutive Sequence"},{"difficulty":"medium","hash":"3bde5c24150089ad","lc":560,"one_liner":"Running sum P; add how many earlier prefixes equal P − k; then count P. Seed {0: 1}.","patterns":["hash-maps"],"ready":true,"slug":"subarray-sum-equals-k","source":"leetcode","technique":"Prefix sum map","tier":"core","tier_why":"Reported at Meta.","title":"Subarray Sum Equals K"},{"difficulty":"medium","hash":"090746deddd19c00","lc":525,"one_liner":"Count 0 as −1; equal 0s and 1s = zero sum; length = i − first index of the same running sum.","patterns":["hash-maps"],"ready":true,"slug":"contiguous-array","source":"leetcode","technique":"0 → −1, first index of each sum","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Contiguous Array"},{"difficulty":"medium","hash":"b6d069c0192313e9","lc":454,"one_liner":"Count every a + b in a map; for every c + d add count[−(c + d)]. O(n²) instead of O(n⁴).","patterns":["hash-maps"],"ready":true,"slug":"4sum-ii","source":"leetcode","technique":"Map of A+B sums, look up −(C+D)","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"4Sum II"},{"difficulty":"medium","hash":"8d6bfda4ca6169bc","lc":554,"one_liner":"Count the inner edge positions (prefix sums of each row); cut where edges are most common.","patterns":["hash-maps"],"ready":true,"slug":"brick-wall","source":"leetcode","technique":"Count edge positions","tier":"optional","tier_why":"Counting prefix positions in a map, which Subarray Sum Equals K drills harder.","title":"Brick Wall"},{"difficulty":"easy","hash":"32d6a41130c1f2e5","lc":125,"one_liner":"l, r from both ends; skip junk (guarded by l \u0026lt; r); compare lowercase; move both.","patterns":["two-pointers"],"ready":true,"slug":"valid-palindrome","source":"leetcode","technique":"Skip non-alphanumerics, converge","tier":"core","tier_why":"On the NeetCode 150.","title":"Valid Palindrome"},{"difficulty":"easy","hash":"c1d1715520e3f822","lc":680,"one_liner":"Converge; at the first mismatch return is_pal(l+1, r) or is_pal(l, r−1).","patterns":["two-pointers"],"ready":true,"slug":"valid-palindrome-ii","source":"leetcode","technique":"One skip: try both sides","tier":"core","tier_why":"Reported at Meta.","title":"Valid Palindrome II"},{"difficulty":"easy","hash":"187b38d753972353","lc":345,"one_liner":"Converge; consonant → skip that side; two vowels → swap and move both.","patterns":["two-pointers"],"ready":true,"slug":"reverse-vowels-of-a-string","source":"leetcode","technique":"Set lookup + swap","tier":"optional","tier_why":"The converging swap from Valid Palindrome with a vowel filter.","title":"Reverse Vowels of a String"},{"difficulty":"easy","hash":"c91f8def87869722","lc":283,"one_liner":"slow = next slot for a non-zero; fast reads; non-zero → swap(slow, fast), slow += 1.","patterns":["two-pointers"],"ready":true,"slug":"move-zeroes","source":"leetcode","technique":"Snowball / write index","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Move Zeroes"},{"difficulty":"easy","hash":"3e785a99b31a4f1b","lc":977,"one_liner":"The biggest square is at an end: compare |ends|, write the bigger square at the back, move that pointer.","patterns":["two-pointers"],"ready":true,"slug":"squares-of-a-sorted-array","source":"leetcode","technique":"Compare |ends|, fill from back","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Squares of a Sorted Array"},{"difficulty":"medium","hash":"23c1d3acd585a7be","lc":167,"one_liner":"Start at both ends: too small → l += 1, too big → r −= 1, equal → return [l+1, r+1].","patterns":["two-pointers"],"ready":true,"slug":"two-sum-ii-input-array-is-sorted","source":"leetcode","technique":"Too small → l++, too big → r--","tier":"core","tier_why":"On the NeetCode 150.","title":"Two Sum II - Input Array Is Sorted"},{"difficulty":"medium","hash":"5d41bbb90e03abd5","lc":11,"one_liner":"Start widest; record the area; move the shorter wall inward.","patterns":["two-pointers"],"ready":true,"slug":"container-with-most-water","source":"leetcode","technique":"Move the shorter wall","tier":"core","tier_why":"On the NeetCode 150; reported at Google.","title":"Container With Most Water"},{"difficulty":"medium","hash":"b2a1302bccad714c","lc":15,"one_liner":"Sort; fix a[i] (skip repeats, stop at a[i] \u0026gt; 0); Two Sum II on the rest for −a[i]; skip repeats of a[l] after a hit.","patterns":["two-pointers"],"ready":true,"slug":"3sum","source":"leetcode","technique":"Sort + fix one + Two Sum II","tier":"core","tier_why":"On the NeetCode 150; reported at Meta.","title":"3Sum"},{"difficulty":"medium","hash":"f9b961f26ca106a3","lc":18,"one_liner":"Sort; fix a[i] and a[j] (skip repeats at each level, j \u0026gt; i + 1); Two Sum II for the last two.","patterns":["two-pointers"],"ready":true,"slug":"4sum","source":"leetcode","technique":"Two loops + Two Sum II","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"4Sum"},{"difficulty":"medium","hash":"1b632bd67f364f99","lc":75,"one_liner":"lo, mid, hi: 0 → swap to lo (both advance); 1 → mid++; 2 → swap to hi (mid stays). Loop while mid ≤ hi.","patterns":["two-pointers"],"ready":true,"slug":"sort-colors","source":"leetcode","technique":"Dutch national flag","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Sort Colors"},{"difficulty":"hard","hash":"fef413f51df614d5","lc":42,"one_liner":"lmax \u0026lt; rmax → step l, lmax = max(lmax, h[l]), add lmax − h[l]; else mirror on the right.","patterns":["two-pointers"],"ready":true,"slug":"trapping-rain-water","source":"leetcode","technique":"Move the side with the smaller max","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon, Google, Meta.","title":"Trapping Rain Water"},{"difficulty":"easy","hash":"e07b0a3f1fe3b36c","lc":643,"one_liner":"Sum the first k; slide: add nums[r], subtract nums[r − k]; keep the best sum; divide once.","patterns":["sliding-window"],"ready":true,"slug":"maximum-average-subarray-i","source":"leetcode","technique":"Fixed window sum","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Maximum Average Subarray I"},{"difficulty":"medium","hash":"fbbdbe6cc78ea38e","lc":567,"one_liner":"Slide a window of len(s1) over s2 with 26 counts; track how many letters match; all 26 match → True.","patterns":["sliding-window"],"ready":true,"slug":"permutation-in-string","source":"leetcode","technique":"Fixed window frequency match","tier":"core","tier_why":"On the NeetCode 150.","title":"Permutation in String"},{"difficulty":"medium","hash":"ffd6f51c1acb078e","lc":438,"one_liner":"Slide a window of len(p) over s with 26 counts; record r − m + 1 whenever the counts equal p\u0026#39;s.","patterns":["sliding-window"],"ready":true,"slug":"find-all-anagrams-in-a-string","source":"leetcode","technique":"Fixed window frequency match","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Find All Anagrams in a String"},{"difficulty":"medium","hash":"422237ca5b3cf9ab","lc":1004,"one_liner":"Longest window with at most k zeros: count zeros as r grows; shrink l while zeros \u0026gt; k.","patterns":["sliding-window"],"ready":true,"slug":"max-consecutive-ones-iii","source":"leetcode","technique":"Variable window, zeros ≤ k","tier":"core","tier_why":"Reported at Meta.","title":"Max Consecutive Ones III"},{"difficulty":"medium","hash":"67f4ac15660a42fb","lc":3,"one_liner":"For each r: l = max(l, last[s[r]] + 1); last[s[r]] = r; best = max(best, r − l + 1).","patterns":["sliding-window"],"ready":true,"slug":"longest-substring-without-repeating-characters","source":"leetcode","technique":"Last index map + shrink","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon.","title":"Longest Substring Without Repeating Characters"},{"difficulty":"medium","hash":"4185493d2817c281","lc":424,"one_liner":"Window is valid iff length − (count of its most common letter) ≤ k; shrink while invalid.","patterns":["sliding-window"],"ready":true,"slug":"longest-repeating-character-replacement","source":"leetcode","technique":"len − maxCount ≤ k","tier":"core","tier_why":"On the NeetCode 150.","title":"Longest Repeating Character Replacement"},{"difficulty":"medium","hash":"68eb34dfdc71d35e","lc":904,"one_liner":"Longest window with at most 2 distinct values: count map; shrink while len(count) \u0026gt; 2.","patterns":["sliding-window"],"ready":true,"slug":"fruit-into-baskets","source":"leetcode","technique":"At most 2 distinct","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Fruit Into Baskets"},{"difficulty":"medium","hash":"aa8d436bfe964e8c","lc":340,"one_liner":"Longest window whose count map has at most k keys; shrink (deleting zero counts) while it has more.","patterns":["sliding-window"],"ready":true,"slug":"longest-substring-with-at-most-k-distinct-characters","source":"leetcode","technique":"Map size ≤ k","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Longest Substring with At Most K Distinct Characters"},{"difficulty":"medium","hash":"35b595c8ad42ea99","lc":1052,"one_liner":"Base = customers already happy; slide a window of \u003ccode\u003eminutes\u003c/code\u003e over the grumpy minutes it would rescue; add the best.","patterns":["sliding-window"],"ready":true,"slug":"grumpy-bookstore-owner","source":"leetcode","technique":"Fixed window gain","tier":"optional","tier_why":"A fixed window, which Maximum Average Subarray I already teaches.","title":"Grumpy Bookstore Owner"},{"difficulty":"medium","hash":"2b6a0da9249f1a36","lc":1423,"one_liner":"Take the first k (sum s); then k times move one card from the front to the back: s += c[n − 1 − i] − c[k − 1 − i]; keep the max.","patterns":["sliding-window"],"ready":true,"slug":"maximum-points-you-can-obtain-from-cards","source":"leetcode","technique":"Complement window / slide the taken cards","tier":"recommended","tier_why":"Builds the pattern (the complement-window trick); not on the NeetCode 150 and not named by a company source.","title":"Maximum Points You Can Obtain from Cards"},{"difficulty":"medium","hash":"c400815fac9ae1e5","lc":978,"one_liner":"Walk adjacent comparisons; extend while the sign flips; on equal or a repeated sign, restart the window.","patterns":["sliding-window"],"ready":true,"slug":"longest-turbulent-subarray","source":"leetcode","technique":"Alternating comparison signs","tier":"optional","tier_why":"A one-off sign-flip scan; no source names it.","title":"Longest Turbulent Subarray"},{"difficulty":"medium","hash":"61f592743e1b7729","lc":209,"one_liner":"Positive numbers: grow r; while sum ≥ target, record r − l + 1 and drop nums[l].","patterns":["sliding-window"],"ready":true,"slug":"minimum-size-subarray-sum","source":"leetcode","technique":"Shrink while sum ≥ target","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Minimum Size Subarray Sum"},{"difficulty":"hard","hash":"354dfa0e5e10453a","lc":239,"one_liner":"Deque of indexes with decreasing values: pop smaller from the back, expired from the front; front = max.","patterns":["sliding-window"],"ready":true,"slug":"sliding-window-maximum","source":"leetcode","technique":"Monotonic decreasing deque","tier":"core","tier_why":"On the NeetCode 150.","title":"Sliding Window Maximum"},{"difficulty":"hard","hash":"13ae0b4fb38bb6e8","lc":76,"one_liner":"Count t; grow r and decrement need; when missing == 0, record and shrink l until a needed char is lost.","patterns":["sliding-window"],"ready":true,"slug":"minimum-window-substring","source":"leetcode","technique":"need / have counters","tier":"core","tier_why":"On the NeetCode 150.","title":"Minimum Window Substring"},{"difficulty":"hard","hash":"7666969c04d65cc5","lc":30,"one_liner":"For each offset 0..w−1, slide a window one word at a time with word counts; record when it holds all words.","patterns":["sliding-window"],"ready":true,"slug":"substring-with-concatenation-of-all-words","source":"leetcode","technique":"Word-sized steps + two maps","tier":"optional","tier_why":"Find All Anagrams with words instead of letters; long to code, rarely asked.","title":"Substring with Concatenation of All Words"},{"difficulty":"easy","hash":"5ee81fc5b7bc509a","lc":141,"one_liner":"slow moves 1, fast moves 2; if they ever land on the same node, there\u0026#39;s a cycle; if fast hits None, there isn\u0026#39;t.","patterns":["fast-slow-pointers"],"ready":true,"slug":"linked-list-cycle","source":"leetcode","technique":"Floyd's tortoise \u0026 hare","tier":"core","tier_why":"On the NeetCode 150.","title":"Linked List Cycle"},{"difficulty":"easy","hash":"50c93940723f0e05","lc":876,"one_liner":"Move slow 1 and fast 2 while fast and fast.next exist; slow ends on the (second) middle.","patterns":["fast-slow-pointers"],"ready":true,"slug":"middle-of-the-linked-list","source":"leetcode","technique":"Slow 1 step, fast 2 steps","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Middle of the Linked List"},{"difficulty":"easy","hash":"ea1d09aee7b9d472","lc":234,"one_liner":"Find the middle with slow/fast, reverse the second half in place, walk both halves comparing.","patterns":["fast-slow-pointers"],"ready":true,"slug":"palindrome-linked-list","source":"leetcode","technique":"Find mid + reverse 2nd half","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Palindrome Linked List"},{"difficulty":"easy","hash":"7f3caa62542297cf","lc":202,"one_liner":"n → sum of squared digits; run slow (1 step) and fast (2 steps) until fast is 1 or they meet.","patterns":["fast-slow-pointers","matrix-math"],"ready":true,"slug":"happy-number","source":"leetcode","technique":"Cycle on digit-square sums","tier":"core","tier_why":"On the NeetCode 150.","title":"Happy Number"},{"difficulty":"medium","hash":"e157cab494a3be3c","lc":142,"one_liner":"Meet with slow/fast; then move one pointer to the head and step both by one; they meet at the cycle\u0026#39;s start.","patterns":["fast-slow-pointers"],"ready":true,"slug":"linked-list-cycle-ii","source":"leetcode","technique":"Meet, then reset one to head","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Linked List Cycle II"},{"difficulty":"medium","hash":"5441ad54c680fb06","lc":287,"one_liner":"Follow i → nums[i] from index 0; the duplicate value is the entrance of the cycle (Floyd, two phases).","patterns":["fast-slow-pointers"],"ready":true,"slug":"find-the-duplicate-number","source":"leetcode","technique":"Array as linked list","tier":"core","tier_why":"On the NeetCode 150.","title":"Find the Duplicate Number"},{"difficulty":"medium","hash":"ea85c7ef5768d19e","lc":457,"one_liner":"From each unvisited start, run Floyd on i → (i + nums[i]) mod n, stopping on a direction change or a self-loop.","patterns":["fast-slow-pointers"],"ready":true,"slug":"circular-array-loop","source":"leetcode","technique":"Cycle with direction check","tier":"optional","tier_why":"Floyd's cycle detection again, with extra direction rules.","title":"Circular Array Loop"},{"difficulty":"easy","hash":"89b974778ad044b0","lc":206,"one_liner":"prev = None; for each node: save next, point it back at prev, step prev and cur forward; return prev.","patterns":["linked-lists"],"ready":true,"slug":"reverse-linked-list","source":"leetcode","technique":"prev / cur / next swap","tier":"core","tier_why":"On the NeetCode 150.","title":"Reverse Linked List"},{"difficulty":"easy","hash":"9b48668c7981b663","lc":21,"one_liner":"dummy + tail; attach the smaller head and advance it; finally attach whatever list remains.","patterns":["linked-lists"],"ready":true,"slug":"merge-two-sorted-lists","source":"leetcode","technique":"Dummy node + stitching","tier":"core","tier_why":"On the NeetCode 150.","title":"Merge Two Sorted Lists"},{"difficulty":"easy","hash":"1d9dfdbb662d4aed","lc":203,"one_liner":"dummy → head; while prev.next: unlink it if it equals val, else advance prev; return dummy.next.","patterns":["linked-lists"],"ready":true,"slug":"remove-linked-list-elements","source":"leetcode","technique":"Sentinel node","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Remove Linked List Elements"},{"difficulty":"easy","hash":"bf506a0161154dc2","lc":83,"one_liner":"Sorted, so duplicates are adjacent: while cur.next equals cur, unlink it; else move on.","patterns":["linked-lists"],"ready":true,"slug":"remove-duplicates-from-sorted-list","source":"leetcode","technique":"Compare with next","tier":"optional","tier_why":"Remove Duplicates from Sorted List II covers this and more.","title":"Remove Duplicates from Sorted List"},{"difficulty":"easy","hash":"0dacd8d87127c7de","lc":160,"one_liner":"a walks A then B, b walks B then A; they meet at the shared node (or both reach None).","patterns":["linked-lists"],"ready":true,"slug":"intersection-of-two-linked-lists","source":"leetcode","technique":"Switch heads at the end","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Intersection of Two Linked Lists"},{"difficulty":"medium","hash":"edbb76a8edbb8f47","lc":2095,"one_liner":"Start fast two steps ahead (or slow at a dummy) so slow stops just before the middle; unlink slow.next.","patterns":["linked-lists"],"ready":true,"slug":"delete-the-middle-node-of-a-linked-list","source":"leetcode","technique":"Slow/fast to the predecessor","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Delete the Middle Node of a Linked List"},{"difficulty":"medium","hash":"c6b663777271abdb","lc":19,"one_liner":"From a dummy, move fast n + 1 steps; move both until fast is None; slow.next is the target.","patterns":["linked-lists"],"ready":true,"slug":"remove-nth-node-from-end-of-list","source":"leetcode","technique":"Gap of n between pointers","tier":"core","tier_why":"On the NeetCode 150.","title":"Remove Nth Node From End of List"},{"difficulty":"medium","hash":"430a9fc0795cf793","lc":24,"one_liner":"prev = dummy; while two nodes follow: prev → second, first → second.next, second → first; prev = first.","patterns":["linked-lists"],"ready":true,"slug":"swap-nodes-in-pairs","source":"leetcode","technique":"Iterative rewiring","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Swap Nodes in Pairs"},{"difficulty":"medium","hash":"1a90fccad7ec7787","lc":2,"one_liner":"Walk both lists with a carry; emit (a + b + carry) % 10; continue while either list or the carry remains.","patterns":["linked-lists"],"ready":true,"slug":"add-two-numbers","source":"leetcode","technique":"Digit sum with carry","tier":"core","tier_why":"On the NeetCode 150.","title":"Add Two Numbers"},{"difficulty":"medium","hash":"d2573ab6f023dd81","lc":82,"one_liner":"Dummy; if prev.next starts a run of equal values, skip the whole run; otherwise advance prev.","patterns":["linked-lists"],"ready":true,"slug":"remove-duplicates-from-sorted-list-ii","source":"leetcode","technique":"Skip whole runs","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Remove Duplicates from Sorted List II"},{"difficulty":"medium","hash":"6004b1d9951a7a75","lc":86,"one_liner":"Append each node to a \u0026#39;less\u0026#39; chain or a \u0026#39;rest\u0026#39; chain (each with a dummy), end rest with None, connect them.","patterns":["linked-lists"],"ready":true,"slug":"partition-list","source":"leetcode","technique":"Two dummy lists + join","tier":"optional","tier_why":"The dummy-head stitching from Merge Two Sorted Lists.","title":"Partition List"},{"difficulty":"medium","hash":"d3ca90ec9b47f37c","lc":328,"one_liner":"Weave two chains: odd.next = even.next, even.next = odd.next.next; then attach the even chain after the odd one.","patterns":["linked-lists"],"ready":true,"slug":"odd-even-linked-list","source":"leetcode","technique":"Stitch odd and even chains","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Odd Even Linked List"},{"difficulty":"medium","hash":"5351d585a2818211","lc":92,"one_liner":"Walk to the node before position left, reverse the next right − left + 1 nodes, then reconnect both ends.","patterns":["linked-lists"],"ready":true,"slug":"reverse-linked-list-ii","source":"leetcode","technique":"Reverse a sub-list in place","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Reverse Linked List II"},{"difficulty":"medium","hash":"4e28ea0889c227a8","lc":61,"one_liner":"Measure n and find the tail; k %= n; link tail → head; the new tail is n − k − 1 steps from the head; cut there.","patterns":["linked-lists"],"ready":true,"slug":"rotate-list","source":"leetcode","technique":"Make a ring, cut at len − k","tier":"optional","tier_why":"Close-the-ring and cut; Remove Nth Node drills the counting part.","title":"Rotate List"},{"difficulty":"medium","hash":"cc45b8c59801ba6a","lc":725,"one_liner":"Count n; part i gets n // k nodes plus one if i \u0026lt; n % k; walk each part\u0026#39;s length and cut after it.","patterns":["linked-lists"],"ready":true,"slug":"split-linked-list-in-parts","source":"leetcode","technique":"Segment sizes n/k and n%k","tier":"optional","tier_why":"Counting and cutting; no new technique.","title":"Split Linked List in Parts"},{"difficulty":"medium","hash":"de08d89df52b7654","lc":143,"one_liner":"Find the middle with slow/fast, reverse the second half, then weave the two halves node by node.","patterns":["linked-lists"],"ready":true,"slug":"reorder-list","source":"leetcode","technique":"Mid → reverse → merge","tier":"core","tier_why":"On the NeetCode 150.","title":"Reorder List"},{"difficulty":"medium","hash":"a19c5b9667c66bc5","lc":138,"one_liner":"Map old → new (two passes), or weave each copy right after its original so random.next is the copy\u0026#39;s random.","patterns":["linked-lists"],"ready":true,"slug":"copy-list-with-random-pointer","source":"leetcode","technique":"Old → new map or interweave","tier":"core","tier_why":"On the NeetCode 150.","title":"Copy List with Random Pointer"},{"difficulty":"medium","hash":"902efeaac461931b","lc":148,"one_liner":"Split at the middle with slow/fast, sort both halves recursively, merge them with a dummy.","patterns":["linked-lists"],"ready":true,"slug":"sort-list","source":"leetcode","technique":"Merge sort on a list","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Sort List"},{"difficulty":"medium","hash":"18010685364ea318","lc":430,"one_liner":"Walk the list; at a node with a child, find the child run\u0026#39;s tail, splice the run between the node and its next, clear child.","patterns":["linked-lists"],"ready":true,"slug":"flatten-a-multilevel-doubly-linked-list","source":"leetcode","technique":"DFS with a stack","tier":"optional","tier_why":"A one-off splice; rarely asked.","title":"Flatten a Multilevel Doubly Linked List"},{"difficulty":"hard","hash":"605fc8f7f0075ec8","lc":25,"one_liner":"Dummy; check k nodes exist after \u003ccode\u003ebefore\u003c/code\u003e; reverse them with prev starting at the node after the group; reconnect; repeat.","patterns":["linked-lists"],"ready":true,"slug":"reverse-nodes-in-k-group","source":"leetcode","technique":"Reverse k at a time","tier":"core","tier_why":"On the NeetCode 150.","title":"Reverse Nodes in k-Group"},{"difficulty":"hard","hash":"1232943d0df8ae77","lc":23,"one_liner":"Push every list\u0026#39;s head into a min-heap; pop the smallest, append it, push its next; repeat.","patterns":["linked-lists"],"ready":true,"slug":"merge-k-sorted-lists","source":"leetcode","technique":"Min-heap or divide \u0026 conquer","tier":"core","tier_why":"On the NeetCode 150.","title":"Merge k Sorted Lists"},{"difficulty":"easy","hash":"6b33b6c3c8461be0","lc":20,"one_liner":"Push openers; a closer must match the top (pop it); valid only if the stack ends empty.","patterns":["stacks"],"ready":true,"slug":"valid-parentheses","source":"leetcode","technique":"Map closer → opener","tier":"core","tier_why":"On the NeetCode 150.","title":"Valid Parentheses"},{"difficulty":"easy","hash":"f99bfec5b1c60e65","lc":682,"one_liner":"The record is a stack: an int pushes, \u0026#39;+\u0026#39; pushes the sum of the top two, \u0026#39;D\u0026#39; doubles the top, \u0026#39;C\u0026#39; pops.","patterns":["stacks"],"ready":true,"slug":"baseball-game","source":"leetcode","technique":"Stack simulation","tier":"optional","tier_why":"Stack simulation that Evaluate Reverse Polish Notation already drills.","title":"Baseball Game"},{"difficulty":"easy","hash":"6820bf77a9bf04b1","lc":844,"one_liner":"Build each typed result with a stack (\u0026#39;#\u0026#39; pops), or walk both strings backwards skipping erased characters.","patterns":["stacks"],"ready":true,"slug":"backspace-string-compare","source":"leetcode","technique":"Stack or backward pointers","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Backspace String Compare"},{"difficulty":"easy","hash":"602c072c7da30fe9","lc":1047,"one_liner":"For each character: if it equals the top, pop (the pair cancels); otherwise push. The stack is the answer.","patterns":["stacks"],"ready":true,"slug":"remove-all-adjacent-duplicates-in-string","source":"leetcode","technique":"Compare with stack top","tier":"optional","tier_why":"Compare-with-top, which Valid Parentheses already drills.","title":"Remove All Adjacent Duplicates In String"},{"difficulty":"easy","hash":"2e7e675f1158d690","lc":496,"one_liner":"One decreasing-stack pass over nums2 fills a map value → next greater value; answer nums1 by lookup.","patterns":["stacks"],"ready":true,"slug":"next-greater-element-i","source":"leetcode","technique":"Monotonic stack + map","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Next Greater Element I"},{"difficulty":"medium","hash":"51cc5276f720c1bb","lc":155,"one_liner":"Push (value, min(value, current min)); pop removes the pair; getMin reads the top pair\u0026#39;s min.","patterns":["stacks","ds-design"],"ready":true,"slug":"min-stack","source":"leetcode","technique":"Store min alongside each value","tier":"core","tier_why":"On the NeetCode 150.","title":"Min Stack"},{"difficulty":"medium","hash":"f7c354a8da210d3b","lc":150,"one_liner":"Numbers push; an operator pops b, then a, and pushes a op b (division truncates toward zero).","patterns":["stacks"],"ready":true,"slug":"evaluate-reverse-polish-notation","source":"leetcode","technique":"Postfix evaluation","tier":"core","tier_why":"On the NeetCode 150.","title":"Evaluate Reverse Polish Notation"},{"difficulty":"medium","hash":"4bf5e7bdadf1f345","lc":227,"one_liner":"Scan with the pending operator: + pushes num, − pushes −num, * and / replace the top with top op num (truncating); answer = sum(stack).","patterns":["stacks"],"ready":true,"slug":"basic-calculator-ii","source":"leetcode","technique":"Signed terms; * and / hit the top","tier":"core","tier_why":"Reported at Meta.","title":"Basic Calculator II"},{"difficulty":"medium","hash":"e85791dca3218231","lc":71,"one_liner":"The directories still on the path form a stack: a name pushes, \u0026#39;..\u0026#39; pops the most recent one, \u0026#39;.\u0026#39; and empty parts do nothing.","patterns":["stacks"],"ready":true,"slug":"simplify-path","source":"leetcode","technique":"Split on '/', stack of names","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Simplify Path"},{"difficulty":"medium","hash":"75732a79d42d21f5","lc":739,"one_liner":"Stack of day indexes still waiting for a warmer day; a warmer day pops them and answers i − j.","patterns":["stacks"],"ready":true,"slug":"daily-temperatures","source":"leetcode","technique":"Monotonic decreasing stack of indexes","tier":"core","tier_why":"On the NeetCode 150.","title":"Daily Temperatures"},{"difficulty":"medium","hash":"17439c5d6d7fe7bd","lc":853,"one_liner":"For cars from nearest to farthest, time = (target − pos) / speed; if time \u0026gt; the last fleet\u0026#39;s time, it\u0026#39;s a new fleet.","patterns":["stacks"],"ready":true,"slug":"car-fleet","source":"leetcode","technique":"Sort by position, compare arrival times","tier":"core","tier_why":"On the NeetCode 150.","title":"Car Fleet"},{"difficulty":"medium","hash":"46540de15635bdd4","lc":503,"one_liner":"Run the next-greater stack over 2n steps using nums[i % n]; push indexes only during the first pass.","patterns":["stacks"],"ready":true,"slug":"next-greater-element-ii","source":"leetcode","technique":"Loop 2n with i % n","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Next Greater Element II"},{"difficulty":"medium","hash":"92088930ccd2841e","lc":735,"one_liner":"Stack of survivors; a left-mover fights right-movers on top: smaller explodes, equal both explode.","patterns":["stacks"],"ready":true,"slug":"asteroid-collision","source":"leetcode","technique":"Collide only → vs ←","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Asteroid Collision"},{"difficulty":"medium","hash":"d50b27a80744b328","lc":394,"one_liner":"On \u0026#39;[\u0026#39; push (string so far, count) and start fresh; on \u0026#39;]\u0026#39; pop them and set cur = prev + count · cur.","patterns":["stacks"],"ready":true,"slug":"decode-string","source":"leetcode","technique":"Count stack + string stack","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Decode String"},{"difficulty":"medium","hash":"a7b9043ac2adff9c","lc":1249,"one_liner":"Push the index of each \u0026#39;(\u0026#39;; a \u0026#39;)\u0026#39; pops one or is marked for removal; the indexes left on the stack are removed too.","patterns":["stacks"],"ready":true,"slug":"minimum-remove-to-make-valid-parentheses","source":"leetcode","technique":"Stack of '(' indexes, drop the unmatched","tier":"core","tier_why":"Reported at Meta.","title":"Minimum Remove to Make Valid Parentheses"},{"difficulty":"medium","hash":"40c25cd38dd53744","lc":901,"one_liner":"Keep (price, span) pairs with decreasing prices; a new price absorbs every pair with price ≤ it, adding their spans.","patterns":["stacks","ds-design"],"ready":true,"slug":"online-stock-span","source":"leetcode","technique":"Stack of (price, span)","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Online Stock Span"},{"difficulty":"medium","hash":"e1ba899d5dec0bac","lc":1762,"one_liner":"Left to right, building i pops every waiting building with height ≤ heights[i] (it blocks them); the survivors see the ocean.","patterns":["stacks"],"ready":true,"slug":"buildings-with-an-ocean-view","source":"leetcode","technique":"Decreasing stack; the survivors are the answer","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Buildings With an Ocean View"},{"difficulty":"medium","hash":"23c76019b2b64488","lc":907,"one_liner":"Count, for each j, how many subarrays have arr[j] as their (rightmost) minimum; the bounds come from the pops of an increasing stack.","patterns":["stacks"],"ready":true,"slug":"sum-of-subarray-minimums","source":"leetcode","technique":"Contribution: previous smaller × next smaller-or-equal","tier":"recommended","tier_why":"Builds the pattern (contribution counting on pop); not on the NeetCode 150 and not named by a company source.","title":"Sum of Subarray Minimums"},{"difficulty":"hard","hash":"60d2ca56b009c9ae","lc":84,"one_liner":"Increasing stack of indexes; a lower bar pops taller ones, each popped bar\u0026#39;s width is i − new top − 1.","patterns":["stacks"],"ready":true,"slug":"largest-rectangle-in-histogram","source":"leetcode","technique":"Monotonic increasing stack","tier":"core","tier_why":"On the NeetCode 150.","title":"Largest Rectangle in Histogram"},{"difficulty":"hard","hash":"5b807e9153fe8fa5","lc":85,"one_liner":"Row by row, heights[j] = heights[j] + 1 on a \u0026#39;1\u0026#39; else 0; the answer is the best Largest Rectangle in Histogram.","patterns":["stacks"],"ready":true,"slug":"maximal-rectangle","source":"leetcode","technique":"Histogram per row","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Maximal Rectangle"},{"difficulty":"easy","hash":"483612ff22fdfdf7","lc":704,"one_liner":"Closed range [lo, hi]: compare a[mid] with target, return on a hit, otherwise drop the half that can\u0026#39;t contain it.","patterns":["binary-search"],"ready":true,"slug":"binary-search","source":"leetcode","technique":"mid = l + (r − l) // 2","tier":"core","tier_why":"On the NeetCode 150.","title":"Binary Search"},{"difficulty":"easy","hash":"2ef718287ada4d46","lc":278,"one_liner":"Find the first v in 1..n with isBadVersion(v): first-true binary search, about log₂ n API calls.","patterns":["binary-search"],"ready":true,"slug":"first-bad-version","source":"leetcode","technique":"Lower bound","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"First Bad Version"},{"difficulty":"easy","hash":"bca5d3dcbd62f5cf","lc":35,"one_liner":"Lower bound: the first index with nums[i] ≥ target is both where it is and where it would go.","patterns":["binary-search"],"ready":true,"slug":"search-insert-position","source":"leetcode","technique":"Return l","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Search Insert Position"},{"difficulty":"easy","hash":"928207403fc98119","lc":367,"one_liner":"Binary search k in [1, num] for k · k == num; no sqrt, no floats.","patterns":["binary-search"],"ready":true,"slug":"valid-perfect-square","source":"leetcode","technique":"Search 1..num","tier":"optional","tier_why":"Sqrt(x) with an equality check.","title":"Valid Perfect Square"},{"difficulty":"easy","hash":"5867496657b11eb8","lc":69,"one_liner":"Find the first k with k² \u0026gt; x by binary search over [0, x + 1]; the answer is that k − 1.","patterns":["binary-search"],"ready":true,"slug":"sqrtx","source":"leetcode","technique":"Largest k with k² ≤ x","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Sqrt(x)"},{"difficulty":"easy","hash":"3ee5dcf7968fe6da","lc":744,"one_liner":"Upper bound: the first letter \u0026gt; target; if there is none, wrap around to letters[0].","patterns":["binary-search"],"ready":true,"slug":"find-smallest-letter-greater-than-target","source":"leetcode","technique":"Upper bound, wrap around","tier":"optional","tier_why":"An upper bound, which Find First and Last Position already drills.","title":"Find Smallest Letter Greater Than Target"},{"difficulty":"medium","hash":"1fcb7ac3b00b22ad","lc":74,"one_liner":"The matrix read row by row is one sorted array of m · n values: binary search i and read matrix[i // n][i % n].","patterns":["binary-search"],"ready":true,"slug":"search-a-2d-matrix","source":"leetcode","technique":"Virtual index → (i // n, i % n)","tier":"core","tier_why":"On the NeetCode 150.","title":"Search a 2D Matrix"},{"difficulty":"medium","hash":"2dd4bc6f9546017a","lc":34,"one_liner":"first = lower_bound(target); last = lower_bound(target + 1) − 1; [−1, −1] if first is past the end or not target.","patterns":["binary-search"],"ready":true,"slug":"find-first-and-last-position-of-element-in-sorted-array","source":"leetcode","technique":"Lower and upper bound","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Find First and Last Position of Element in Sorted Array"},{"difficulty":"medium","hash":"81ef533bdbe0a6c4","lc":33,"one_liner":"One side of mid is always sorted; if target is inside that side\u0026#39;s range go there, else go to the other side.","patterns":["binary-search"],"ready":true,"slug":"search-in-rotated-sorted-array","source":"leetcode","technique":"Find the sorted half","tier":"core","tier_why":"On the NeetCode 150.","title":"Search in Rotated Sorted Array"},{"difficulty":"medium","hash":"c924a55e95291899","lc":153,"one_liner":"If nums[mid] \u0026gt; nums[hi], the drop (and the minimum) is right of mid; else it\u0026#39;s at mid or left. Return nums[lo].","patterns":["binary-search"],"ready":true,"slug":"find-minimum-in-rotated-sorted-array","source":"leetcode","technique":"Compare mid with right","tier":"core","tier_why":"On the NeetCode 150.","title":"Find Minimum in Rotated Sorted Array"},{"difficulty":"medium","hash":"78d83c8747efb55b","lc":81,"one_liner":"As in LC 33, but when nums[lo] == nums[mid] == nums[hi] the sorted half is unknown: drop lo and hi by one.","patterns":["binary-search"],"ready":true,"slug":"search-in-rotated-sorted-array-ii","source":"leetcode","technique":"Duplicates: shrink right","tier":"optional","tier_why":"Search in Rotated Sorted Array plus a duplicates edge case.","title":"Search in Rotated Sorted Array II"},{"difficulty":"medium","hash":"23a6cf4d2737d4b1","lc":162,"one_liner":"If nums[mid] \u0026lt; nums[mid + 1] walk uphill to the right (lo = mid + 1); else a peak is at mid or left (hi = mid).","patterns":["binary-search"],"ready":true,"slug":"find-peak-element","source":"leetcode","technique":"Compare mid with mid + 1","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Find Peak Element"},{"difficulty":"medium","hash":"226a7dc1f4899a67","lc":981,"one_liner":"Per key, append (timestamp, value); get finds the last timestamp ≤ t with bisect_right − 1.","patterns":["binary-search","ds-design"],"ready":true,"slug":"time-based-key-value-store","source":"leetcode","technique":"Map of lists + bisect","tier":"core","tier_why":"On the NeetCode 150.","title":"Time Based Key-Value Store"},{"difficulty":"medium","hash":"245af108c1451f73","lc":875,"one_liner":"Binary search speed k in [1, max(piles)]; k works if Σ ceil(p / k) ≤ h; return the first k that works.","patterns":["binary-search"],"ready":true,"slug":"koko-eating-bananas","source":"leetcode","technique":"Search on the answer (speed)","tier":"core","tier_why":"On the NeetCode 150.","title":"Koko Eating Bananas"},{"difficulty":"medium","hash":"5eef1ece9b3d0d40","lc":1011,"one_liner":"Binary search capacity in [max(w), sum(w)]; a greedy pass counts days; return the first capacity that fits in D days.","patterns":["binary-search"],"ready":true,"slug":"capacity-to-ship-packages-within-d-days","source":"leetcode","technique":"Search on the answer (capacity)","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Capacity To Ship Packages Within D Days"},{"difficulty":"medium","hash":"1d2ae09680881627","lc":2300,"one_liner":"Sort potions; for each spell s, potions ≥ ceil(success / s) succeed: m − bisect_left(potions, that).","patterns":["binary-search"],"ready":true,"slug":"successful-pairs-of-spells-and-potions","source":"leetcode","technique":"Sort potions + bisect","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Successful Pairs of Spells and Potions"},{"difficulty":"medium","hash":"a61bd1019cf61de4","lc":658,"one_liner":"Binary search the left edge s of a k-window in [0, n − k]: if x − arr[s] \u0026gt; arr[s + k] − x, slide right.","patterns":["binary-search"],"ready":true,"slug":"find-k-closest-elements","source":"leetcode","technique":"Search the window start","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Find K Closest Elements"},{"difficulty":"medium","hash":"22dd7ec4e865be7f","lc":528,"one_liner":"Prefix sums cut [1, total] into slices of width w[i]; draw r uniformly and binary search the first prefix ≥ r.","patterns":["binary-search"],"ready":true,"slug":"random-pick-with-weight","source":"leetcode","technique":"Prefix sums + random target + lower bound","tier":"core","tier_why":"Reported at Meta.","title":"Random Pick with Weight"},{"difficulty":"hard","hash":"ada272c34f2ed1bf","lc":4,"one_liner":"Binary search how many elements i the left half takes from the shorter array (j = half − i); stop when the borders cross correctly.","patterns":["binary-search"],"ready":true,"slug":"median-of-two-sorted-arrays","source":"leetcode","technique":"Partition both arrays","tier":"core","tier_why":"On the NeetCode 150.","title":"Median of Two Sorted Arrays"},{"difficulty":"hard","hash":"d5c8d6e76dd0cb6a","lc":410,"one_liner":"Binary search the largest allowed sum S in [max, sum]; greedily count pieces with sums ≤ S; S works if pieces ≤ k.","patterns":["binary-search"],"ready":true,"slug":"split-array-largest-sum","source":"leetcode","technique":"Search on the answer (max sum)","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Split Array Largest Sum"},{"difficulty":"hard","hash":"a064d0347ac5b6df","lc":774,"one_liner":"Binary search the max gap D on the reals: stations needed = Σ ⌊gap / D⌋; shrink until hi − lo \u0026lt; 10⁻⁶.","patterns":["binary-search"],"ready":true,"slug":"minimize-max-distance-to-gas-station","source":"leetcode","technique":"Search on a real-valued answer","tier":"optional","tier_why":"Binary search on the answer (Koko, Split Array) over real numbers; premium and rarely asked.","title":"Minimize Max Distance to Gas Station"},{"difficulty":"easy","hash":"989ec1be89e28e70","lc":104,"one_liner":"depth(None) = 0; depth(node) = 1 + max(depth(left), depth(right)).","patterns":["trees"],"ready":true,"slug":"maximum-depth-of-binary-tree","source":"leetcode","technique":"1 + max(L, R)","tier":"core","tier_why":"On the NeetCode 150.","title":"Maximum Depth of Binary Tree"},{"difficulty":"easy","hash":"f6b877b144cca4df","lc":111,"one_liner":"BFS level by level; the first node with no children ends the search: its level is the answer.","patterns":["trees"],"ready":true,"slug":"minimum-depth-of-binary-tree","source":"leetcode","technique":"BFS: first leaf","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Minimum Depth of Binary Tree"},{"difficulty":"easy","hash":"f97e0e4cf5028382","lc":226,"one_liner":"At every node swap left and right, then invert both subtrees (any traversal order works).","patterns":["trees"],"ready":true,"slug":"invert-binary-tree","source":"leetcode","technique":"Swap children","tier":"core","tier_why":"On the NeetCode 150.","title":"Invert Binary Tree"},{"difficulty":"easy","hash":"d40c53de305c1578","lc":100,"one_liner":"same(a, b): both None → True; one None or values differ → False; else same(a.left, b.left) and same(a.right, b.right).","patterns":["trees"],"ready":true,"slug":"same-tree","source":"leetcode","technique":"Compare node by node","tier":"core","tier_why":"On the NeetCode 150.","title":"Same Tree"},{"difficulty":"easy","hash":"4b205f98285cad92","lc":101,"one_liner":"mirror(a, b): both None → True; one None or values differ → False; else mirror(a.left, b.right) and mirror(a.right, b.left).","patterns":["trees"],"ready":true,"slug":"symmetric-tree","source":"leetcode","technique":"Mirror compare L.left vs R.right","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Symmetric Tree"},{"difficulty":"easy","hash":"0558f4f894b8a2ea","lc":112,"one_liner":"Recurse with target − node.val; at a leaf, succeed if what\u0026#39;s left equals the leaf\u0026#39;s value.","patterns":["trees"],"ready":true,"slug":"path-sum","source":"leetcode","technique":"Pass down target − val","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Path Sum"},{"difficulty":"easy","hash":"c79b7df5bb0b8366","lc":543,"one_liner":"A height helper returns 1 + max(L, R) and records best = max(best, L + R): the longest path bending at that node.","patterns":["trees"],"ready":true,"slug":"diameter-of-binary-tree","source":"leetcode","technique":"L + R at each node","tier":"core","tier_why":"On the NeetCode 150.","title":"Diameter of Binary Tree"},{"difficulty":"easy","hash":"c85bb3043e3635cd","lc":110,"one_liner":"A height helper returns −1 as soon as a subtree is unbalanced (or |L − R| \u0026gt; 1); the tree is balanced if the root\u0026#39;s result isn\u0026#39;t −1.","patterns":["trees"],"ready":true,"slug":"balanced-binary-tree","source":"leetcode","technique":"Height with −1 for unbalanced","tier":"core","tier_why":"On the NeetCode 150.","title":"Balanced Binary Tree"},{"difficulty":"easy","hash":"b971a70ab87bd967","lc":572,"one_liner":"Walk root; at every node run Same Tree against subRoot; any match means true.","patterns":["trees"],"ready":true,"slug":"subtree-of-another-tree","source":"leetcode","technique":"Same Tree at every node","tier":"core","tier_why":"On the NeetCode 150.","title":"Subtree of Another Tree"},{"difficulty":"easy","hash":"d86a651814f38eff","lc":938,"one_liner":"Below low? Only the right subtree can help. Above high? Only the left. Inside? Count it and search both.","patterns":["trees"],"ready":true,"slug":"range-sum-of-bst","source":"leetcode","technique":"Prune by range with the BST order","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Range Sum of BST"},{"difficulty":"medium","hash":"5c0116930e5f41c6","lc":102,"one_liner":"BFS; at each round pop exactly len(queue) nodes — that\u0026#39;s one level — and push their children for the next.","patterns":["trees"],"ready":true,"slug":"binary-tree-level-order-traversal","source":"leetcode","technique":"BFS by level size","tier":"core","tier_why":"On the NeetCode 150.","title":"Binary Tree Level Order Traversal"},{"difficulty":"medium","hash":"edb2765084d0cc73","lc":199,"one_liner":"BFS by levels and keep the last node of each level (or DFS right-first, taking the first node seen at each depth).","patterns":["trees"],"ready":true,"slug":"binary-tree-right-side-view","source":"leetcode","technique":"Last node per level","tier":"core","tier_why":"On the NeetCode 150; reported at Meta.","title":"Binary Tree Right Side View"},{"difficulty":"medium","hash":"be6e7d30d0b4eb90","lc":103,"one_liner":"Level-order BFS as usual; the traversal order never changes, only the direction you write each level.","patterns":["trees"],"ready":true,"slug":"binary-tree-zigzag-level-order-traversal","source":"leetcode","technique":"BFS by levels, reverse every second level","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Binary Tree Zigzag Level Order Traversal"},{"difficulty":"medium","hash":"99be5a9f8359a0b8","lc":314,"one_liner":"BFS with (node, column); append each value to its column\u0026#39;s list; output columns from the leftmost to the rightmost.","patterns":["trees"],"ready":true,"slug":"binary-tree-vertical-order-traversal","source":"leetcode","technique":"BFS with a column index","tier":"core","tier_why":"Reported at Meta.","title":"Binary Tree Vertical Order Traversal"},{"difficulty":"medium","hash":"209044f0bd276fdb","lc":1448,"one_liner":"Pass the largest value seen from the root down; a node is good if its value is at least that maximum.","patterns":["trees"],"ready":true,"slug":"count-good-nodes-in-binary-tree","source":"leetcode","technique":"Carry the path maximum down","tier":"core","tier_why":"On the NeetCode 150.","title":"Count Good Nodes in Binary Tree"},{"difficulty":"medium","hash":"3bb310cb931b871f","lc":129,"one_liner":"Carry the number spelled so far down the tree (×10 + digit); every leaf adds its number to the total.","patterns":["trees"],"ready":true,"slug":"sum-root-to-leaf-numbers","source":"leetcode","technique":"number · 10 + digit, add at leaves","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Sum Root to Leaf Numbers"},{"difficulty":"medium","hash":"139302d6c74b67d8","lc":863,"one_liner":"A parent map turns the tree into a graph; BFS from the target for k rounds, each node\u0026#39;s neighbours being left, right and parent.","patterns":["trees"],"ready":true,"slug":"all-nodes-distance-k-in-binary-tree","source":"leetcode","technique":"Parent map, then BFS k rings","tier":"core","tier_why":"Reported at Amazon, Meta.","title":"All Nodes Distance K in Binary Tree"},{"difficulty":"medium","hash":"0edd9b3e41758cfe","lc":230,"one_liner":"Iterative in-order traversal visits values in sorted order; return the k-th node popped.","patterns":["trees"],"ready":true,"slug":"kth-smallest-element-in-a-bst","source":"leetcode","technique":"In-order, stop at k","tier":"core","tier_why":"On the NeetCode 150.","title":"Kth Smallest Element in a BST"},{"difficulty":"medium","hash":"4eed34d50c44c6b8","lc":98,"one_liner":"Each node must lie strictly inside (low, high) inherited from its ancestors; going left lowers high, going right raises low.","patterns":["trees"],"ready":true,"slug":"validate-binary-search-tree","source":"leetcode","technique":"Pass (low, high) bounds","tier":"core","tier_why":"On the NeetCode 150.","title":"Validate Binary Search Tree"},{"difficulty":"medium","hash":"e30b49d70faaf489","lc":235,"one_liner":"From the root: both values smaller → go left; both larger → go right; otherwise this node is where they split.","patterns":["trees"],"ready":true,"slug":"lowest-common-ancestor-of-a-binary-search-tree","source":"leetcode","technique":"Split point by value","tier":"core","tier_why":"On the NeetCode 150.","title":"Lowest Common Ancestor of a BST"},{"difficulty":"medium","hash":"88e2d1e14e6a4209","lc":236,"one_liner":"Each call returns p, q, the LCA, or None for its subtree; the first node where both sides report something is the answer.","patterns":["trees"],"ready":true,"slug":"lowest-common-ancestor-of-a-binary-tree","source":"leetcode","technique":"Post-order: report p, q or the LCA","tier":"core","tier_why":"Reported at Meta.","title":"Lowest Common Ancestor of a Binary Tree"},{"difficulty":"medium","hash":"ee5d2b71be724e15","lc":1650,"one_liner":"a walks up from p, b from q; when one falls off the root it restarts at the other\u0026#39;s start. They meet at the LCA.","patterns":["trees"],"ready":true,"slug":"lowest-common-ancestor-of-a-binary-tree-iii","source":"leetcode","technique":"Two climbers that switch starts","tier":"recommended","tier_why":"Reported at Amazon and Meta, but it reuses the list-intersection trick; Recommended.","title":"Lowest Common Ancestor of a Binary Tree III"},{"difficulty":"medium","hash":"f0b47851cc3d6495","lc":105,"one_liner":"The next preorder value is the root; its inorder index splits the remaining values into left and right subtrees.","patterns":["trees"],"ready":true,"slug":"construct-binary-tree-from-preorder-and-inorder-traversal","source":"leetcode","technique":"pre[0] is root, split inorder","tier":"core","tier_why":"On the NeetCode 150.","title":"Construct Binary Tree from Preorder and Inorder"},{"difficulty":"hard","hash":"054a17790d2fec8d","lc":124,"one_liner":"gain(n) = n.val + max(0, gain(left), gain(right)); at each node best = max(best, n.val + max(0, gL) + max(0, gR)).","patterns":["trees"],"ready":true,"slug":"binary-tree-maximum-path-sum","source":"leetcode","technique":"Post-order gain, clip at 0","tier":"core","tier_why":"On the NeetCode 150.","title":"Binary Tree Maximum Path Sum"},{"difficulty":"hard","hash":"5934eff6d3f10fab","lc":297,"one_liner":"serialize: preorder values with \u0026#39;#\u0026#39; for None, joined by commas; deserialize: read tokens with an iterator in the same order.","patterns":["trees"],"ready":true,"slug":"serialize-and-deserialize-binary-tree","source":"leetcode","technique":"Preorder with null markers","tier":"core","tier_why":"On the NeetCode 150.","title":"Serialize and Deserialize Binary Tree"},{"difficulty":"medium","hash":"69e0d075fcf1cb1c","lc":208,"one_liner":"Each node maps characters to children and marks word ends; insert creates the path, search needs the end mark, startsWith only the path.","patterns":["tries","ds-design"],"ready":true,"slug":"implement-trie-prefix-tree","source":"leetcode","technique":"children + isEnd","tier":"core","tier_why":"On the NeetCode 150.","title":"Implement Trie (Prefix Tree)"},{"difficulty":"medium","hash":"ad9f150568735e5c","lc":211,"one_liner":"A trie; search is a DFS where a letter follows one child and \u0026#39;.\u0026#39; tries every child; succeed at an end-marked node.","patterns":["tries"],"ready":true,"slug":"design-add-and-search-words-data-structure","source":"leetcode","technique":"DFS on '.'","tier":"core","tier_why":"On the NeetCode 150.","title":"Design Add and Search Words Data Structure"},{"difficulty":"medium","hash":"47fbdd7d642edb75","lc":1268,"one_liner":"Insert the products in sorted order and let each node keep the first three words that pass through it; typing walks one node per letter.","patterns":["tries"],"ready":true,"slug":"search-suggestions-system","source":"leetcode","technique":"Sorted insert, top three per node","tier":"recommended","tier_why":"Named in an older community copy of Amazon's list; not on the NeetCode 150.","title":"Search Suggestions System"},{"difficulty":"hard","hash":"6cb9cfd7dec2b9e0","lc":212,"one_liner":"Build a trie of the words; DFS from every cell carrying the trie node; stop when the letter has no child; collect end-marked words.","patterns":["tries"],"ready":true,"slug":"word-search-ii","source":"leetcode","technique":"Trie + grid backtracking","tier":"core","tier_why":"On the NeetCode 150.","title":"Word Search II"},{"difficulty":"easy","hash":"04b1c831e076e72b","lc":1046,"one_liner":"Max-heap of weights: pop the two heaviest, push back their difference if it isn\u0026#39;t zero; return what\u0026#39;s left (or 0).","patterns":["heaps"],"ready":true,"slug":"last-stone-weight","source":"leetcode","technique":"Max-heap simulation","tier":"core","tier_why":"On the NeetCode 150.","title":"Last Stone Weight"},{"difficulty":"easy","hash":"f9544f52e9b3bd67","lc":703,"one_liner":"Keep a min-heap of the k largest values seen; add pushes and pops back to size k; the root is the answer.","patterns":["heaps"],"ready":true,"slug":"kth-largest-element-in-a-stream","source":"leetcode","technique":"Min-heap of size k","tier":"core","tier_why":"On the NeetCode 150.","title":"Kth Largest Element in a Stream"},{"difficulty":"medium","hash":"f95a000639a335e1","lc":973,"one_liner":"Keep a max-heap (by distance) of the k closest points so far; a closer point replaces the farthest at the root.","patterns":["heaps"],"ready":true,"slug":"k-closest-points-to-origin","source":"leetcode","technique":"Max-heap of size k","tier":"core","tier_why":"On the NeetCode 150.","title":"K Closest Points to Origin"},{"difficulty":"medium","hash":"266ac65f8cd99b26","lc":215,"one_liner":"Keep the k largest values seen in a min-heap; its root is the k-th largest. Quickselect beats it on average.","patterns":["heaps"],"ready":true,"slug":"kth-largest-element-in-an-array","source":"leetcode","technique":"Size-k min-heap, or quickselect","tier":"core","tier_why":"On the NeetCode 150; reported at Meta.","title":"Kth Largest Element in an Array"},{"difficulty":"medium","hash":"4b25b0e2bf7cbebe","lc":692,"one_liner":"Count with a Counter, heapify the pairs (−count, word) in O(d) and pop k times; tuple order breaks ties alphabetically.","patterns":["heaps"],"ready":true,"slug":"top-k-frequent-words","source":"leetcode","technique":"Count, heapify (−count, word), pop k","tier":"recommended","tier_why":"Named in an older community copy of Amazon's list; not on the NeetCode 150.","title":"Top K Frequent Words"},{"difficulty":"medium","hash":"05240f958fda3fd0","lc":621,"one_liner":"The most frequent task sets the frame: answer = max(len(tasks), (maxCount − 1) · (n + 1) + number of tasks with maxCount).","patterns":["heaps","greedy"],"ready":true,"slug":"task-scheduler","source":"leetcode","technique":"Count math or max-heap","tier":"core","tier_why":"On the NeetCode 150.","title":"Task Scheduler"},{"difficulty":"medium","hash":"8784f890360750a8","lc":767,"one_liner":"Pop the most frequent letter other than the one just placed, append it, and push the previous letter back; impossible iff some count \u0026gt; ⌈n/2⌉.","patterns":["heaps"],"ready":true,"slug":"reorganize-string","source":"leetcode","technique":"Max-heap by count, hold out one turn","tier":"recommended","tier_why":"Named in an older community copy of Amazon's list; not on the NeetCode 150.","title":"Reorganize String"},{"difficulty":"medium","hash":"7f63f6e19839b0d5","lc":355,"one_liner":"Per user, a list of (time, tweetId); getNewsFeed merges the self + followees lists newest-first with a heap, stopping after 10.","patterns":["heaps","ds-design"],"ready":true,"slug":"design-twitter","source":"leetcode","technique":"Merge k sorted feeds","tier":"core","tier_why":"On the NeetCode 150.","title":"Design Twitter"},{"difficulty":"hard","hash":"6d36c96b87b9b49d","lc":295,"one_liner":"A max-heap holds the lower half, a min-heap the upper half, sizes within one; the median is at their tops.","patterns":["heaps","ds-design"],"ready":true,"slug":"find-median-from-data-stream","source":"leetcode","technique":"Two heaps","tier":"core","tier_why":"On the NeetCode 150.","title":"Find Median from Data Stream"},{"difficulty":"medium","hash":"49e1b24f7866dccb","lc":78,"one_liner":"Record the current path at every node; extend it with each later element (start index), then pop.","patterns":["backtracking"],"ready":true,"slug":"subsets","source":"leetcode","technique":"Include / exclude","tier":"core","tier_why":"On the NeetCode 150.","title":"Subsets"},{"difficulty":"medium","hash":"c88bcae199130064","lc":39,"one_liner":"Sort; backtrack(start, remaining): for i ≥ start, stop when candidates[i] \u0026gt; remaining, else take it and recurse on i (reuse).","patterns":["backtracking"],"ready":true,"slug":"combination-sum","source":"leetcode","technique":"Reuse allowed: recurse on i","tier":"core","tier_why":"On the NeetCode 150.","title":"Combination Sum"},{"difficulty":"medium","hash":"32ea95fefade6e34","lc":46,"one_liner":"Each level picks any element not used yet; mark it, recurse, unmark; record when the path has n elements.","patterns":["backtracking"],"ready":true,"slug":"permutations","source":"leetcode","technique":"Used set or swap","tier":"core","tier_why":"On the NeetCode 150.","title":"Permutations"},{"difficulty":"medium","hash":"1ce8ef6f4969df68","lc":90,"one_liner":"Sort; in the start-index loop skip nums[i] when i \u0026gt; start and it equals nums[i − 1]: only the first equal sibling branches.","patterns":["backtracking"],"ready":true,"slug":"subsets-ii","source":"leetcode","technique":"Sort + skip duplicates","tier":"core","tier_why":"On the NeetCode 150.","title":"Subsets II"},{"difficulty":"medium","hash":"73e646508f6ea91c","lc":40,"one_liner":"Sort; recurse with i + 1 (each candidate once), skip equal siblings, and break when a candidate exceeds the remainder.","patterns":["backtracking"],"ready":true,"slug":"combination-sum-ii","source":"leetcode","technique":"Sort + skip + use once","tier":"core","tier_why":"On the NeetCode 150.","title":"Combination Sum II"},{"difficulty":"medium","hash":"1c864ba3f47b9a0f","lc":79,"one_liner":"DFS from every cell matching word[0]; mark the cell while it\u0026#39;s on the path, try 4 neighbours for word[i + 1], unmark on return.","patterns":["backtracking"],"ready":true,"slug":"word-search","source":"leetcode","technique":"Grid DFS + mark visited","tier":"core","tier_why":"On the NeetCode 150.","title":"Word Search"},{"difficulty":"medium","hash":"7af8e962bb27bbf5","lc":131,"one_liner":"From index start, try every end where s[start:end] is a palindrome; append it, recurse from end, pop.","patterns":["backtracking"],"ready":true,"slug":"palindrome-partitioning","source":"leetcode","technique":"Palindrome prefix + recurse","tier":"core","tier_why":"On the NeetCode 150.","title":"Palindrome Partitioning"},{"difficulty":"medium","hash":"b9af8605a4d858ff","lc":17,"one_liner":"One recursion level per digit: append each of its letters, recurse to the next digit, pop; record full-length strings.","patterns":["backtracking"],"ready":true,"slug":"letter-combinations-of-a-phone-number","source":"leetcode","technique":"Digit → letters DFS","tier":"core","tier_why":"On the NeetCode 150.","title":"Letter Combinations of a Phone Number"},{"difficulty":"medium","hash":"43052a3525f0d2cc","lc":22,"one_liner":"Grow the string one bracket at a time; add \u0026#39;(\u0026#39; if some are left, \u0026#39;)\u0026#39; only if it closes an open one; record at length 2n.","patterns":["backtracking"],"ready":true,"slug":"generate-parentheses","source":"leetcode","technique":"'(' while open \u003c n, ')' while close \u003c open","tier":"core","tier_why":"On the NeetCode 150.","title":"Generate Parentheses"},{"difficulty":"hard","hash":"58206bef2f718165","lc":51,"one_liner":"Place one queen per row; a column c is allowed if c, r − c and r + c are all unused; mark them, recurse, unmark.","patterns":["backtracking"],"ready":true,"slug":"n-queens","source":"leetcode","technique":"Track cols and both diagonals","tier":"core","tier_why":"On the NeetCode 150.","title":"N-Queens"},{"difficulty":"medium","hash":"ec2401a5af925ed5","lc":200,"one_liner":"Scan every cell; each unvisited \u0026#39;1\u0026#39; starts a new island, which a DFS/BFS sinks (\u0026#39;1\u0026#39; → \u0026#39;0\u0026#39;) so it\u0026#39;s counted once.","patterns":["graphs"],"ready":true,"slug":"number-of-islands","source":"leetcode","technique":"Grid DFS sink","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon, Google.","title":"Number of Islands"},{"difficulty":"medium","hash":"c0b15916e3effa19","lc":695,"one_liner":"Flood fill each unvisited island and count its cells; keep the largest count.","patterns":["graphs"],"ready":true,"slug":"max-area-of-island","source":"leetcode","technique":"DFS returns size","tier":"core","tier_why":"On the NeetCode 150.","title":"Max Area of Island"},{"difficulty":"medium","hash":"fa77aec2dbf64a41","lc":130,"one_liner":"Flood fill from every border \u0026#39;O\u0026#39; marking it safe; then flip remaining \u0026#39;O\u0026#39; to \u0026#39;X\u0026#39; and restore the safe cells.","patterns":["graphs"],"ready":true,"slug":"surrounded-regions","source":"leetcode","technique":"Save border-connected cells","tier":"core","tier_why":"On the NeetCode 150.","title":"Surrounded Regions"},{"difficulty":"medium","hash":"00ab80ea5583c3e2","lc":994,"one_liner":"Put every rotten orange in the queue at minute 0; BFS layer by layer rots fresh neighbours; answer the last layer, or −1 if fresh ones remain.","patterns":["graphs"],"ready":true,"slug":"rotting-oranges","source":"leetcode","technique":"Multi-source BFS","tier":"core","tier_why":"On the NeetCode 150.","title":"Rotting Oranges"},{"difficulty":"medium","hash":"efded60b2e8ed493","lc":286,"one_liner":"Queue all gates, BFS outward; an empty room gets parent + 1 the first time it\u0026#39;s reached and is never touched again.","patterns":["graphs"],"ready":true,"slug":"walls-and-gates","source":"leetcode","technique":"Multi-source BFS from every gate","tier":"core","tier_why":"On the NeetCode 150.","title":"Walls and Gates"},{"difficulty":"medium","hash":"6ee1664e70d6be52","lc":417,"one_liner":"Flood uphill (to neighbours ≥ current) from the Pacific edges and from the Atlantic edges; return cells reached by both.","patterns":["graphs"],"ready":true,"slug":"pacific-atlantic-water-flow","source":"leetcode","technique":"DFS inward from both oceans","tier":"core","tier_why":"On the NeetCode 150.","title":"Pacific Atlantic Water Flow"},{"difficulty":"medium","hash":"6077b5420a4ac89b","lc":2101,"one_liner":"Draw an edge i → j when bomb j is within bomb i\u0026#39;s radius (one-way!), then DFS from every bomb and keep the largest reach.","patterns":["graphs"],"ready":true,"slug":"detonate-the-maximum-bombs","source":"leetcode","technique":"Directed reach graph, DFS from every bomb","tier":"recommended","tier_why":"Named in a community copy of Google's list; not on the NeetCode 150.","title":"Detonate the Maximum Bombs"},{"difficulty":"medium","hash":"ce95cc2b8d46d4f9","lc":133,"one_liner":"DFS/BFS with a dict old → copy; create a node\u0026#39;s copy before visiting its neighbours, so cycles find the existing copy.","patterns":["graphs"],"ready":true,"slug":"clone-graph","source":"leetcode","technique":"Map old → clone","tier":"core","tier_why":"On the NeetCode 150; reported at Meta.","title":"Clone Graph"},{"difficulty":"medium","hash":"0462f7344c64ef33","lc":207,"one_liner":"Kahn\u0026#39;s algorithm: repeatedly take courses with no unmet prerequisites; all courses are finishable iff every course gets taken.","patterns":["graphs"],"ready":true,"slug":"course-schedule","source":"leetcode","technique":"Topological sort / cycle check","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon, Google.","title":"Course Schedule"},{"difficulty":"medium","hash":"7bd84a424d7af691","lc":210,"one_liner":"Kahn\u0026#39;s algorithm, recording the order in which courses become available; return [] if not every course was taken.","patterns":["graphs"],"ready":true,"slug":"course-schedule-ii","source":"leetcode","technique":"Kahn's order","tier":"core","tier_why":"On the NeetCode 150.","title":"Course Schedule II"},{"difficulty":"medium","hash":"7c4b2f8281de4e7b","lc":261,"one_liner":"A tree has exactly n − 1 edges and no cycle: check the count, then union every edge and fail if its ends already share a root.","patterns":["graphs"],"ready":true,"slug":"graph-valid-tree","source":"leetcode","technique":"n − 1 edges + no cycle","tier":"core","tier_why":"On the NeetCode 150.","title":"Graph Valid Tree"},{"difficulty":"medium","hash":"0269ca0f5402dc26","lc":323,"one_liner":"Start with n components; every union that merges two different sets lowers the count by one.","patterns":["graphs"],"ready":true,"slug":"number-of-connected-components-in-an-undirected-graph","source":"leetcode","technique":"Union-find count","tier":"core","tier_why":"On the NeetCode 150.","title":"Number of Connected Components in an Undirected Graph"},{"difficulty":"medium","hash":"2c646b86fe4e7753","lc":547,"one_liner":"Every unvisited city starts a new province; a DFS from it marks every city it can reach through the matrix.","patterns":["graphs"],"ready":true,"slug":"number-of-provinces","source":"leetcode","technique":"Count DFS starts over the matrix","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Number of Provinces"},{"difficulty":"medium","hash":"e12dc463fd36d9cf","lc":684,"one_liner":"Union the edges in order; the first edge whose endpoints already share a root closes the cycle — return it.","patterns":["graphs"],"ready":true,"slug":"redundant-connection","source":"leetcode","technique":"First edge joining a set to itself","tier":"core","tier_why":"On the NeetCode 150.","title":"Redundant Connection"},{"difficulty":"medium","hash":"d52d7b5c9991bc1d","lc":721,"one_liner":"Union every email of an account with that account\u0026#39;s first email; group emails by root; prepend the name and sort.","patterns":["graphs"],"ready":true,"slug":"accounts-merge","source":"leetcode","technique":"Union-find on emails","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Accounts Merge"},{"difficulty":"medium","hash":"e70e2e0657e095a8","lc":743,"one_liner":"Dijkstra from k with a min-heap; the answer is the largest shortest distance, or −1 if some node is unreachable.","patterns":["graphs","advanced-graphs"],"ready":true,"slug":"network-delay-time","source":"leetcode","technique":"Dijkstra","tier":"core","tier_why":"On the NeetCode 150.","title":"Network Delay Time"},{"difficulty":"medium","hash":"79c8a74fdd819387","lc":787,"one_liner":"Run k + 1 rounds of relaxing every flight from a copy of the previous round\u0026#39;s prices; read the price of dst.","patterns":["graphs","advanced-graphs"],"ready":true,"slug":"cheapest-flights-within-k-stops","source":"leetcode","technique":"Bellman-Ford k+1 rounds","tier":"core","tier_why":"On the NeetCode 150.","title":"Cheapest Flights Within K Stops"},{"difficulty":"medium","hash":"1d1b41484faaed14","lc":1091,"one_liner":"BFS from the top-left over open cells in 8 directions; the layer at which the bottom-right is reached is the path length.","patterns":["graphs"],"ready":true,"slug":"shortest-path-in-binary-matrix","source":"leetcode","technique":"8-direction BFS","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Shortest Path in Binary Matrix"},{"difficulty":"medium","hash":"1800bb92478c0f41","lc":1197,"one_liner":"BFS from (0, 0) toward (|x|, |y|), keeping the search inside a slightly enlarged first quadrant; the BFS layer is the move count.","patterns":["graphs"],"ready":true,"slug":"minimum-knight-moves","source":"leetcode","technique":"BFS on the board","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Minimum Knight Moves"},{"difficulty":"hard","hash":"f45a2de46fa0538c","lc":127,"one_liner":"BFS from beginWord; neighbours are list words differing in one letter, found through wildcard buckets like h*t; return the layer of endWord.","patterns":["graphs"],"ready":true,"slug":"word-ladder","source":"leetcode","technique":"BFS over one-letter edits","tier":"core","tier_why":"On the NeetCode 150; reported at Google.","title":"Word Ladder"},{"difficulty":"hard","hash":"db120515b69e4685","lc":269,"one_liner":"Compare adjacent words: the first differing letters give an edge a → b; topologically sort all letters (Kahn); a cycle or a word before its prefix → \u0026#34;\u0026#34;.","patterns":["graphs"],"ready":true,"slug":"alien-dictionary","source":"leetcode","technique":"Build edges, topological sort","tier":"core","tier_why":"On the NeetCode 150.","title":"Alien Dictionary"},{"difficulty":"easy","hash":"3d46fb1079617440","lc":70,"one_liner":"ways(n) = ways(n − 1) + ways(n − 2): the last move was 1 step or 2 steps; keep two rolling values.","patterns":["dp-1d"],"ready":true,"slug":"climbing-stairs","source":"leetcode","technique":"Fibonacci","tier":"core","tier_why":"On the NeetCode 150.","title":"Climbing Stairs"},{"difficulty":"easy","hash":"5cb806cf9fb44ad7","lc":746,"one_liner":"dp[i] = cost[i] + min(dp[i − 1], dp[i − 2]); the top is past the last step, so answer min(dp[n − 1], dp[n − 2]).","patterns":["dp-1d"],"ready":true,"slug":"min-cost-climbing-stairs","source":"leetcode","technique":"min of the two previous","tier":"core","tier_why":"On the NeetCode 150.","title":"Min Cost Climbing Stairs"},{"difficulty":"medium","hash":"df0833dbcc19bed9","lc":198,"one_liner":"dp[i] = max(dp[i − 1], dp[i − 2] + nums[i − 1]): skip house i, or rob it on top of the best two houses back.","patterns":["dp-1d"],"ready":true,"slug":"house-robber","source":"leetcode","technique":"max(rob, skip)","tier":"core","tier_why":"On the NeetCode 150.","title":"House Robber"},{"difficulty":"medium","hash":"02f274ee436f3765","lc":213,"one_liner":"The first and last houses are adjacent, so solve the line problem without the first and without the last; take the max.","patterns":["dp-1d"],"ready":true,"slug":"house-robber-ii","source":"leetcode","technique":"Two runs: drop first or last","tier":"core","tier_why":"On the NeetCode 150.","title":"House Robber II"},{"difficulty":"medium","hash":"1d2c7f7cf3f56c82","lc":91,"one_liner":"dp[i] = (dp[i − 1] if s[i − 1] != \u0026#39;0\u0026#39;) + (dp[i − 2] if 10 ≤ s[i − 2:i] ≤ 26), with dp[0] = 1.","patterns":["dp-1d"],"ready":true,"slug":"decode-ways","source":"leetcode","technique":"1-digit and 2-digit checks","tier":"core","tier_why":"On the NeetCode 150.","title":"Decode Ways"},{"difficulty":"medium","hash":"fc9f8c46a4c96ce8","lc":322,"one_liner":"dp[a] = 1 + min(dp[a − c]) over coins c ≤ a, dp[0] = 0, unreachable = ∞; answer dp[amount] or −1.","patterns":["dp-1d"],"ready":true,"slug":"coin-change","source":"leetcode","technique":"Unbounded knapsack (min)","tier":"core","tier_why":"On the NeetCode 150.","title":"Coin Change"},{"difficulty":"medium","hash":"b4e3f6e73ae0f232","lc":377,"one_liner":"dp[t] = Σ dp[t − x] over nums x ≤ t, dp[0] = 1: the last number of an ordered sequence can be any x.","patterns":["dp-1d"],"ready":true,"slug":"combination-sum-iv","source":"leetcode","technique":"Ordered ways to reach target","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Combination Sum IV"},{"difficulty":"medium","hash":"571a4a5cfd0368cc","lc":139,"one_liner":"dp[i] = True if some dp[j] is True and s[j:i] is a dictionary word; dp[0] = True; return dp[n].","patterns":["dp-1d"],"ready":true,"slug":"word-break","source":"leetcode","technique":"Can a word end at i?","tier":"core","tier_why":"On the NeetCode 150.","title":"Word Break"},{"difficulty":"medium","hash":"53514bf1a3929fda","lc":300,"one_liner":"Keep tails[k] = smallest tail of an increasing subsequence of length k + 1; each x replaces the first tail ≥ x (bisect_left) or extends.","patterns":["dp-1d"],"ready":true,"slug":"longest-increasing-subsequence","source":"leetcode","technique":"Patience sorting + bisect","tier":"core","tier_why":"On the NeetCode 150.","title":"Longest Increasing Subsequence"},{"difficulty":"medium","hash":"f61d5055a5eefeca","lc":416,"one_liner":"Odd total → False; else subset sum to total/2: for each x, for s from half down to x, ok[s] |= ok[s − x].","patterns":["dp-1d"],"ready":true,"slug":"partition-equal-subset-sum","source":"leetcode","technique":"0/1 knapsack to sum/2","tier":"core","tier_why":"On the NeetCode 150.","title":"Partition Equal Subset Sum"},{"difficulty":"medium","hash":"997742b150021971","lc":5,"one_liner":"For each of the 2n − 1 centers (a character or a gap), expand while the ends match; keep the longest.","patterns":["dp-1d"],"ready":true,"slug":"longest-palindromic-substring","source":"leetcode","technique":"Expand around center","tier":"core","tier_why":"On the NeetCode 150.","title":"Longest Palindromic Substring"},{"difficulty":"medium","hash":"0c259ae0c7ee0de9","lc":647,"one_liner":"Expand around each of the 2n − 1 centers; every successful expansion step is one more palindromic substring.","patterns":["dp-1d"],"ready":true,"slug":"palindromic-substrings","source":"leetcode","technique":"Count expansions","tier":"core","tier_why":"On the NeetCode 150.","title":"Palindromic Substrings"},{"difficulty":"medium","hash":"1d57280506f91835","lc":152,"one_liner":"Keep the largest and smallest product ending at i: hi, lo = max(x, x·hi, x·lo), min(x, x·hi, x·lo); answer the best hi.","patterns":["dp-1d"],"ready":true,"slug":"maximum-product-subarray","source":"leetcode","technique":"Track max and min","tier":"core","tier_why":"On the NeetCode 150.","title":"Maximum Product Subarray"},{"difficulty":"medium","hash":"2f5f5b5639e60850","lc":62,"one_liner":"dp[r][c] = dp[r − 1][c] + dp[r][c − 1] with the first row and column all 1; one rolling row is enough.","patterns":["dp-2d"],"ready":true,"slug":"unique-paths","source":"leetcode","technique":"top + left","tier":"core","tier_why":"On the NeetCode 150.","title":"Unique Paths"},{"difficulty":"medium","hash":"7d99268913657875","lc":63,"one_liner":"Same top + left recurrence, but an obstacle cell has 0 paths (and so blocks everything that only goes through it).","patterns":["dp-2d"],"ready":true,"slug":"unique-paths-ii","source":"leetcode","technique":"top + left, obstacles = 0","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Unique Paths II"},{"difficulty":"medium","hash":"ff588c08f2ec46a9","lc":1143,"one_liner":"dp[i][j] over prefixes: equal last characters → dp[i − 1][j − 1] + 1; otherwise max(dp[i − 1][j], dp[i][j − 1]).","patterns":["dp-2d"],"ready":true,"slug":"longest-common-subsequence","source":"leetcode","technique":"Match: diag + 1, else max","tier":"core","tier_why":"On the NeetCode 150.","title":"Longest Common Subsequence"},{"difficulty":"medium","hash":"0fa6fa4bf6cd5f87","lc":72,"one_liner":"dp[i][j] = dp[i − 1][j − 1] if the last characters match, else 1 + min(replace = diag, delete = up, insert = left).","patterns":["dp-2d"],"ready":true,"slug":"edit-distance","source":"leetcode","technique":"1 + min(insert, delete, replace)","tier":"core","tier_why":"On the NeetCode 150.","title":"Edit Distance"},{"difficulty":"medium","hash":"b8f6457b1ebd5de6","lc":309,"one_liner":"Three states per day — hold, sold today, rest — each the best profit ending in that state; a sale forces one rest day.","patterns":["dp-2d"],"ready":true,"slug":"best-time-to-buy-and-sell-stock-with-cooldown","source":"leetcode","technique":"State machine","tier":"core","tier_why":"On the NeetCode 150.","title":"Best Time to Buy and Sell Stock with Cooldown"},{"difficulty":"medium","hash":"cd87b21e1c89fb3d","lc":518,"one_liner":"ways[a] += ways[a − coin], with coins in the outer loop so each combination is counted once, in coin order.","patterns":["dp-2d"],"ready":true,"slug":"coin-change-ii","source":"leetcode","technique":"Coins outer loop = combinations","tier":"core","tier_why":"On the NeetCode 150.","title":"Coin Change II"},{"difficulty":"medium","hash":"9cebca185b8804db","lc":494,"one_liner":"Choosing the + set P means P − (S − P) = target, so count subsets summing to (S + target) / 2 with a 0/1 knapsack.","patterns":["dp-2d"],"ready":true,"slug":"target-sum","source":"leetcode","technique":"Subset sum to (S + target) / 2","tier":"core","tier_why":"On the NeetCode 150.","title":"Target Sum"},{"difficulty":"medium","hash":"d59f6fe67c2b95c8","lc":97,"one_liner":"dp[i][j]: can s3[:i + j] be built from s1[:i] and s2[:j]? True if the top cell is True and s1[i − 1] fits, or the left cell is True and s2[j − 1] fits.","patterns":["dp-2d"],"ready":true,"slug":"interleaving-string","source":"leetcode","technique":"dp[i][j] from top or left","tier":"core","tier_why":"On the NeetCode 150.","title":"Interleaving String"},{"difficulty":"hard","hash":"c3b4ae0a1e254cde","lc":329,"one_liner":"longest(cell) = 1 + max longest(larger neighbour). Strictly increasing edges can\u0026#39;t cycle, so memoize — or peel the grid from its peaks without recursion.","patterns":["dp-2d"],"ready":true,"slug":"longest-increasing-path-in-a-matrix","source":"leetcode","technique":"DFS + memo","tier":"core","tier_why":"On the NeetCode 150.","title":"Longest Increasing Path in a Matrix"},{"difficulty":"hard","hash":"d381ca5ace1923c2","lc":115,"one_liner":"dp[i][j] = ways to pick t[:j] from s[:i]: skip s[i − 1] (dp[i − 1][j]) plus, if it equals t[j − 1], use it (dp[i − 1][j − 1]).","patterns":["dp-2d"],"ready":true,"slug":"distinct-subsequences","source":"leetcode","technique":"Ways to form t from s","tier":"recommended","tier_why":"A NeetCode 150 Hard built on a narrow trick; no company source in the research names it.","title":"Distinct Subsequences"},{"difficulty":"hard","hash":"2339b3d815e5740a","lc":312,"one_liner":"Pad with 1s; dp[l][r] (open interval) = max over k of dp[l][k] + v[l]·v[k]·v[r] + dp[k][r], where k is the last balloon burst between the walls l and r.","patterns":["dp-2d"],"ready":true,"slug":"burst-balloons","source":"leetcode","technique":"Last balloon in interval","tier":"recommended","tier_why":"A NeetCode 150 Hard built on a narrow trick; no company source in the research names it.","title":"Burst Balloons"},{"difficulty":"hard","hash":"d9b7fd329a9737de","lc":10,"one_liner":"dp[i][j] = s[:i] matches p[:j]. For x*: skip it (dp[i][j − 2]) or, if s[i − 1] matches x, eat one more (dp[i − 1][j]). Otherwise match one character diagonally.","patterns":["dp-2d"],"ready":true,"slug":"regular-expression-matching","source":"leetcode","technique":"'*' = zero or more of previous","tier":"recommended","tier_why":"A NeetCode 150 Hard built on a narrow trick; no company source in the research names it.","title":"Regular Expression Matching"},{"difficulty":"easy","hash":"c57ac10e26f5d743","lc":252,"one_liner":"Sort by start; if any meeting starts before the previous one ends, there\u0026#39;s a conflict. Only neighbours need checking.","patterns":["intervals"],"ready":true,"slug":"meeting-rooms","source":"leetcode","technique":"Sort + check neighbors","tier":"core","tier_why":"On the NeetCode 150.","title":"Meeting Rooms"},{"difficulty":"medium","hash":"c18e71f79b56ce48","lc":986,"one_liner":"Compare the current interval of each list; record [max(starts), min(ends)] if it\u0026#39;s non-empty, then drop the one that ends first.","patterns":["intervals"],"ready":true,"slug":"interval-list-intersections","source":"leetcode","technique":"Two pointers, drop the one that ends first","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Interval List Intersections"},{"difficulty":"medium","hash":"92d4c8d8c84abb75","lc":435,"one_liner":"Keep the interval that ends first, drop everything that overlaps it, repeat; removals = n − kept.","patterns":["intervals","greedy"],"ready":true,"slug":"non-overlapping-intervals","source":"leetcode","technique":"Greedy: sort by end","tier":"core","tier_why":"On the NeetCode 150.","title":"Non-overlapping Intervals"},{"difficulty":"medium","hash":"154e8a559579d35b","lc":253,"one_liner":"Process meetings by start; a min-heap holds each room\u0026#39;s end time — reuse the room that frees up first if it\u0026#39;s free, else open a new one.","patterns":["intervals"],"ready":true,"slug":"meeting-rooms-ii","source":"leetcode","technique":"Min-heap of end times or sweep","tier":"core","tier_why":"On the NeetCode 150.","title":"Meeting Rooms II"},{"difficulty":"hard","hash":"e4f3e8168d0cc785","lc":1851,"one_liner":"Answer queries in increasing order; push every interval that has started into a min-heap by size, discard tops that already ended, read the top.","patterns":["intervals"],"ready":true,"slug":"minimum-interval-to-include-each-query","source":"leetcode","technique":"Sorted queries + heap of (size, end)","tier":"recommended","tier_why":"On the NeetCode 150, but a hard offline sweep that no company source names; Recommended.","title":"Minimum Interval to Include Each Query"},{"difficulty":"easy","hash":"595a01e6bfe8bccd","lc":136,"one_liner":"x ^ x = 0 and x ^ 0 = x, and XOR is order-free: XOR all numbers and the pairs cancel, leaving the single one.","patterns":["bit-manipulation"],"ready":true,"slug":"single-number","source":"leetcode","technique":"XOR everything","tier":"core","tier_why":"On the NeetCode 150.","title":"Single Number"},{"difficulty":"easy","hash":"3a1bec7d893e566a","lc":191,"one_liner":"n \u0026amp; (n − 1) clears the lowest set bit; count how many times you can do it before n is 0.","patterns":["bit-manipulation"],"ready":true,"slug":"number-of-1-bits","source":"leetcode","technique":"n \u0026= n − 1","tier":"core","tier_why":"On the NeetCode 150.","title":"Number of 1 Bits"},{"difficulty":"easy","hash":"6f3001c33ec05dbf","lc":338,"one_liner":"i \u0026gt;\u0026gt; 1 drops the last bit of i, and that smaller number is already counted: bits[i] = bits[i \u0026gt;\u0026gt; 1] + (i \u0026amp; 1).","patterns":["bit-manipulation"],"ready":true,"slug":"counting-bits","source":"leetcode","technique":"bits[i] = bits[i \u003e\u003e 1] + (i \u0026 1)","tier":"core","tier_why":"On the NeetCode 150.","title":"Counting Bits"},{"difficulty":"easy","hash":"cff6b493da494b0a","lc":268,"one_liner":"XOR every index 0..n with every value: each present number meets its twin and cancels, leaving the missing one.","patterns":["bit-manipulation"],"ready":true,"slug":"missing-number","source":"leetcode","technique":"XOR indexes with values","tier":"core","tier_why":"On the NeetCode 150.","title":"Missing Number"},{"difficulty":"easy","hash":"986fe553321d7a58","lc":190,"one_liner":"32 times: shift the result left, OR in n\u0026#39;s lowest bit, shift n right. The bit that leaves n first ends up highest.","patterns":["bit-manipulation"],"ready":true,"slug":"reverse-bits","source":"leetcode","technique":"Shift out, shift in","tier":"core","tier_why":"On the NeetCode 150.","title":"Reverse Bits"},{"difficulty":"medium","hash":"d6486a4ba56deaac","lc":371,"one_liner":"a ^ b adds without carries, (a \u0026amp; b) \u0026lt;\u0026lt; 1 is the carries; repeat until no carry. In Python, mask to 32 bits and convert back.","patterns":["bit-manipulation"],"ready":true,"slug":"sum-of-two-integers","source":"leetcode","technique":"XOR = sum, AND \u003c\u003c 1 = carry","tier":"core","tier_why":"On the NeetCode 150.","title":"Sum of Two Integers"},{"difficulty":"medium","hash":"77b255742e167a9d","lc":7,"one_liner":"Pop the last digit with % 10 and push it onto the result with × 10 + d — but check before pushing that the result stays within 32 bits.","patterns":["bit-manipulation"],"ready":true,"slug":"reverse-integer","source":"leetcode","technique":"Pop digits, check overflow","tier":"core","tier_why":"On the NeetCode 150.","title":"Reverse Integer"},{"difficulty":"easy","hash":"2d6aa0a0f8c1f0f9","lc":1710,"one_liner":"Sort box types by units per box, descending; take min(boxes, room) of each until the truck is full.","patterns":["greedy"],"ready":true,"slug":"maximum-units-on-a-truck","source":"leetcode","technique":"Sort by units, take the best first","tier":"recommended","tier_why":"The online-assessment \"sort and take the biggest\" shape; not on the NeetCode 150.","title":"Maximum Units on a Truck"},{"difficulty":"medium","hash":"07edbd416aa56b42","lc":55,"one_liner":"reach = 0; for i, x: if i \u0026gt; reach: False; reach = max(reach, i + x). True.","patterns":["greedy"],"ready":true,"slug":"jump-game","source":"leetcode","technique":"Farthest reachable index","tier":"core","tier_why":"On the NeetCode 150.","title":"Jump Game"},{"difficulty":"medium","hash":"1639b0c4f9e58466","lc":45,"one_liner":"jumps = end = far = 0; for i in range(n − 1): far = max(far, i + nums[i]); if i == end: jumps += 1; end = far.","patterns":["greedy"],"ready":true,"slug":"jump-game-ii","source":"leetcode","technique":"BFS layers: end and farthest","tier":"core","tier_why":"On the NeetCode 150.","title":"Jump Game II"},{"difficulty":"medium","hash":"2bed0f5f5f9da10c","lc":134,"one_liner":"If sum(gas) \u0026lt; sum(cost): −1. Else tank = start = 0; for i: tank += gas[i] − cost[i]; if tank \u0026lt; 0: start = i + 1, tank = 0.","patterns":["greedy"],"ready":true,"slug":"gas-station","source":"leetcode","technique":"Total check + reset the start","tier":"core","tier_why":"On the NeetCode 150.","title":"Gas Station"},{"difficulty":"medium","hash":"03818f03160dfe3c","lc":763,"one_liner":"last = {c: i}; end = max(end, last[c]) for each i; when i == end, close a part of size end − start + 1.","patterns":["greedy"],"ready":true,"slug":"partition-labels","source":"leetcode","technique":"Last occurrence; cut when i reaches the end","tier":"core","tier_why":"On the NeetCode 150.","title":"Partition Labels"},{"difficulty":"medium","hash":"009a40605f97356a","lc":452,"one_liner":"arrows = 0, at = −∞; for s, e in sorted(points, key=end): if s \u0026gt; at: arrows += 1, at = e.","patterns":["greedy"],"ready":true,"slug":"minimum-number-of-arrows-to-burst-balloons","source":"leetcode","technique":"Sort by end, shoot at the first unburst end","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Minimum Number of Arrows to Burst Balloons"},{"difficulty":"medium","hash":"a0cd5fd7b3e51fa5","lc":846,"one_liner":"cnt = Counter(hand); for x in sorted(cnt): need = cnt[x]; if need: for y in x..x+k−1: if cnt[y] \u0026lt; need: False; cnt[y] −= need.","patterns":["greedy"],"ready":true,"slug":"hand-of-straights","source":"leetcode","technique":"Smallest card starts a run","tier":"core","tier_why":"On the NeetCode 150.","title":"Hand of Straights"},{"difficulty":"medium","hash":"e25000587cda58cb","lc":1899,"one_liner":"Keep triplets with every coordinate ≤ target; return whether each of the 3 target coordinates equals some kept triplet\u0026#39;s coordinate.","patterns":["greedy"],"ready":true,"slug":"merge-triplets-to-form-target-triplet","source":"leetcode","technique":"Drop overshooting triplets, check coverage","tier":"core","tier_why":"On the NeetCode 150.","title":"Merge Triplets to Form Target Triplet"},{"difficulty":"medium","hash":"3f193e5ee94ee248","lc":678,"one_liner":"lo, hi = 0; \u0026#39;(\u0026#39; → both +1; \u0026#39;)\u0026#39; → both −1; \u0026#39;*\u0026#39; → lo −1, hi +1; if hi \u0026lt; 0: False; lo = max(lo, 0). Return lo == 0.","patterns":["greedy"],"ready":true,"slug":"valid-parenthesis-string","source":"leetcode","technique":"Range [lo, hi] of open counts","tier":"core","tier_why":"On the NeetCode 150.","title":"Valid Parenthesis String"},{"difficulty":"medium","hash":"08c6e6246520b8c6","lc":48,"one_liner":"Swap m[i][j] and m[j][i] for j \u0026gt; i (transpose), then reverse every row: a 90° clockwise turn in place.","patterns":["matrix-math"],"ready":true,"slug":"rotate-image","source":"leetcode","technique":"Transpose, then reverse each row","tier":"core","tier_why":"On the NeetCode 150.","title":"Rotate Image"},{"difficulty":"medium","hash":"71696ca7f34a7a00","lc":54,"one_liner":"top, bottom, left, right; walk the top row, right column, bottom row, left column; shrink all four; guard the last single row or column.","patterns":["matrix-math"],"ready":true,"slug":"spiral-matrix","source":"leetcode","technique":"Four shrinking boundaries","tier":"core","tier_why":"On the NeetCode 150.","title":"Spiral Matrix"},{"difficulty":"medium","hash":"2ddf06b422a9b0c8","lc":73,"one_liner":"Remember whether row 0 / column 0 had a zero; mark rows and columns in m[r][0] and m[0][c]; zero the inner cells from the marks; then row 0 and column 0.","patterns":["matrix-math"],"ready":true,"slug":"set-matrix-zeroes","source":"leetcode","technique":"First row and column as markers","tier":"core","tier_why":"On the NeetCode 150.","title":"Set Matrix Zeroes"},{"difficulty":"medium","hash":"624e59b705190fe5","lc":289,"one_liner":"For each cell count live neighbors with value \u0026amp; 1; if it lives next step, set bit 1 (|= 2); then shift every cell right by one.","patterns":["matrix-math"],"ready":true,"slug":"game-of-life","source":"leetcode","technique":"Two bits per cell: now and next","tier":"recommended","tier_why":"Builds the in-place marker idea; not on the NeetCode 150.","title":"Game of Life"},{"difficulty":"medium","hash":"3f8d1b764c40a2c1","lc":50,"one_liner":"If n \u0026lt; 0: x = 1/x, n = −n. result = 1; while n: if n \u0026amp; 1: result *= x; x *= x; n \u0026gt;\u0026gt;= 1.","patterns":["matrix-math"],"ready":true,"slug":"powx-n","source":"leetcode","technique":"Binary exponentiation","tier":"core","tier_why":"On the NeetCode 150.","title":"Pow(x, n)"},{"difficulty":"medium","hash":"0131daff02f9eda0","lc":43,"one_liner":"d = [0] * (m + n); for i, j from the right: p = a[i]·b[j] + d[i+j+1]; d[i+j+1] = p % 10; d[i+j] += p // 10; strip leading zeros.","patterns":["matrix-math"],"ready":true,"slug":"multiply-strings","source":"leetcode","technique":"Digit array, column i + j + 1","tier":"core","tier_why":"On the NeetCode 150.","title":"Multiply Strings"},{"difficulty":"medium","hash":"af0ec13863c3ad57","lc":2013,"one_liner":"add: cnt[p] += 1. count(x, y): for each (px, py) with |px − x| == |py − y| ≠ 0, add cnt[(px, py)] · cnt[(px, y)] · cnt[(x, py)].","patterns":["matrix-math"],"ready":true,"slug":"detect-squares","source":"leetcode","technique":"Counter of points, fix the diagonal","tier":"core","tier_why":"On the NeetCode 150.","title":"Detect Squares"},{"difficulty":"medium","hash":"c4003c2c0cfcffb1","lc":1041,"one_liner":"Simulate once with (x, y) and direction (dx, dy); bounded iff (x, y) == (0, 0) or the robot no longer faces north.","patterns":["matrix-math"],"ready":true,"slug":"robot-bounded-in-circle","source":"leetcode","technique":"Back home or turned after one round","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Robot Bounded In Circle"},{"difficulty":"easy","hash":"290ff8b738f38a60","lc":346,"one_liner":"Append val, add it to the sum; if the deque holds more than size values, subtract and pop the oldest; return sum / len.","patterns":["ds-design"],"ready":true,"slug":"moving-average-from-data-stream","source":"leetcode","technique":"Deque + running sum","tier":"recommended","tier_why":"A classic design warm-up; not on the NeetCode 150 and not named by a company source.","title":"Moving Average from Data Stream"},{"difficulty":"easy","hash":"d4cfeaec1dbef62d","lc":359,"one_liner":"If message not seen or t ≥ last[message] + 10: last[message] = t, return True; else False.","patterns":["ds-design"],"ready":true,"slug":"logger-rate-limiter","source":"leetcode","technique":"Map message → last printed time","tier":"recommended","tier_why":"A classic design warm-up; not on the NeetCode 150 and not named by a company source.","title":"Logger Rate Limiter"},{"difficulty":"medium","hash":"7c2951db47036a68","lc":146,"one_liner":"map key → node; a doubly linked list with sentinels keeps recency; get/put move the node to the front; overflow evicts the node before the tail.","patterns":["ds-design"],"ready":true,"slug":"lru-cache","source":"leetcode","technique":"Hash map + doubly linked list","tier":"core","tier_why":"On the NeetCode 150; reported at Amazon, Google.","title":"LRU Cache"},{"difficulty":"medium","hash":"d45273a688a53ebb","lc":380,"one_liner":"insert: append and record the index; remove: move the last value into the removed slot, fix its index, pop; getRandom: random.choice(list).","patterns":["ds-design"],"ready":true,"slug":"insert-delete-getrandom-o1","source":"leetcode","technique":"Dense list + index map, swap with last","tier":"core","tier_why":"Reported at Meta.","title":"Insert Delete GetRandom O(1)"},{"difficulty":"medium","hash":"ac1f48361beeaad7","lc":1146,"one_liner":"Each index keeps a list of (snap_id, value) changes; set overwrites the entry of the current snap; get bisects for the last change with snap ≤ snap_id.","patterns":["ds-design"],"ready":true,"slug":"snapshot-array","source":"leetcode","technique":"Per-index change history + bisect","tier":"recommended","tier_why":"Named in a community copy of Google's list; not on the NeetCode 150.","title":"Snapshot Array"},{"difficulty":"medium","hash":"ddc1fc476dff046e","lc":362,"one_liner":"hit: append t. getHits(t): pop from the left while q[0] ≤ t − 300; return len(q).","patterns":["ds-design"],"ready":true,"slug":"design-hit-counter","source":"leetcode","technique":"Deque with expiry","tier":"recommended","tier_why":"A classic design warm-up; not on the NeetCode 150 and not named by a company source.","title":"Design Hit Counter"},{"difficulty":"medium","hash":"753ed639942d01ba","lc":2034,"one_liner":"price[t] = p; latest = max(latest, t); push (−p, t) and (p, t) into two heaps; on max/min, pop tops whose price no longer matches price[t].","patterns":["ds-design"],"ready":true,"slug":"stock-price-fluctuation","source":"leetcode","technique":"Two heaps with lazy deletion","tier":"recommended","tier_why":"Named in a community copy of Google's list; not on the NeetCode 150.","title":"Stock Price Fluctuation"},{"difficulty":"hard","hash":"dfe1d727a2188a20","lc":460,"one_liner":"Each key lives in the ordered bucket of its frequency; a use moves it to freq + 1; evict the oldest key of the minimum-frequency bucket.","patterns":["ds-design"],"ready":true,"slug":"lfu-cache","source":"leetcode","technique":"Frequency buckets + min_freq","tier":"optional","tier_why":"A harder variant of LRU Cache; not on the NeetCode 150 and not named by a company source.","title":"LFU Cache"},{"difficulty":"medium","hash":"210e6feb06842eb6","lc":1631,"one_liner":"best[0][0] = 0; heap of (effort, r, c); a step to a neighbor costs max(effort, |h[n] − h[cur]|); return when the corner pops.","patterns":["advanced-graphs"],"ready":true,"slug":"path-with-minimum-effort","source":"leetcode","technique":"Dijkstra on the largest step","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Path With Minimum Effort"},{"difficulty":"hard","hash":"268f182d518ece98","lc":778,"one_liner":"Heap of (time, r, c) starting with (grid[0][0], 0, 0); pop the smallest; a neighbor\u0026#39;s time is max(time, its height); the first pop of the corner is the answer.","patterns":["advanced-graphs"],"ready":true,"slug":"swim-in-rising-water","source":"leetcode","technique":"Dijkstra on the path maximum","tier":"core","tier_why":"On the NeetCode 150.","title":"Swim in Rising Water"},{"difficulty":"medium","hash":"43e21a0b1274b749","lc":1584,"one_liner":"dist[0] = 0; n times: take the closest unused point u, add dist[u], then lower dist[v] to |u − v| (Manhattan) for unused v.","patterns":["advanced-graphs"],"ready":true,"slug":"min-cost-to-connect-all-points","source":"leetcode","technique":"Prim's MST with a distance array","tier":"core","tier_why":"On the NeetCode 150.","title":"Min Cost to Connect All Points"},{"difficulty":"medium","hash":"57aa1606918e4558","lc":399,"one_liner":"Build edges a→b (k) and b→a (1/k); answer x/y by searching from x and multiplying weights along the path; −1 if unknown or unconnected.","patterns":["advanced-graphs"],"ready":true,"slug":"evaluate-division","source":"leetcode","technique":"Weighted graph or weighted union-find","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Evaluate Division"},{"difficulty":"hard","hash":"c70db989f7b8e529","lc":815,"one_liner":"Map stop → buses; BFS where boarding a new bus costs 1: from each stop, board every unused bus through it and enqueue all its stops.","patterns":["advanced-graphs"],"ready":true,"slug":"bus-routes","source":"leetcode","technique":"BFS over buses","tier":"recommended","tier_why":"Builds the pattern; not on the NeetCode 150 and not named by a company source.","title":"Bus Routes"},{"difficulty":"hard","hash":"5423d83fea649d54","lc":332,"one_liner":"Sort destinations; DFS from JFK always taking the smallest unused ticket; append an airport when it has no tickets left; reverse.","patterns":["advanced-graphs"],"ready":true,"slug":"reconstruct-itinerary","source":"leetcode","technique":"Hierholzer's Euler path","tier":"recommended","tier_why":"On the NeetCode 150, but a narrow trick (Euler paths) that no company source names.","title":"Reconstruct Itinerary"},{"difficulty":"hard","hash":"6c5a2b49d0c8d612","lc":1192,"one_liner":"DFS assigning disc[u]; low[u] = min(disc of back-edge targets, low of children); edge (p, c) is a bridge iff low[c] \u0026gt; disc[p].","patterns":["advanced-graphs"],"ready":true,"slug":"critical-connections-in-a-network","source":"leetcode","technique":"Tarjan's bridges","tier":"optional","tier_why":"A specialized algorithm; not on the NeetCode 150 and not named by a company source.","title":"Critical Connections in a Network"},{"difficulty":"easy","hash":"0cdf94b56e88c984","lc":0,"one_liner":"Draws split by score g = 0..10: eleven queries with team1goals = team2goals = g; add up each response\u0026#39;s total.","patterns":[],"ready":true,"slug":"hr-drawn-matches","source":"hackerrank","technique":"Filter on the server, read total","tier":"core","tier_why":"From a real HackerRank assessment. Pushing the filter into the query string comes back in every REST task.","title":"Count the Drawn Matches"},{"difficulty":"easy","hash":"c1d6f1db9c94b231","lc":0,"one_liner":"winner = competitions?name\u0026amp;year → data[0].winner; sum team1goals where team1 = winner plus team2goals where team2 = winner.","patterns":[],"ready":true,"slug":"hr-winner-total-goals","source":"hackerrank","technique":"Look up the winner; sweep home and away games","tier":"core","tier_why":"From a real HackerRank assessment. Summing only the home games is the classic wrong answer.","title":"Goals Scored by the Winner"},{"difficulty":"medium","hash":"c0e68474ee97cf6d","lc":0,"one_liner":"Walk the weights: if one dumbbell is left from the previous weight and this weight has stock, pair them; then pairs += count // 2 and carry = count % 2.","patterns":[],"ready":true,"slug":"hr-dumbbell-pairs","source":"hackerrank","technique":"Greedy pass, carry one leftover","tier":"core","tier_why":"From a real HackerRank assessment.","title":"Pairing Dumbbells"},{"difficulty":"medium","hash":"e1b2bdf7bba905e5","lc":0,"one_liner":"Walk each x down x, x // d, … , 0 recording (value → steps); for every value reached by ≥ threshold elements, sum the cheapest threshold steps; take the minimum.","patterns":[],"ready":true,"slug":"hr-equalize-by-division","source":"hackerrank","technique":"Division chains grouped by value","tier":"core","tier_why":"From a real HackerRank assessment.","title":"Equal Elements by Division"},{"difficulty":"medium","hash":"e235eb5a7fed0c44","lc":0,"one_liner":"Page through ?year=Y once; goals[team1] += team1goals and goals[team2] += team2goals; return the max, ties alphabetical.","patterns":[],"ready":true,"slug":"hr-top-scoring-team","source":"hackerrank","technique":"One paged sweep and a tally","tier":"recommended","tier_why":"Assessment-style practice: the case where no filter helps.","title":"Top-Scoring Team of the Year"},{"difficulty":"easy","hash":"2b49c240d11abce7","lc":0,"one_liner":"Sweep team1=A\u0026amp;team2=B and team1=B\u0026amp;team2=A for the year; in the second, swap the goal columns; tally [A wins, draws, B wins].","patterns":[],"ready":true,"slug":"hr-head-to-head","source":"hackerrank","technique":"Query both home/away orientations","tier":"recommended","tier_why":"Assessment-style practice: fixtures are directional, a record isn't.","title":"Head-to-Head Record"},{"difficulty":"easy","hash":"265f212a36e79ed4","lc":0,"one_liner":"Sort; columns = 1, base = h[0]; for each h: if h − base \u0026gt; k: columns += 1, base = h.","patterns":[],"ready":true,"slug":"hr-box-columns","source":"hackerrank","technique":"Sort, open a column when the span exceeds k","tier":"optional","tier_why":"Assessment-style practice; quick once sorting plus greedy is familiar.","title":"Boxes in Columns"},{"difficulty":"medium","hash":"a7440d34226e39a1","lc":0,"one_liner":"best[0] = 0, others −1 (unreachable); best[x] = max(best[x − a] + 1) over allowed a ≤ x with best[x − a] ≥ 0; return best[n].","patterns":[],"ready":true,"slug":"hr-ribbon-pieces","source":"hackerrank","technique":"Unbounded knapsack over lengths","tier":"recommended","tier_why":"Assessment-style practice; Coin Change with max instead of min.","title":"Most Pieces From a Ribbon"},{"difficulty":"easy","hash":"15bb1bd2fe794730","lc":0,"one_liner":"s = sum(r[:w]); for i in w..n−1: if |w·r[i] − s| \u0026gt; w·t: count += 1; then s += r[i] − r[i − w].","patterns":[],"ready":true,"slug":"hr-sensor-anomalies","source":"hackerrank","technique":"Rolling sum of the previous w readings","tier":"recommended","tier_why":"Assessment-style practice; a fixed window with integer-only math.","title":"Sensor Anomalies"},{"difficulty":"easy","hash":"5a5a4b8cdf5909b9","lc":0,"one_liner":"Sort; answer = min(s[i + k − 1] − s[i]) over i.","patterns":[],"ready":true,"slug":"hr-smallest-skill-gap","source":"hackerrank","technique":"Sort, slide a window of k","tier":"optional","tier_why":"Assessment-style practice; LeetCode 1984 in other words.","title":"Team With the Smallest Skill Gap"},{"difficulty":"medium","hash":"8603e18684fa95aa","lc":0,"one_liner":"heapify; while more than one: x = pop + pop; cost += x; push x.","patterns":[],"ready":true,"slug":"hr-merge-cost","source":"hackerrank","technique":"Min-heap, merge the two smallest","tier":"recommended","tier_why":"Assessment-style practice; the Huffman argument in a costume.","title":"Cheapest Merge to One Number"},{"difficulty":"medium","hash":"fde7490e61f51cb1","lc":0,"one_liner":"The rotations of p are the |p|-windows of p + p[:-1]; hash every |p|-window of both strings with a rolling hash and count the common hashes.","patterns":[],"ready":true,"slug":"hr-rotations-in-text","source":"hackerrank","technique":"Windows of p + p and a rolling hash","tier":"optional","tier_why":"Assessment-style practice; the place to learn Rabin–Karp hashing.","title":"Rotations Found in a Text"},{"difficulty":"medium","hash":"1f35680662ffb607","lc":0,"one_liner":"Sort both lists; walk them: an arrival before the next departure takes a platform (peak = max), otherwise a departure frees one.","patterns":[],"ready":true,"slug":"hr-minimum-platforms","source":"hackerrank","technique":"Sort arrivals and departures, sweep","tier":"recommended","tier_why":"Assessment-style practice; Meeting Rooms II with trains.","title":"Minimum Platforms"},{"difficulty":"medium","hash":"a7dab3474c577ba7","lc":0,"one_liner":"Map each x % m to its count (capped at 2); scan pairs of distinct residues (and r·r if r appears twice); stop early at m − 1.","patterns":[],"ready":true,"slug":"hr-pair-product-mod","source":"hackerrank","technique":"Pair scan over distinct residues","tier":"optional","tier_why":"Assessment-style practice; teaches when no shortcut exists.","title":"Largest Pair Product Modulo m"},{"difficulty":"medium","hash":"288d4a2b66837785","lc":0,"one_liner":"For g in 0..10, sweep ?year=Y\u0026amp;team1goals=g\u0026amp;team2goals=g and count each row\u0026#39;s competition; return the max, ties alphabetical.","patterns":[],"ready":true,"slug":"hr-most-draws-competition","source":"hackerrank","technique":"Filtered queries; group the rows","tier":"recommended","tier_why":"Assessment-style practice: when total isn't enough and rows must be read.","title":"Competition With the Most Draws"},{"difficulty":"easy","hash":"6f729db9f66b0dcc","lc":0,"one_liner":"If any package \u0026gt; c: −1. Else batches = 1, load = 0; for w: if load + w \u0026gt; c: batches += 1, load = w; else load += w.","patterns":[],"ready":true,"slug":"hr-conveyor-batches","source":"hackerrank","technique":"Greedy fill, cut when full","tier":"optional","tier_why":"Assessment-style practice; the check inside Capacity to Ship Packages.","title":"Batches on a Conveyor Belt"},{"difficulty":"medium","hash":"23cdea6abca4f491","lc":0,"one_liner":"Scan cells; each unvisited 1 starts an island: count it and flood-fill its 4-neighbors with a stack, marking cells when pushed.","patterns":[],"ready":true,"slug":"hr-island-count","source":"hackerrank","technique":"Flood fill with an explicit stack","tier":"optional","tier_why":"Number of Islands with integer cells; do LeetCode 200 first.","title":"Islands in a Matrix"},{"difficulty":"medium","hash":"a2f6bb4f1601cfd3","lc":0,"one_liner":"Sort the letter counts; for each count f at index i, keeping f of every letter from i on costs total − f · (k − i); take the minimum.","patterns":[],"ready":true,"slug":"hr-equal-frequencies","source":"hackerrank","technique":"Try each count as the target","tier":"recommended","tier_why":"Assessment-style practice; counting plus a short proof about the target.","title":"Delete Until Frequencies Match"},{"difficulty":"medium","hash":"c18bf8e2c9a5289c","lc":0,"one_liner":"Sort roads by cost; take a road when it joins two different components (union-find); after n − 1 roads the total is the answer, otherwise −1.","patterns":[],"ready":true,"slug":"hr-connect-cities","source":"hackerrank","technique":"Kruskal with union-find","tier":"recommended","tier_why":"Assessment-style practice; minimum spanning trees appear in OAs more than in interviews.","title":"Cheapest Roads Connecting Every City"},{"difficulty":"medium","hash":"dcb36ab9d6a129a6","lc":0,"one_liner":"Collect (date, scored, conceded) from the team1 = T and team2 = T sweeps, sort by date, then the longest run of scored ≥ conceded.","patterns":[],"ready":true,"slug":"hr-unbeaten-streak","source":"hackerrank","technique":"Merge home and away, sort by date, count the run","tier":"recommended","tier_why":"Assessment-style practice: order matters, so metadata can't answer it.","title":"Longest Unbeaten Run"},{"difficulty":"easy","hash":"6b589b25634ac27d","lc":0,"one_liner":"Counter(digit_sum(x) for x in arr); return the largest count (0 for an empty list).","patterns":[],"ready":true,"slug":"hr-digit-sum-groups","source":"hackerrank","technique":"Bucket by digit sum","tier":"optional","tier_why":"Assessment-style practice; a warm-up for counting with a dictionary.","title":"Largest Digit-Sum Group"},{"difficulty":"medium","hash":"8817b21ab0d78de3","lc":0,"one_liner":"atMost(m): grow r, shrink l while more than m distinct, add r − l + 1. Answer = atMost(k) − atMost(k − 1).","patterns":[],"ready":true,"slug":"hr-k-distinct-substrings","source":"hackerrank","technique":"atMost(k) − atMost(k − 1)","tier":"core","tier_why":"Assessment-style practice; the exactly-k trick appears all over LeetCode too.","title":"Substrings With Exactly k Distinct Letters"},{"difficulty":"easy","hash":"3cb2961ff7365450","lc":0,"one_liner":"Answer = 1 + the number of positions where the parity differs from the previous element (0 for an empty list).","patterns":[],"ready":true,"slug":"hr-alternating-parity","source":"hackerrank","technique":"Count the parity changes","tier":"optional","tier_why":"Assessment-style practice; a greedy with a one-line proof.","title":"Longest Alternating-Parity Subsequence"},{"difficulty":"medium","hash":"811580996e2c9f91","lc":0,"one_liner":"OrderedDict cache: a hit moves the item to the end; a miss counts, inserts at the end and, over capacity, pops the front.","patterns":[],"ready":true,"slug":"hr-lru-misses","source":"hackerrank","technique":"Ordered dict as the recency list","tier":"recommended","tier_why":"Assessment-style practice; LRU Cache as a simulation.","title":"Counting LRU Cache Misses"}],"quiz_hash":"c5abcb035f8b1d94","tracks":[{"blurb":"Problems in the style of HackerRank online assessments: four from real assessments, twenty practice problems in the same style, and six REST API tasks that run against an offline football API with made-up data. Each lists the pattern it practices, so you can check whether you\u0026#39;d recognize the pattern without being told.","id":"hackerrank","name":"HackerRank assessments","problems":[{"rest":true,"slug":"hr-drawn-matches"},{"rest":true,"slug":"hr-winner-total-goals"},{"pattern":"greedy","rest":false,"slug":"hr-dumbbell-pairs"},{"pattern":"hash-maps","rest":false,"slug":"hr-equalize-by-division"},{"rest":true,"slug":"hr-top-scoring-team"},{"rest":true,"slug":"hr-head-to-head"},{"pattern":"greedy","rest":false,"slug":"hr-box-columns"},{"pattern":"dp-1d","rest":false,"slug":"hr-ribbon-pieces"},{"pattern":"sliding-window","rest":false,"slug":"hr-sensor-anomalies"},{"pattern":"sliding-window","rest":false,"slug":"hr-smallest-skill-gap"},{"pattern":"heaps","rest":false,"slug":"hr-merge-cost"},{"pattern":"strings","rest":false,"slug":"hr-rotations-in-text"},{"pattern":"intervals","rest":false,"slug":"hr-minimum-platforms"},{"pattern":"hash-maps","rest":false,"slug":"hr-pair-product-mod"},{"rest":true,"slug":"hr-most-draws-competition"},{"pattern":"greedy","rest":false,"slug":"hr-conveyor-batches"},{"pattern":"graphs","rest":false,"slug":"hr-island-count"},{"pattern":"hash-maps","rest":false,"slug":"hr-equal-frequencies"},{"pattern":"advanced-graphs","rest":false,"slug":"hr-connect-cities"},{"rest":true,"slug":"hr-unbeaten-streak"},{"pattern":"hash-maps","rest":false,"slug":"hr-digit-sum-groups"},{"pattern":"sliding-window","rest":false,"slug":"hr-k-distinct-substrings"},{"pattern":"greedy","rest":false,"slug":"hr-alternating-parity"},{"pattern":"ds-design","rest":false,"slug":"hr-lru-misses"}]}],"version":"44fb7e1f62a4","warmups":[{"hash":"ff3a4e0f877b8357","order":1,"slug":"ex-hello-world","title":"Hello, World","topic":"basics"},{"hash":"c752ea67a60e3c97","order":2,"slug":"ex-leap","title":"Leap year","topic":"basics"},{"hash":"53ae016367d0350a","order":3,"slug":"ex-acronym","title":"Acronym","topic":"strings"},{"hash":"accfa18974900663","order":4,"slug":"ex-bob","title":"Bob","topic":"strings"},{"hash":"6a3e63cee65d20f0","order":5,"slug":"ex-pangram","title":"Pangram","topic":"strings"},{"hash":"135433c49c351734","order":6,"slug":"ex-anagram","title":"Anagram","topic":"strings"},{"hash":"b572b57c681a9def","order":7,"slug":"ex-rna-transcription","title":"RNA transcription","topic":"strings"},{"hash":"5c398af4d4b10df9","order":8,"slug":"ex-hamming","title":"Hamming distance","topic":"strings"},{"hash":"b7d9e1d9e83b621b","order":9,"slug":"ex-atbash-cipher","title":"Atbash cipher","topic":"strings"},{"hash":"cbb74e5221900dbd","order":10,"slug":"ex-pig-latin","title":"Pig Latin","topic":"strings"},{"hash":"a3c97f23a91ae488","order":11,"slug":"ex-run-length-encoding","title":"Run-length encoding","topic":"strings"},{"hash":"59695031fed3b4f7","order":12,"slug":"ex-series","title":"Series","topic":"strings"},{"hash":"8703c34aca4ddc47","order":13,"slug":"ex-beer-song","title":"Beer song","topic":"strings"},{"hash":"8767f05f96e5a38d","order":14,"slug":"ex-word-count","title":"Word count","topic":"collections"},{"hash":"b3408ec4e9b52ace","order":15,"slug":"ex-scrabble-score","title":"Scrabble score","topic":"collections"},{"hash":"c43db483f3c184cf","order":16,"slug":"ex-etl","title":"ETL","topic":"collections"},{"hash":"c05d827bd1bfddf0","order":17,"slug":"ex-sublist","title":"Sublist","topic":"collections"},{"hash":"69cc794ea57d201a","order":18,"slug":"ex-grains","title":"Grains on a chessboard","topic":"numbers"},{"hash":"41b5b84e7c989d84","order":19,"slug":"ex-difference-of-squares","title":"Difference of squares","topic":"numbers"},{"hash":"c884829631db9543","order":20,"slug":"ex-sum-of-multiples","title":"Sum of multiples","topic":"numbers"},{"hash":"620cb7809c19fcb8","order":21,"slug":"ex-perfect-numbers","title":"Perfect numbers","topic":"numbers"},{"hash":"8d2015352a2e89dd","order":22,"slug":"ex-sieve","title":"Sieve of Eratosthenes","topic":"numbers"},{"hash":"013879cbbf769ad2","order":23,"slug":"ex-nth-prime","title":"Nth prime","topic":"numbers"},{"hash":"0e8aaef78f97b1f6","order":24,"slug":"ex-roman-numerals","title":"Roman numerals","topic":"numbers"},{"hash":"f3fc84f08524d8d3","order":25,"slug":"ex-secret-handshake","title":"Secret handshake","topic":"numbers"},{"hash":"1b2173547824e76a","order":26,"slug":"ex-largest-series-product","title":"Largest series product","topic":"numbers"},{"hash":"dea7d1efc2571d90","order":27,"slug":"ex-gigasecond","title":"Gigasecond","topic":"numbers"},{"hash":"553a836472a3ea95","order":28,"slug":"ex-space-age","title":"Space age","topic":"classes"},{"hash":"f08746ccaeebff5c","order":29,"slug":"ex-allergies","title":"Allergies","topic":"classes"},{"hash":"5c6fc1cd0eedd730","order":30,"slug":"ex-matrix","title":"Matrix","topic":"classes"},{"hash":"b2e3444f553e2c82","order":31,"slug":"ex-grade-school","title":"Grade school","topic":"classes"},{"hash":"8a402d8555e944d2","order":32,"slug":"ex-kindergarten-garden","title":"Kindergarten garden","topic":"classes"},{"hash":"cdc657040c94cd6d","order":33,"slug":"ex-robot-simulator","title":"Robot simulator","topic":"classes"}]}