Meta

A recruiter call, sometimes a CodeSignal assessment, a 45-minute coding screen, then an onsite that since April 2026 runs AI-enabled: two AI-enabled coding rounds, one or two system design rounds and a behavioral round. Hiring committee and team matching follow.

265 questions

  • Design a rate limiterSystem designDesign a service that limits how many requests each API client can make. It sits in front of every API endpoint at high traffic.
    Reported by 1 member · Last asked Oct 2026
  • Shortest path through a digit grid with diagonal movesCodingYou are given an m x n grid of digits. A cell holding 0 is a wall; a cell holding 1 through 9 is open. Starting at the top-left cell (0, 0), find a shortest route to the…
    Last asked Sep 2026
  • Design an LLM chatbot with RL-trained answersAI systemDesign a chatbot that answers users' questions in real time, built on a large language model. Cover the serving path (latency, streaming answers, scale), then the learning loop:…
    Last asked Sep 2026
  • Implement multi-head self-attentionML designWrite multi-head self-attention from scratch: project the input to queries, keys and values, split them into heads, compute scaled dot-product attention, combine the heads and…
    Last asked Sep 2026
  • Implement k-means clusteringCodingImplement k-means from scratch: initialize k centroids, assign every point to its nearest centroid, move each centroid to the mean of its points, and repeat until the assignments…
    Last asked Sep 2026
  • Valid word abbreviationCodingA word can be abbreviated by replacing non-overlapping, non-adjacent substrings with their lengths, so internationalization may become i18n or i5a11o1. Given a word and an…
    Last asked Sep 2026
  • Troubleshoot a crashed or unresponsive Linux serverCodingA single web server has gone down, or it is up but requests hang. Walk through how you find the cause step by step and name the exact commands you would run at each step: checking…
    Last asked Sep 2026
  • Binary tree vertical order traversalCodingReturn a binary tree's values column by column, from the leftmost column to the rightmost. The root is in column 0, a left child one column to the left of its parent and a right…
    Last asked Sep 2026
  • Design a notification systemSystem designA shared service other teams call to send push, email and SMS notifications: templates, user preferences, retries, deduplication and rate limits.
    Last asked Sep 2026
  • Design Facebook MessengerSystem designOne-to-one and group messaging for a billion users: real-time delivery, offline sync, read receipts and message history on every device.
    Last asked Sep 2026
  • Lowest common ancestor of a binary treeCodingGiven a binary tree (no ordering on the values) and two of its nodes, return their lowest common ancestor: the deepest node that has both in its subtree.
    Last asked Sep 2026
  • Range sum of a binary search treeCodingGiven a binary search tree and two bounds low and high, return the sum of the values within the inclusive range, skipping subtrees that cannot contain any. Follow-up: answer many…
    Last asked Sep 2026
  • Resolve a cd command to an absolute pathCodingWrite a function that takes the current directory and the argument to cd, and returns the directory pwd would print afterwards. Handle ., .., repeated and trailing slashes, and…
    Last asked Sep 2026
  • Two sumCodingGiven an integer array and a target, return the indices of the two different elements that add up to the target; exactly one such pair exists. Then solve it without a hash map…
    Last asked Sep 2026
  • Design a people-you-may-know friend recommendation systemSystem designDesign the "people you may know" feature of a large social network: each user sees people they are not connected to yet but probably know, and can send a friend request or dismiss…
    Last asked Sep 2026
  • Design Instagram StoriesSystem designDesign the stories feature of a photo and video app: users post photos or short videos that their followers can view for 24 hours, after which they disappear. At the top of the…
    Last asked Sep 2026
  • Anthropic OA: leveled in-memory record storeCodingA timed, multi-level exercise building an in-memory store of records with fields: create and read first, then scans and filters, then timestamps with expiry, then backup and…
    Last asked Sep 2026
  • Grid maze solver with keys, doors and bombs, AI-assistedCodingYou get a small existing codebase that models a grid maze and an AI assistant you may use. Fix a bug in the provided code, then find the shortest path from start to exit, then add…
    Last asked Sep 2026
  • Card game: pick cards that sum to 15CodingYou get a small existing codebase for a card game played with a 36-card deck, and you may use an AI assistant. The game revolves around picking cards whose values add up to 15…
    Last asked Sep 2026
  • Friend recommendation by mutual friendsCodingRecommend friends ranked by number of mutual friends in a social graph. Reported on 1point3acres' Fireworks AI bank; reconstructed in our own words.
    Last asked Sep 2026
  • Design an online game leaderboardSystem designShow the top players and each player's own rank in real time as millions of scores update.
    Last asked Sep 2026
  • Design UberSystem designRiders request trips, nearby drivers get matched, and both see live location until drop-off, with pricing and payment, for millions of trips a day.
    Last asked Sep 2026
  • Hiring-manager round on impact and collaborationBehavioralA behavioral round on past project impact, work with non-engineering partners, mentorship, and roadmap influence. Distinct from the values-focused culture round.
    Last asked Sep 2026
  • Basic calculatorCodingEvaluate an arithmetic expression string with non-negative integers, +, -, , / (integer division toward zero) and spaces, respecting operator precedence, without eval. State the…
    Last asked Aug 2026
  • Design a distributed rate limiterSystem designDesign a rate limiter that enforces a token-bucket limit per client across a fleet of servers. Cover where the limiter sits, where the bucket state lives (a shared store, local…
    Last asked Aug 2026
  • Group dependent tasks into parallel levelsCodingYou run a build system. Each task has a unique, non-empty lowercase name. Some tasks depend on others: a dependency before, after means before must finish before after can start…
    Last asked Aug 2026
  • Project deep dive: present a project you ledBehavioralPresent a project you led in about 20 minutes: context, your role, the architecture, three hard trade-offs, metrics, cost and return, and what you would change. Then take 25…
    Last asked Aug 2026
  • Design a harmful content detection systemML designDetect harmful posts (hate, violence, self-harm, spam) across text and images, with high recall on severe harms and a path to human review.
    Last asked Aug 2026
  • Find a local minimum or peak with binary searchCodingFind any local minimum of an array, an element no larger than its neighbours (treat positions outside the array as infinitely large), in O(log n) time. The same idea finds a peak…
    Last asked Aug 2026
  • Subarray sum equals kCodingCount the contiguous subarrays whose sum equals k; the array may contain negative numbers. Follow-ups: only report whether such a subarray exists, or return the longest one.
    Last asked Aug 2026
  • Valid palindrome after deleting at most k charactersCodingReturn whether a string can become a palindrome by deleting at most k characters. Relate it to the longest palindromic subsequence and give the time and space of your solution.
    Last asked Aug 2026
  • Design search over user posts with boolean queriesSystem designDesign search over users' status posts on a large social network. Queries combine words with AND and OR (for example cats AND (dogs OR birds)), and new posts should become…
    Last asked Aug 2026
  • Sum root-to-leaf numbersCodingEach node of a binary tree holds a digit, so every root-to-leaf path spells a number. Return the sum of all those numbers.
    Last asked Aug 2026
  • Is there an island of exactly size k?CodingGiven a grid of land and water, answer many queries of the form "is there an island of exactly k cells?". Find the islands once, then answer each query quickly, and discuss what…
    Last asked Aug 2026
  • Minimum root-to-leaf path sumCodingGiven the root of a binary tree whose nodes hold integers (values may be negative), find the root-to-leaf path with the smallest sum. A leaf is a node with no children. A…
    Last asked Aug 2026
  • Design a large-scale recommendation system end to endML designDesign a recommendation system from scratch. When a user opens a surface, it picks a short, ordered list of items out of a very large catalog that changes all the time, and it…
    Last asked Jul 2026
  • Cheapest round-trip flight from two price listsCodingdeparturei is the price of flying out on day i and arrivalj the price of flying back on day j. Return the cheapest total for a trip that returns after it departs, in one pass.
    Last asked Jul 2026
  • Thread-safe tally counter with bounded memoryCodingBuild a tally service that many threads call at once to count occurrences of keys, and that answers queries for counts. Memory is bounded, so it cannot keep every key forever…
    Last asked Jul 2026
  • ML fundamentals deep dive for ML rolesML designAfter a short walk through your resume, expect fast questions on machine learning basics, usually centred on your own area (language models, vision, recommendations). For each…
    Last asked Jun 2026
  • Design an LLM-based coding assistantAI systemDesign an AI coding assistant that helps developers inside their editor: completing code, answering questions about a codebase and making edits on request. Discuss how it gathers…
    Last asked Jun 2026
  • Shortest unique prefix for each wordCodingGiven a list of distinct words, return for each word its shortest unique prefix: the shortest leading substring of the word that no other word in the list starts with. Return the…
    Last asked Jun 2026
  • How do you use AI in your work?BehavioralDescribe how AI tools fit into your engineering work: where they help, where they fail, how you verify their output, and how they have changed the way you or your team work.
    Last asked Jun 2026
  • Design a distributed web crawlerSystem designCrawl billions of web pages politely and repeatedly, deduplicating URLs and content, to feed a search index or a training-data pipeline.
    Last asked Jun 2026
  • Design a top-K popular items systemSystem designReport the K most viewed or played items over sliding windows (last minute, hour, day) from a firehose of billions of events per day.
    Last asked Jun 2026
  • Design an online chess gameSystem designMatch players of similar rating, play live games with clocks, handle disconnects and reconnects, and keep game history and ratings.
    Last asked Jun 2026
  • Exclusive time of functionsCodingFrom function start and end logs, compute each function's exclusive execution time excluding nested calls. Reported on 1point3acres' Decagon bank; reconstructed in our own words.
    Last asked May 2026
  • Diameter of a binary treeCodingReturn the number of edges on the longest path between any two nodes of a binary tree. The path need not pass through the root. Solve it in one pass.
    Last asked May 2026
  • Count palindromic substringsCodingCount the substrings of a string that are palindromes, counting each position separately. Expanding around every centre gives O(n^2) time and O(1) space.
    Last asked May 2026
  • Design a news feedSystem designDesign the home feed for a social network with 1B users: posts from people you follow, ranked, fresh within seconds.
    Last asked May 2026
  • Turn-based monster team battle simulatorCodingWrite a deterministic simulator for a turn-based battle between two ordered teams of monsters, and return the battle log and the result. python class Monster: name: str unique…
    Last asked May 2026
  • Design InstagramSystem designUsers post photos and videos, follow each other and scroll a feed; design upload, storage, feed generation and serving media worldwide.
    Last asked May 2026
  • Merge three sorted arrays without duplicatesCodingMerge three sorted integer arrays into one sorted array that contains each value once. Walk the three arrays together in a single pass rather than concatenating and sorting.
    Last asked Apr 2026
  • Design DoorDashSystem designDesign an on-demand food delivery platform: customers browse nearby restaurants and order, restaurants accept and prepare the order, and couriers are assigned to pick it up and…
    Last asked Apr 2026
  • Binary tree right side viewCodingReturn the values visible when you look at a binary tree from the right: the last node of each level, top to bottom. Follow-ups: the left side view, and both views in a single…
    Last asked Apr 2026
  • 3SumCodingReturn every unique triple of values in an integer array that adds up to zero, with no duplicate triples in the answer. Aim for O(n^2) time after sorting.
    Last asked Apr 2026
  • Design a ticket booking systemSystem designSell seats for concerts and games where demand spikes the moment sales open: hold seats briefly, never sell one twice, and stay up under the rush.
    Last asked Apr 2026
  • Design LeetCodeSystem designUsers solve coding problems in the browser; run their submissions safely against hidden tests, return verdicts quickly, and support live contests with leaderboards.
    Last asked Apr 2026
  • Longest increasing path in a matrixCodingReturn the length of the longest path in an integer matrix that moves up, down, left or right and only to strictly larger values. Use memoised DFS (or a topological order) so…
    Last asked Apr 2026
  • Remove duplicates from a sorted array in placeCodingRemove duplicates from a sorted array in place so each value appears once, and return the new length; the first part of the array must hold the unique values in order. Use O(1)…
    Last asked Apr 2026
  • Find words that contain another word from the listCodingGiven a list of strings, find the strings that contain another string from the same list as a substring. For "programming", "am", "pro" the answer is programming. Start from the…
    Last asked Apr 2026
  • Valid parenthesesCodingGiven a string of brackets (), and {}, decide whether every bracket is closed by the matching type in the right order.
    Last asked Apr 2026
  • One edit distanceCodingReturn whether two strings are exactly one edit apart, where an edit inserts, deletes or replaces one character. Solve it in one pass and clarify the edge cases (equal strings…
    Last asked Apr 2026
  • Best time to buy and sell stockCodingGiven daily prices, return the most profit you can make. First allow any number of buy-then-sell transactions (holding one share at a time), then allow only one transaction.
    Last asked Apr 2026
  • Keep private code from leaking through a coding agentAI systemA company runs an AI coding agent over its private repositories. Design the safeguards that stop private source code from leaking: into model training data, into answers shown to…
    Last asked Apr 2026
  • Valid numberCodingReturn whether a string is a valid number: an integer or decimal with an optional sign, optionally followed by an exponent (e or E and an integer). Spell out the rules first, then…
    Last asked Apr 2026
  • Design live comments for live videosSystem designDesign real-time comments on live video broadcasts: viewers post comments and everyone watching the same video sees them appear within a second or two, even when a popular stream…
    Last asked Apr 2026
  • Raise alerts from a streaming vmstat feedCodingRead the output of vmstat as it streams, line by line, parse the columns, and print an alert whenever a chosen metric crosses a threshold. Keep it working on a stream that never…
    Last asked Apr 2026
  • Implement pow(x, n)CodingCompute x raised to an integer power n (which may be negative) in O(log n) multiplications by squaring, rather than multiplying n times. Handle n = 0, negative exponents and…
    Last asked Apr 2026
  • Design a nearby places recommendation systemML designDesign the ML system that recommends places to visit (restaurants, shops, attractions) to a user in a maps or local-discovery product. The user may be on the move, so location and…
    Last asked Mar 2026
  • Design a code review agentAI systemDesign an AI agent that reviews pull requests: it reads the diff and the surrounding code, leaves comments on bugs, risky changes and style problems, and may suggest fixes. Cover…
    Last asked Mar 2026
  • Design a fitness tracking appSystem designDesign a fitness tracking app: users record workouts such as runs and rides from their phone, see their history, and view the route of each workout on a map. Cover uploading…
    Last asked Mar 2026
  • Design a nearby points-of-interest serviceSystem designGiven a user's location, return the closest restaurants, shops and other places of interest within a radius, fast, for a read-heavy global audience.
    Last asked Mar 2026
  • Merge two sorted interval listsCodingImplement mergetwointervallists(a, b). Each argument is a list of intervals start, end with integer endpoints and start <= end. Each list is sorted by start, and no two intervals…
    Last asked Mar 2026
  • Design a price tracking serviceSystem designTrack the prices of millions of products across stores and alert users when a product they watch drops below their target price.
    Last asked Mar 2026
  • Construct a BST from its preorder traversalCodingGiven the preorder traversal of a binary search tree with distinct values, rebuild the tree and return its root. Aim for linear time.
    Last asked Mar 2026
  • Spiral matrixCodingReturn all elements of an m x n matrix in spiral order: along the top row, down the right column, back along the bottom row, up the left column, then inward.
    Last asked Mar 2026
  • Count distinct values in a sorted arrayCodingCount the distinct values in a sorted array of length n that holds only k distinct values, where k is much smaller than n. A linear scan works; do better by jumping over each run…
    Last asked Mar 2026
  • Insert, delete and get random in O(1)CodingDesign a set with insert(val), remove(val) and getrandom(), each in average O(1) time. getrandom returns each current element with equal probability.
    Last asked Mar 2026
  • Design a short-video recommendation systemML designDesign the recommendation system behind a short-video feed, where each user swipes through videos one at a time. Cover what you optimise (watch time, completion, likes, shares)…
    Last asked Feb 2026
  • Merge k sorted listsCodingMerge k sorted linked lists into one sorted list. Compare a min-heap of list heads with pairwise merging, and give the time complexity in terms of the total number of nodes and k.
    Last asked Feb 2026
  • Top K frequent elementsCodingGiven an integer array and k, return the k values that occur most often, in any order; ties at the cutoff may go either way. One version asks for the most frequent request IDs in…
    Last asked Feb 2026
  • Design an ad click aggregation systemSystem designCount ad clicks per ad and per time window from billions of events a day, accurately enough to bill advertisers, with results available within minutes.
    Last asked Feb 2026
  • Design an online auction with live biddingSystem designDesign an auction system where users bid on items (for example items posted on a social app) and everyone watching sees the current highest bid in real time until the auction…
    Last asked Feb 2026
  • Design YouTubeSystem designUpload videos, transcode them into many formats, and stream them worldwide with adaptive bitrate, along with views, likes and comments.
    Last asked Feb 2026
  • Design post privacy and visibility controlsSystem designDesign privacy settings for posts on a social network: an author chooses who can see each post (public, friends, friends of friends, custom lists, excluding certain people), and…
    Last asked Feb 2026
  • Kth largest element in an arrayCodingReturn the k-th largest element of an unsorted array. Compare sorting, a size-k min-heap and quickselect, with their time and space costs.
    Last asked Feb 2026
  • Range sum query (immutable)CodingPreprocess an integer array so that the sum of any range i, j is answered in constant time. Build prefix sums once and design the function so it can be reused across many queries.
    Last asked Feb 2026
  • Minimum remove to make valid parenthesesCodingA string holds letters and parentheses. Remove the fewest parentheses so that the rest is balanced, and return any valid result. Do it with a stack of indices first, then without…
    Last asked Feb 2026
  • Populate next right pointers in each nodeCodingEach node of a binary tree (not necessarily perfect) has a next pointer. Set every node's next to the node to its right on the same level, or null at the end of a level…
    Last asked Feb 2026
  • Random pick weighted by populationCodingGiven countries and their populations, write a picker that returns a random country with probability proportional to its population. Build prefix sums once, draw a random number…
    Last asked Feb 2026
  • Check whether a binary tree is completeCodingReturn whether a binary tree is complete: every level is full except possibly the last, and the last level's nodes are as far left as possible.
    Last asked Feb 2026
  • Design a content moderation systemSystem designScreen user posts, images and videos for policy violations with ML classifiers and human reviewers, acting within seconds on the worst content.
    Last asked Feb 2026
  • Design an image copyright-violation detection systemML designDesign a system that detects when users upload images that infringe someone's copyright on a large social platform. Discuss where the reference set of protected images comes from…
    Last asked Feb 2026
  • Next permutationCodingRearrange an array of numbers into the next permutation in lexicographic order, in place with constant extra memory; if it is the last permutation, wrap around to the smallest.
    Last asked Feb 2026
  • Dot product of two sparse vectorsCodingStore very large, mostly-zero vectors compactly and compute the dot product of two of them. Compare a hash map with sorted index-value pairs, and say how you would reuse work when…
    Last asked Feb 2026
  • Nested list weight sumCodingA nested list holds integers and other nested lists. Return the sum of every integer multiplied by its depth (integers in the outer list have depth 1).
    Last asked Feb 2026
  • Cloud storage with user quotas and backupsCodingDesign an in-memory cloud storage service. The interview has four parts. Each part adds methods, and every earlier method must keep working. Implement a class CloudStorage. File…
    Last asked Feb 2026
  • Diagonal traversal of a matrixCodingReturn the elements of a matrix diagonal by diagonal. In one version the direction alternates (up-right, then down-left); in another every diagonal is read in the same direction…
    Last asked Feb 2026
  • Lowest common ancestor with parent pointersCodingEach tree node has a pointer to its parent, and you are given only the two nodes, not the root. Return their lowest common ancestor using O(1) extra space.
    Last asked Feb 2026
  • Number of islandsCodingGiven a binary matrix, return how many islands it has: groups of 1 cells connected up, down, left or right (diagonals don't connect).
    Last asked Feb 2026
  • Derive the least-squares solution for linear regressionML designDerive the closed-form solution of ordinary least-squares linear regression from the loss function, and explain each step. Then discuss when the closed form is a bad idea (cost…
    Last asked Feb 2026
  • Place Tetris-like shapes in the first spot that fitsCodingYou have an n x m grid and a sequence of shapes from a small fixed set. Place the shapes one at a time, in order; each goes into the first position where it fits, scanning rows…
    Last asked Feb 2026
  • Sparse matrix multiplicationCodingMultiply two matrices that are mostly zeros. Store only the non-zero entries and skip work on zeros, and state the cost in terms of the number of non-zero entries.
    Last asked Feb 2026
  • Shortest unique abbreviation for every wordCodingAbbreviate each word in a list of distinct words as a prefix, the count of the letters in between, and the last letter (like becomes l2e). When two words share an abbreviation…
    Last asked Feb 2026
  • Design a notification ranking systemML designMany products send notifications to the same user: new products, friends' activity, results of advertisers' campaigns and more. Design the ML system that decides which…
    Last asked Jan 2026
  • Moving average from a data streamCodingImplement a class that receives numbers one at a time and returns the average of the last size values after each one, in constant time per call, keeping a running sum and a queue…
    Last asked Jan 2026
  • Binary search tree iteratorCodingImplement an iterator over a binary search tree that returns the values in ascending order with next() and hasnext(). Each call should take amortised O(1) time, and memory should…
    Last asked Jan 2026
  • Copy a linked list with random pointersCodingEach node of a linked list has a next pointer and a random pointer that can point at any node or nowhere. Make a deep copy of the list. Do it with a map from old nodes to new…
    Last asked Jan 2026
  • LRU cacheCodingBuild a key-value cache with a fixed capacity that evicts the least recently used entry when it is full. get(key) returns the value or a miss, put(key, value) inserts or updates…
    Last asked Jan 2026
  • Design an ads ranking system with calibrated predictionsML designDesign the system that ranks ads for a user, using predicted click and conversion probabilities together with advertiser bids. Because the predictions feed an auction, they must…
    Last asked Jan 2026
  • Build a text summarization API serviceCodingWith an AI assistant available, build a small production-style web service with FastAPI: POST /summarize takes JSON {"text": ...} and returns {"summary": ...}. Add input…
    Last asked Jan 2026
  • Minimum add to make parentheses validCodingReturn the fewest parentheses to insert so a string of ( and ) becomes balanced, counting unmatched openers and closers in one pass.
    Last asked Jan 2026
  • Merge intervalsCodingGiven a list of intervals (for example time ranges), merge every group of overlapping intervals and return the result in sorted order.
    Last asked Jan 2026
  • Implement an LRU cacheCodingImplement a least-recently-used cache with get(key) and put(key, value), both in O(1) time, with a fixed capacity.
    Last asked Jan 2026
  • Walls and gatesCodingA grid holds walls, gates and empty rooms. Fill every empty room with the distance to its nearest gate, leaving rooms that cannot reach a gate untouched. Use one multi-source BFS…
    Last asked Jan 2026
  • Add two binary stringsCodingGiven two binary numbers as strings, return their sum as a binary string, adding digit by digit from the right with a carry, without converting to integers.
    Last asked Jan 2026
  • Build a binary tree from a parenthesized stringCodingA string encodes a binary tree as an integer followed by zero, one or two parenthesized subtrees, the left one first, for example 4(2(3)(1))(6(5)). Parse it into a tree and return…
    Last asked Jan 2026
  • Repeatedly remove runs of equal adjacent charactersCodingRemove every run of two or more equal adjacent characters, and keep doing it as new runs form, until none remain. For example xyyyx becomes xx and then the empty string. Do it in…
    Last asked Jan 2026
  • Insert into a sorted circular linked listCodingYou are given a node somewhere in a circular linked list sorted in ascending order. Insert a value so the list stays sorted and return a node of the list. Handle an empty list, a…
    Last asked Dec 2025
  • Word breakCodingReturn whether a string can be split into a sequence of words from a dictionary, where words may be reused. Give the dynamic programming solution and its cost.
    Last asked Dec 2025
  • Four short array and string exercisesCodingFour quick problems in one round: 1. Return the difference between the number of uppercase and lowercase letters in a string. 2. Repeatedly subtract from the non-zero elements of…
    Last asked Dec 2025
  • All root-to-leaf path sumsCodingReturn a list with the sum of the values along every root-to-leaf path of a binary tree, one entry per leaf, in left-to-right order.
    Last asked Dec 2025
  • Convert an integer to hexadecimalCodingConvert a 32-bit signed integer to a lowercase hexadecimal string without library conversion functions. Negative numbers use two's complement, and the result has no leading zeros…
    Last asked Dec 2025
  • Course schedule: can every course be finished?CodingGiven a number of courses and prerequisite pairs, return whether it is possible to finish every course, which means the prerequisite graph has no cycle. Use Kahn's algorithm or…
    Last asked Dec 2025
  • Design comment ranking for a news feedML designDesign the ML system that decides which comments to show, and in what order, under posts in a news feed. Discuss the objective (meaningful conversations, not only likes), the…
    Last asked Dec 2025
  • Making a large islandCodingIn a binary grid you may change at most one water cell to land. Return the size of the largest island you can end up with. Label each island and its size once, then try each water…
    Last asked Dec 2025
  • Shortest distance from all buildingsCodingA grid has empty land, buildings and obstacles. Find the empty cell whose total walking distance to every building is smallest (moving up, down, left or right), or return -1 if no…
    Last asked Dec 2025
  • Check completeness of a binary treeCodingGiven the root of a binary tree, return whether it is complete: every level is full except possibly the last, and the nodes on the last level sit as far left as possible. Explain…
    Last asked Dec 2025
  • Design a distributed job schedulerSystem designDesign a service that runs millions of scheduled and on-demand jobs (cron-like and one-off) reliably across a fleet of workers.
    Last asked Dec 2025
  • Explain ACID and transaction isolation levelsSystem designExplain what each letter of ACID guarantees, then walk through the standard isolation levels (read uncommitted, read committed, repeatable read, serializable) and the anomalies…
    Last asked Dec 2025
  • Top three categories by total scoreCodingYou get a list of (category, score) tuples. Add up the score of each category and return the best total you can get from at most three categories (the three highest totals)…
    Last asked Dec 2025
  • Car rental utilization by city (SQL)CodingGiven tables of rental cars and their rentals, write SQL that reports utilization per city: how much of the available fleet time in each city was actually rented over a period…
    Last asked Dec 2025
  • Data model for feed posts and sharesSystem designModel the data behind a social feed where people create posts and share other people's posts. Name the entities (users, posts, shares and so on), design the fact and dimension…
    Last asked Dec 2025
  • Longest palindromic substringCodingReturn the longest substring of a string that reads the same forwards and backwards. Start with expanding around each center, state the time and space, and say how you would get…
    Last asked Nov 2025
  • Thread-safe job registry with expiryCodingBuild an in-memory registry of jobs that many threads read and write at once. Each job is registered with a time to live; lookups must not return a job whose time has passed, and…
    Last asked Nov 2025
  • Copy list with random pointerCodingEach node of a singly linked list has a next pointer and a random pointer that may point to any node in the list or to nothing. Return a deep copy of the list in which no pointer…
    Last asked Nov 2025
  • Find a target in an unknown grid with a robot APICodingA robot sits somewhere in a grid you cannot see: you don't know its size, its walls or where you start. You can only call the robot's API: move forward (which reports whether it…
    Last asked Nov 2025
  • Employee free timeCodingYou get each employee's busy schedule as a sorted list of non-overlapping intervals. Return the finite intervals in which every employee is free, in sorted order. Merge the busy…
    Last asked Nov 2025
  • Contiguous array with equal 0s and 1sCodingGiven a binary array, return the length of the longest contiguous subarray with as many 0s as 1s. Treat 0 as -1 and look for two equal prefix sums as far apart as possible.
    Last asked Nov 2025
  • Longest increasing downward path in a binary treeCodingIn a binary tree, find the longest path that goes from a node down to one of its descendants where every child's value is greater than its parent's (not necessarily by exactly…
    Last asked Nov 2025
  • Longest vacation with N PTO daysCodingA year is given as an array of days, each a workday (W) or a holiday (H). You have n paid days off to place on workdays. Return the longest run of consecutive days off you can…
    Last asked Nov 2025
  • Design an online auction serviceSystem designDesign an auction feature inside a social app: sellers list an item with an end time, buyers place bids, and everyone watching sees the highest bid update live. Cover the data…
    Last asked Oct 2025
  • Dot product of run-length encoded vectorsCodingA very long integer vector has many repeated values. Design a compact representation for it (for example, runs of value and count), then compute the dot product of two vectors…
    Last asked Oct 2025
  • Shortest subarray whose max minus min is at least KCodingGiven an integer array and k, return the length of the shortest contiguous subarray in which the largest value minus the smallest value is at least k, or -1 if none exists. Aim…
    Last asked Oct 2025
  • Basic calculator IICodingEvaluate a string expression of non-negative integers with +, -, , / and spaces, no parentheses, respecting precedence (integer division truncates toward zero). Variants reported:…
    Last asked Oct 2025
  • Random pick with weightCodingGiven positive weights, implement pick() that returns index i with probability wi / sum(w). Build prefix sums once, then binary search a random number into them. One version gives…
    Last asked Oct 2025
  • Shortest substring with N distinct charactersCodingGiven a string and a number n, return the shortest substring that contains n distinct letters (or say that none exists). Use a sliding window that grows until it holds n distinct…
    Last asked Oct 2025
  • Design a flight search serviceSystem designDesign a service where users search flights by origin, destination and dates and see prices and availability. Cover where fare data comes from and how fresh it must be, caching…
    Possibly retired
  • Valid palindrome IICodingReturn whether a string can become a palindrome after deleting at most one character. Walk two pointers inward; at the first mismatch try skipping either side once.
    Possibly retired
  • K closest points to the originCodingGiven points in the plane and k, return the k points nearest to the origin in any order. Start simple (sort by distance), then improve with a size-k max-heap or quickselect and…
    Possibly retired
  • Range sum of a BSTCodingGiven the root of a binary search tree and a range low, high, return the sum of the values inside the range, skipping subtrees that cannot contain any. Variants reported: return…
    Possibly retired
  • Design keyword search over postsSystem designUsers publish short posts or status updates; others search them by keyword, including over years of history, and see the matching posts ranked. Cover ingesting new posts into the…
    Possibly retired
  • Maximum overlap of closed intervalsCodingGiven a list of closed intervals start, end (both endpoints included), return the largest number of intervals that contain one point on the number line. Two intervals that only…
    Possibly retired
  • Binary tree level order traversalCodingReturn a binary tree's values level by level, each level from left to right, using a queue. Be ready to print each level on its own line or to number the nodes in that order.
    Possibly retired
  • Check that each tree node equals its subtree's averageCodingFor a binary tree, decide whether every node's value equals the average of the values in its subtree (or of the nodes below it, as the interviewer defines it), or count the nodes…
    Possibly retired
  • Convert a BST to a sorted circular doubly linked listCodingRearrange a binary search tree in place into a circular doubly linked list in sorted order, reusing the left and right pointers as previous and next. Do an in-order traversal that…
    Possibly retired
  • Cutting ribbonsCodingYou have pieces of wood (or ribbon) of given lengths and need k pieces of equal length; you may cut but not join. Return the longest length that still yields at least k pieces…
    Possibly retired
  • Design tables and metrics for product event dataSystem designFor a product feature, define the metrics that show whether it is healthy, then design the event and summary tables that compute them: grain, keys, dimensions, and how the tables…
    Possibly retired
  • Group shifted stringsCodingTwo strings belong together if shifting every letter of one by the same amount (wrapping z to a) gives the other. Group a list of strings by this relation, keying each string by…
    Possibly retired
  • Left and right views of a binary treeCodingReturn the left view of a binary tree (the first node seen at each level from the left) and the right view (the last node at each level). Write it with breadth-first search, then…
    Possibly retired
  • Longest substring without repeating charactersCodingReturn the length of the longest substring with no repeated character, with a sliding window that remembers the last index of each character.
    Possibly retired
  • Max area of islandCodingGiven a binary matrix, return the area of the largest island: a group of 1 cells connected up, down, left or right (diagonals don't connect).
    Possibly retired
  • Merge sorted arrayCodingMerge a sorted array into another sorted array that has room at its end, in place, and give the complexity. Follow-up reported: could you merge starting from the front of each…
    Possibly retired
  • Minimum window substringCodingGiven strings s and t, return the shortest substring of s that contains every character of t, counting repeats, or an empty string if there is none. Grow the window until it…
    Possibly retired
  • Missing rangesCodingGiven a sorted list of distinct integers inside a fixed range (for example 0 to 99), list the gaps. In the reported variant a gap of up to three numbers is written out number by…
    Possibly retired
  • Remove runs of repeated characters (1D candy crush)CodingRepeatedly remove every run of at least k equal adjacent characters from a string until none is left, and return what remains. Removing a run can join two runs into a new one…
    Possibly retired
  • Reverse a linked list between nodes with equal valuesCodingIn a singly linked list, whenever two nodes hold the same value, reverse the part of the list between them. Clarify with the interviewer which pairs count and whether the matching…
    Possibly retired
  • UTF-8 validationCodingGiven a list of integers, each standing for one byte, decide whether they form a valid UTF-8 encoding: read the leading bits of each first byte to know how many continuation bytes…
    Possibly retired
  • Cheapest round trip from departure and return faresCodingYou get two arrays of daily fares, one for departing flights and one for return flights. Choose a departure day and a later return day to minimize the total price. One pass that…
    Possibly retired
  • Count the words in a documentCodingGiven the text of a document, return how many words it contains. The real work is the definition: agree with the interviewer what counts as a word (is "it's" one word or two, what…
    Possibly retired
  • Counter class with add, count and removeCodingWrite a class that stores strings with how many times each was added. Support add(s), count(s) and remove(s). Follow-ups: return the total count across everything stored, and how…
    Possibly retired
  • Course schedule: detect a cycle and return an orderCodingCourses have prerequisites. Decide whether all courses can be finished (the prerequisite graph has no cycle), and if so return a valid order to take them. Use depth-first search…
    Possibly retired
  • Customers who rented in two consecutive weeks (SQL)CodingAmong customers who made purchases in two consecutive full weeks of 2024, return the customer with the most copies rented in the first of those two weeks. Expect to extract the…
    Possibly retired
  • Design a large-scale MoE pretraining pipelineML designDesign the training setup for pretraining a mixture-of-experts language model across many GPUs. Cover how experts and other layers are parallelized, token routing and load…
    Possibly retired
  • Design an asynchronous RL post-training systemML designDesign a system for post-training a large language model with reinforcement learning where generation (rollouts) and training run asynchronously. Cover how rollout workers and…
    Possibly retired
  • Find K pairs with the smallest sumsCodingGiven two sorted arrays and k, return the k pairs (one number from each array) with the smallest sums. Start a min-heap with pairs formed from the first elements and push the next…
    Possibly retired
  • Kth smallest element in a sorted matrixCodingEvery row and every column of an n x n matrix is sorted ascending. Return the k-th smallest value. Compare a min-heap over the rows with binary search on the value range.
    Possibly retired
  • Permutations of a list with duplicatesCodingReturn every distinct ordering of a list that may contain repeated values, with no duplicate orderings in the output. Sort first and skip a value at a position when an equal value…
    Possibly retired
  • Recruiter screen: motivation, background and logisticsBehavioralA short first call with a recruiter: a few standard behavioral questions about your background and why you want the role, then timeline, location and compensation expectations…
    Possibly retired
  • Shortest path in an unweighted graph: BFS versus DFSCodingExplain how to find the shortest path between two nodes of an unweighted graph and its time complexity, without necessarily writing code. Then compare: why breadth-first search…
    Possibly retired
  • Top k largest elementsCodingGiven an integer array nums and an integer k, return the k largest elements of nums. You may return them in any order. The result is a multiset. If a value appears several times…
    Possibly retired
  • Validate checkout and return logsCodingGiven a log of events per book, each a checkout or a return (a true/false flag), check that every book's events alternate correctly: a book must be checked out before it can be…
    Possibly retired
  • Design a model that predicts posts a user will dislikeML designDesign a model for a news feed that predicts which posts a user would dislike or hide, so ranking can show fewer of them. Cover the labels (explicit negative feedback is rare)…
    Possibly retired
  • Scaled dot-product attention from scratchCodingWrite scaled dot-product attention by hand: from queries, keys and values, compute the scores, scale them by the square root of the key size, apply an optional mask, take a…
    Possibly retired
  • Contains duplicate within distance KCodingReturn whether an array has two equal values whose indices differ by at most k. Start with a map from value to its last index. Follow-up: cut the extra space to O(k) by dropping…
    Possibly retired
  • Expression add operatorsCodingGiven a string of digits and a target, insert +, - or between digits so that the expression evaluates to the target, and return every such expression. Handle multiplication…
    Possibly retired
  • Design an image generation productAI systemDesign a system that generates images (and possibly other media) from user prompts. Cover the model pipeline, serving on GPUs with acceptable latency and cost, safety filtering of…
    Possibly retired
  • Median of two sorted arraysCodingGiven two sorted arrays, return the median of their combined values. Start from merging and its cost, then reach logarithmic time with a binary search over the partition of the…
    Possibly retired
  • Flatten a binary tree to a linked listCodingFlatten a binary tree in place into a chain that follows pre-order, using the right pointers as next and setting every left pointer to null.
    Possibly retired
  • Buildings with an ocean viewCodingBuildings stand in a row with the ocean to the right. A building has a view if every building to its right is shorter. Return the indices with a view in increasing order, scanning…
    Possibly retired
  • Custom sort stringCodingGiven an order string of distinct letters and a string s, rearrange s so its letters follow the order given; letters missing from order may go anywhere. Count letters and emit…
    Possibly retired
  • Top 10 songs per user from listening historySystem designDesign a system that shows every user of a music service their ten most-played songs, computed from their listening history. Cover ingesting play events, the aggregation (batch…
    Possibly retired
  • Valid palindrome IIICodingReturn whether a string can become a palindrome by deleting at most k characters. Relate it to the longest palindromic subsequence and solve it with dynamic programming.
    Possibly retired
  • Car poolingCodingA vehicle with a given capacity drives in one direction. Each trip is passengers, start, end. Return whether all trips fit without ever exceeding capacity, by sorting pickup and…
    Possibly retired
  • Count active follow connections in SQLCodingA table records follow and unfollow events between users over time. Write SQL that returns the current number of active follow connections, taking each pair's latest event into…
    Possibly retired
  • Nth node from the end of a linked listCodingReturn (or remove) the n-th node from the end of a singly linked list in one pass, moving a lead pointer n steps ahead of a trailing one.
    Possibly retired
  • Paginated, sortable React tableCodingBuild a React table component that takes its column definitions as data, sorts by a column when its header is clicked and pages through rows. Keep the component split and the…
    Possibly retired
  • Product of array except selfCodingReturn an array where each position holds the product of every other element, without division and in linear time, using prefix and suffix products; then do it with constant extra…
    Possibly retired
  • Recommend accounts your followees followCodingGiven a dictionary from each user to the people they follow, for example {A: B, C, B: C, D, C: E}, return for a user every account followed by the people they follow that they…
    Possibly retired
  • Toeplitz matrixCodingReturn whether every diagonal of a matrix running from top-left to bottom-right holds a single repeated value, comparing each cell with the one up and to its left.
    Possibly retired
  • Carpool ride metrics in SQLCodingFor a ride-sharing product that lets riders share a car, write SQL over ride and request tables for a series of metrics, such as completed shared rides per day and averages per…
    Possibly retired
  • Find bugs and slow renders in a React appCodingYou get a small React codebase with several bugs and performance problems. Find and fix them: unnecessary re-renders, event listeners that are never cleaned up, and similar…
    Possibly retired
  • Robot room cleanerCodingA cleaning robot is placed in an unknown room with obstacles. Using only move(), turnLeft(), turnRight() and clean(), clean every reachable cell. Explore by depth-first search…
    Possibly retired
  • Cumulative user metrics with a full outer joinCodingMaintain a cumulative table of per-user metrics day by day: combine yesterday's cumulative snapshot with today's activity using a full outer join, so users with no activity today…
    Possibly retired
  • Top three items per category in SQLCodingFor content in many categories, return the top three items in each category by an engagement measure, handling ties deliberately. Use a ranking window function partitioned by…
    Possibly retired
  • Sliding window medianCodingGiven an array and a window size k, return the median of every window as it slides one step at a time. Keep two heaps (or a sorted container) and remove elements leaving the…
    Possibly retired
  • Add two decimal number stringsCodingAdd two non-negative numbers given as strings and return the sum as a string, digit by digit with a carry. Then support a decimal point: pad the fractional parts to the same…
    Possibly retired
  • Closest binary search tree valueCodingGiven a binary search tree and a target number (possibly fractional), return the value in the tree closest to it, walking down one path from the root.
    Possibly retired
  • Palindrome permutationCodingReturn whether some rearrangement of a string is a palindrome: at most one character may occur an odd number of times. Follow-up: build and return one such palindrome.
    Possibly retired
  • Target indices after sorting an arrayCodingReturn the indices at which a target would sit once the array is sorted. In the reported version the array is already sorted and the answer must take logarithmic time: binary…
    Possibly retired
  • All nodes at distance K in a binary treeCodingGiven a binary tree, a target node and k, return every node exactly k edges away from the target. Add parent links (or turn the tree into an undirected graph), then search outward…
    Possibly retired
  • Compare two linked lists of string chunksCodingTwo singly linked lists each hold pieces of text, one piece per node (in the reported version, one character per node stored as a string). Decide whether both lists spell the same…
    Possibly retired
  • Fewest new paths to connect every islandCodingYou have N named islands and a list of existing two-way paths between them. Return the fewest new paths needed so every island can reach every other: count the connected…
    Possibly retired
  • Find a local minimum in an arrayCodingReturn the index of any element smaller than its neighbours (the ends compare with their one neighbour). A linear scan works; the follow-up is logarithmic time by binary searching…
    Possibly retired
  • Insert delete getrandom O(1)CodingDesign a set with insert, remove and getRandom (each element equally likely), all in average constant time, using an array of values and a map from value to index; remove by…
    Possibly retired
  • Max stackCodingDesign a stack that also supports peekMax() and popMax() (removing the top-most copy of the largest value), along with push, pop and top. Compare a two-stack design with a doubly…
    Possibly retired
  • Meeting rooms IICodingGiven meeting start and end times, return the fewest rooms needed so no two overlapping meetings share a room, with a min-heap of end times or by sweeping sorted starts and ends.
    Possibly retired
  • Multiply stringsCodingMultiply two non-negative integers given as strings and return the product as a string, without converting them to built-in big integers. Use grade-school multiplication into an…
    Possibly retired
  • Shortest bridgeCodingA grid holds exactly two islands. Return the fewest water cells to flip to connect them: mark one island with depth-first search, then expand from all its cells with breadth-first…
    Possibly retired
  • Longest increasing subarray and subsequenceCodingTwo warm-ups on one array: 1. The longest strictly increasing contiguous run (for 1, 2, 1, 2, 3 it is 1, 2, 3). 2. The longest increasing subsequence, whose elements need not be…
    Possibly retired
  • Check whether a binary tree is a max-heapCodingDecide whether a binary tree is a valid max-heap: it must be complete (checked level by level) and every node must be at least as large as its children.
    Possibly retired
  • Same-value region from a start pixel, and its borderCodingAn image is a grid of 0s and 1s. From a starting pixel, find every connected pixel with the same value. Follow-up: return the region's border, the neighbouring pixels that are not…
    Possibly retired
  • Merge two sorted linked listsCodingMerge two sorted linked lists into one sorted list and return its head, reusing the existing nodes. Do it iteratively with a dummy head, then discuss the recursive version.
    Possibly retired
  • Design a distributed key-value storeSystem designStore and serve billions of keys with low latency, partitioned across machines and replicated to survive failures, with tunable consistency.
    Possibly retired
  • Design batch and streaming ETL pipelinesSystem designA data engineering onsite round on pipelines: design how product events are ingested, cleaned and aggregated into tables that analysts use, first as daily batch jobs and then as…
    Possibly retired
  • Design DropboxSystem designSync files across a user's devices and shared folders: upload large files reliably, transfer only what changed, and handle conflicting edits.
    Possibly retired
  • Maximum swapCodingGiven a non-negative integer, swap two of its digits at most once to make the largest number possible. Record the last position of each digit, then find the first digit that has a…
    Possibly retired
  • Bracket the first matching substring in each wordCodingImplement wrapsubstrings(s: str, elements: liststr) - str. s is a sentence of words separated by single spaces. elements is a list of strings. For each word in s, find the first…
  • Compress an n-ary tree by promoting childrenCodingEach node of an n-ary tree holds a unique integer value and an ordered list of children. You are given the root and a list compressednodes of values. Implement compress(root…
  • Count distinct values in every sliding windowCodingGiven an integer array nums and a window size k, return a list with one entry per contiguous window of length k (there are len(nums) - k + 1 of them). Each entry is the number of…
  • Design a hotel booking systemSystem designSearch hotels by place and dates, show availability and prices, and book rooms without double-booking, including holds and cancellations.
  • Design a Slack-like chat systemSystem designWorkspaces, channels, threads and direct messages with real-time delivery, unread state, search and history, for large companies.
  • Design Google DocsSystem designMany people edit the same document at once and see each other's changes and cursors live, with offline edits and full version history.
  • Design SpotifySystem designStream music to hundreds of millions of listeners: catalog, search, playlists, smooth playback over bad networks, and offline downloads.
  • Design typeahead suggestionsSystem designSuggest completions as the user types into a search box, within tens of milliseconds, ranked by popularity and fresh with trending queries.
  • Fewest coins that cover every amount up to a limitCodingYou are given a list of coin denominations (positive integers) and an integer maxamount. You may take any number of coins of each denomination. Choose a multiset of coins so that…
  • Find bottleneck dependencies in a parallel buildCodingYou are given n build targets numbered 0 to n - 1 and a list of directed edges edges. An edge u, v means target v cannot start building until target u has finished. The graph has…
  • Longest palindrome from equal-length wordsCodingYou are given a list of words. Every word has the same length k and uses lowercase letters. The list can contain duplicates. Pick some of the words (possibly none) and join them…
  • Match words against a letter patternCodingGiven a pattern string and a list of words, decide for each word whether it follows the pattern. A word follows the pattern when it has the same length as the pattern and the…
  • Median of a large unsorted array in linear timeCodingYou are given a very large, unsorted list of integers nums. Return its median. - If len(nums) is odd, the median is the middle value once the list is sorted. - If len(nums) is…
  • Remove parentheses from a plus/minus expressionCodingWrite a function simplify(expr: str) - str that removes every parenthesis from an expression and gives each term the sign it really has. Input. A valid expression made of: -…
  • Split an array into two halves with equal sumsCodingYou are given an array nums of positive integers. Find an index i that splits it into two non-empty contiguous parts with the same sum: - the left part is nums0..i (it includes…