Two coding problems in CoderPad, about 20 minutes each
They grade
Bug-free code, talking through it, and testing edge cases yourself
AI use
Usually no AI; some newer screens are AI-assisted
Questions Meta asks in this round 97
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…
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
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
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
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
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
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
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
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
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
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…
Valid palindrome after deleting at most one characterCodingReturn whether a string can become a palindrome by deleting at most one character. Walk two pointers inward and, at the first mismatch, try skipping either side.
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
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
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
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
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
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
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
Merge intervalsCodingGiven a list of intervals (for example time ranges), merge every group of overlapping intervals and return the result in sorted order.
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
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
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
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
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
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
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…
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
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
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
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
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
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
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
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
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
Vectorized nearest-neighbour classifier as a linear layerCodingImplement a 1-nearest-neighbour classifier in NumPy with no Python loops. Then rewrite it as the forward pass of a small network, a matrix product plus a bias followed by an…
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
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
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
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…
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Subarrays with power-of-two length and sum between K and 2KCodingGiven an integer array and k, find every contiguous subarray whose length is a power of two and whose sum lies between k and 2k. Use prefix sums so each candidate is checked in…
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
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
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
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
Question types
Meta technical phone screen interview: questions and format