Google onsite coding interview

Round 5 of 8 · 144 questions reported

See the whole loop
Length
45 min
Format
Usually two rounds, mostly in person: whiteboard plus a Chromebook with Google Docs
They grade
Same as the first round
AI use
No AI (a pilot code-comprehension round lets candidates use Gemini)

Questions Google asks in this round 144

  • 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…
    Last asked Sep 2026
  • Earliest time everyone is connectedCodingA time-sorted log has lines such as t3 Bob shared-ride-with Charlie. Sharing a ride connects two riders, and connection carries through other riders. Given the log and the list of…
    Last asked Sep 2026
  • Fewest rental cars for a set of reservationsCodingEach rental reservation has a start time and an end time. Find the fewest cars that can serve every reservation, and assign each reservation to a car. Follow-ups from other…
    Last asked Aug 2026
  • Rate-limited event loggerCodingBuild a logger that rate-limits repeated events in a stream. Each event has a string name and an integer timestamp in seconds. Timestamps arrive in non-decreasing order, and…
    Last asked Sep 2026
  • Nested list weight sum, parsed from a stringCodingA nested list holds integers and other lists. Return the sum of every integer multiplied by its depth, where the outermost list is depth 1. One version hands you the nested list…
    Last asked Aug 2026
  • Players whose rank is fixed by game resultsCodingThere are n players, numbered 0 to n - 1, and a list of game results where a pair (u, v) means player u beat player v. Assume the results come from one strict ranking, so there…
    Last asked Aug 2026
  • Count how many rectangles cover each grid cellCodingRectangles are laid on a grid, each one an update that covers a block of cells. Return, for every cell, how many rectangles cover it, without walking every cell of every…
    Last asked Jul 2026
  • Schedule tasks with cooldownsCodingTasks of several types run one per time unit, and two tasks of the same type must be separated by a cooldown. Arrange the tasks so the rule holds and the total time (idle slots…
    Last asked Jul 2026
  • Tic-tac-toe with K playersCodingImplement tic-tac-toe for k players on an n x n board. Players take turns placing their marks. However large the board is, a player wins as soon as they have three of their marks…
    Last asked Jul 2026
  • Most frequent IP addresses in a file too big for memoryCodingA log file of IP addresses is far larger than memory. Find the most frequent address, then the top K. Explain how you split the work into pieces that fit in memory, count each…
    Last asked Jun 2026
  • Evaluate nested add and sub expressionsCodingImplement evaluate(expression: str) - int, which evaluates a string written in a small function-call language. An expression is either: - an integer literal, possibly negative…
    Last asked Jun 2026
  • Build a weighted binary tree from character countsCodingGiven a string s of letters ('A'-'Z', 'a'-'z'; case matters), build a binary tree that summarizes how often each character appears. Each node has three fields: ch, count, and two…
    Last asked Jun 2026
  • Restaurant waitlist managerCodingBuild a waitlist for a restaurant: parties join with their size, may leave before being seated, and when a table frees up you seat the party that should get it. Keep each…
    Last asked Mar 2026
  • Next-word predictor from bigram countsCodingYou get training sentences as lists of words, for example "a", "b", "c", "a", "s", "d". 1. Count, for every word, which words follow it and how often. 2. predict(word) returns the…
    Last asked Feb 2026
  • K-th greatest value in every growing prefixCodingYou are given arr, a permutation of the integers 1 to n (each value appears exactly once), and an integer k with 1 <= k <= n. Read arr from left to right. After reading each…
    Last asked Feb 2026
  • Running median of a streamCodingNumbers arrive one at a time; after each, report the median of everything seen so far. Use two heaps. Follow-ups: the values come from a small range (use counts instead of heaps);…
    Last asked Dec 2025
  • Design an elevator control systemOO designModel a bank of elevators: hall and car requests, a dispatching strategy, direction and door states, and capacity limits.
    Possibly retired
  • URL router with single-segment wildcardsCodingBuild a small URL router. - A pattern and a path are split on / into segments. Empty segments are ignored, so /a/b/ is the same as /a/b, and / is the empty path. - A p
    Last asked Oct 2026
  • Reachability in a time-indexed train scheduleCodingGiven train departures and arrivals with timestamps, decide whether a destination is reachable from a start station without time travel. Reported on 1point3acres' Glean bank;…
    Last asked Oct 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 Sep 2026
  • Binary search tree keys within a rangeCodingGiven a binary search tree (as a level-order list with nulls for missing children) and an inclusive range low, high, return every key in the range in ascending order. Skip the…
    Last asked Sep 2026
  • Customer support dispatcher for agents who take breaksCodingBuild the core of a dispatcher for a customer support team. Customers get in touch and wait. Human agents sign in, serve one request after another, and sometimes leave, even in…
    Last asked Sep 2026
  • Find timed-out RPC calls from start and end logsCodingA service writes one log record when a remote procedure call starts and another when it ends, and the log is in time order. Given the log and a timeout, report every call that ran…
    Last asked Sep 2026
  • Lowest common manager in an org chartCodingA company's reporting structure is a rooted tree. Each person is an Employee with a unique name and a list reports of the people who report to them directly. The root is the CEO…
    Last asked Sep 2026
  • Next greater element in a circular arrayCodingYou get an integer array that wraps around: after the last element, scanning continues from the first. For every index, return the first value strictly greater than its own that…
    Last asked Sep 2026
  • Extensible spreadsheet range aggregatesCodingDesign a spreadsheet API with getsum, getmax and getmin over a range of cells, where a cell holds either a value or a formula. Show how someone adds a new aggregate later without…
    Last asked Sep 2026
  • Largest rectangle from a point set, any orientationCodingYou get distinct points with integer coordinates. Choose four of them that are the corners of a rectangle, where the sides do not have to be parallel to the axes. Return the…
    Last asked Sep 2026
  • Weighted job schedulingCodingEach job has a start time, an end time and a profit. Choose jobs that do not overlap to make the most profit. Sort jobs by end time; for each job, binary search for the last job…
    Last asked Sep 2026
  • Count grid paths through ordered checkpointsCodingAn n x m grid. A path starts at the bottom-left cell and ends at the bottom-right cell. Each move goes one column to the right and either one row up, the same row, or one row…
    Last asked Sep 2026
  • Jump game: can you reach the last index?CodingYou get a list of non-negative integers and start at index 0. numsi is the longest jump you may make from index i: you can move forward to any index up to i + numsi. Return…
    Last asked Sep 2026
  • Fewest nodes on a path when one vertex may be brokenCodingFind the path between two nodes of a graph that passes through the fewest nodes, and return that count. One vertex may be broken and unusable: handle both the case where it…
    Last asked Sep 2026
  • Predict the most frequent next word in constant timeCodingFrom a body of text, build a predictor that, given a word, returns the word that most often came right after it. Each prediction must take O(1) time. Discuss how you keep that…
    Last asked Sep 2026
  • Bookshelf with book CRUD and a stable bookmarkCodingDesign a bookshelf that supports adding, reading, updating and removing books, plus a bookmark that keeps pointing at the right book while books are added or removed around it.
    Last asked Aug 2026
  • Arrange crops into connected regions of a gardenCodingA rectangular garden has N rows and M columns, and there are K crop types. Crop i must take exactly counti cells, and the counts add up to N M. Return any planting that uses every…
    Last asked Aug 2026
  • Can two ordered sequences be merged into one order?CodingYou get two arrays of integer labels. Each array sets ordering rules: a label must come before every label that follows it in the same array. Decide whether one ordering exists…
    Last asked Aug 2026
  • Dependency-safe deletion orderCodingEntities have parent-child relationships, and the relationships limit what can be deleted when. Model the relationships as a graph and return an order that deletes everything…
    Last asked Aug 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 Aug 2026
  • Insert plus, times and parentheses to reach a targetCodingYou are given an equation whose left side is a sequence of non-negative integers with no operators between them, and whose right side is a target. For example: 2 3 4 = 20. Insert…
    Last asked Aug 2026
  • Highway toll checkpoints from plate logsCodingA highway has numbered toll checkpoints. Each checkpoint's name contains its position as a number, for example "A1" is at position 1 and "CP12" is at position 12. Ignore every…
    Last asked Aug 2026
  • Longest equal length for cutting wood into K piecesCodingYou get pieces of wood of different lengths. Cut them into at least K pieces that all have the same length; leftover bits may be thrown away. Return the largest length that works…
    Last asked Aug 2026
  • Fewest road reversals in a directed networkCodingA road network has one-way roads. Travelling a road against its direction counts as a violation. Find a route between two given cities with as few violations as possible.
    Last asked Jul 2026
  • Days when the whole team is freeCodingA team is planning an offsite over a window of numdays days, numbered from 1 to numdays. Each team member has entered busy blocks as triples (personid, startday, endday). Both…
    Last asked Jun 2026
  • Deterministic task execution orderCodingGiven tasks and their dependencies, return an order to run them that respects every dependency and comes out the same every time for the same input, by a fixed rule for breaking…
    Last asked Jun 2026
  • Every ordered sum of 1s and 2s that makes nCodingGiven n, list every ordered sequence of 1s and 2s that adds up to n (so 1+2 and 2+1 are different), and say how many there are.
    Last asked Jun 2026
  • Find a pattern across the leaf text of a binary treeCodingEach leaf of a binary tree holds a piece of text. Read from left to right, the leaves spell one long string. Decide whether a given pattern appears in that string, including when…
    Last asked Jun 2026
  • Longest path of equal-valued tree nodesCodingGiven a binary tree, return the length of the longest path in which every node has the same value. The path may pass through any node and need not include the root; agree with the…
    Last asked Jun 2026
  • Boolean expression tree with leaf flipsCodingA tree's leaves hold true or false and its inner nodes are boolean operators. Evaluate the tree, then find the fewest leaf flips that make the root come out to a wanted value.
    Last asked Jun 2026
  • Stream of points: remove any pair within a distanceCodingPoints arrive one at a time. When a new point is within a given distance of a point already stored, remove that pair; otherwise store the new point. Keep each step fast as the…
    Last asked Jun 2026
  • Employee shift timeline tableCodingEach shift is given as name, start, end, with integer times and start <= end. A shift covers the half-open interval start, end). One employee may have several shifts, and they may…
    Last asked Jun 2026
  • Merge two named treesCodingEach tree node is a dictionary with a name, an integer value and an ordered list of children. Given two such trees t1 and t2, build a new merged tree that follows t1's nodes and…
    Last asked May 2026
  • Flower placement and directory deletionCodingTwo problems in one round: 1. A row of plots has some flowers planted already, and no two flowers may be next to each other. Decide whether n more flowers can be planted. 2. Given…
    Last asked May 2026
  • Does a word exist as a path in a graph?CodingEvery node of a graph holds a letter. Decide whether a word can be spelled by walking along edges, one letter per node. Agree on whether a node may be used twice, and give the…
    Last asked May 2026
  • Longest consecutive sequence path in a binary treeCodingReturn the length of the longest parent-to-child path in a binary tree in which each value is exactly one more than the value before it. Follow-up: the path may go in any…
    Last asked Apr 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 Apr 2026
  • Longest water-flow path with momentumCodingYou get an m x n matrix of heights. Water starts at any cell and moves to a neighboring cell up, down, left or right. Whether it may move on depends on the heights and on the…
    Last asked Apr 2026
  • Blind maze escape: one command sequence for every startCodingA robot is somewhere in a grid maze of walls (), open cells (.) and an exit (E), but you do not know which open cell it starts on. It obeys the commands U, D, L and R, each moving…
    Last asked Apr 2026
  • Count ways to spell a word with element symbolsCodingGiven the symbols of the chemical elements and a word, count the ways to write the word as a sequence of element symbols, ignoring case. For example, "Physics" splits as…
    Last asked Apr 2026
  • Count islands with diagonal connectivityCodingCount the islands in a grid of land and water where land cells are joined in all eight directions, diagonals included.
    Last asked Apr 2026
  • Process login logs split across shardsCodingLogin records are spread across several shards. Combine them to answer questions about users' logins, merging the shards correctly and efficiently, and explain how your approach…
    Last asked Apr 2026
  • Maximum sum of a subarray whose ends differ by kCodingGiven an integer array and k, a subarray is good when its first and last elements differ by exactly k. Return the largest sum of a good subarray, or 0 if there is none.
    Last asked Apr 2026
  • Remove one link and split a gold chain evenlyCodingAn array describes a gold chain; each number is the weight of one link. You must remove one link, join the chain back together, and then cut it into two pieces of equal weight for…
    Last asked Apr 2026
  • Find the shortest queue with few callsCodingYou can learn the length of each of several queues only through a call that is expensive. Find the shortest queue while making as few calls as you can, and explain the trade-off…
    Last asked Apr 2026
  • Detonate the most bombs in a chain reactionCodingEach bomb has a position and a blast radius. Setting one off detonates every bomb within its radius, and those set off others in turn. Return the largest number of bombs that can…
    Last asked Apr 2026
  • Ads retrieval service using a heapCodingBuild a service that returns the best ads for a request, ranked by score, using a heap. Support adding and removing ads, and discuss the cost of each operation.
    Last asked Mar 2026
  • Busiest meeting room after simulated bookingsCodingSimulate booking meetings into a fixed set of rooms and return the room that held the most meetings. Agree on the rules first: which free room a meeting takes, and what happens to…
    Last asked Mar 2026
  • Top K largest distinct valuesCodingGiven an array that may contain repeats, return the k largest distinct values.
    Last asked Mar 2026
  • Apply range overwrite queriesCodingYou get an array and a list of queries (start, end, k), each setting every element between start and end to k. Return the array after all queries. The interviewer wanted the…
    Last asked Feb 2026
  • Editable sequence with a markerCodingDesign a sequence of elements with a marker on one of them. Support adding or removing a run of elements at a position, moving a run from one position to another, and setting a…
    Last asked Feb 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 Feb 2026
  • Assign dorm rooms by student preferenceOO designYou get student IDs and room IDs. Each student prefers a two-person room or a four-person room. Design a system that assigns students to rooms according to their preferences. The…
    Last asked Feb 2026
  • Cheapest common ancestor in a treeCodingNodes of a tree carry costs. Given a set of nodes, find the common ancestor of all of them that has the lowest cost.
    Last asked Feb 2026
  • Decaying power levels across a graphCodingSome nodes of a graph are power sources with a starting level, and power weakens as it travels along edges. Compute the power level that reaches every node (when several sources…
    Last asked Feb 2026
  • Fewest lines to wrap a sentenceCodingGiven a non-empty string text and a positive integer maxwidth, return the fewest lines needed to lay out all the words of text. Implement: Rules: - A word is a run of non-space…
    Last asked Feb 2026
  • Decode a string with nested repeat countsCodingAn encoded string uses k... to mean the bracketed part repeated k times, and brackets may nest, for example 3a2c decodes to accaccacc. Return the decoded string. Use a stack or…
    Last asked Feb 2026
  • Sum of all consecutive-step subarraysCodingCall a subarray consecutive when each element is exactly one more than the one before it, or each is exactly one less (a single element counts). Return the sum of the values of…
    Last asked Feb 2026
  • Matrix transforms and what eigenvalues meanCodingImplement basic matrix operations used to transform points (multiply, rotate, scale, compose transforms). Then explain eigenvalues and eigenvectors: what they say about a…
    Last asked Feb 2026
  • Best-matching binary pattern with wildcardsCodingYou get a list of patterns over 0, 1 and a wildcard that matches either bit, and a query string of bits. Return the pattern that matches the query best. Agree on what "best" means…
    Last asked Jan 2026
  • 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 Jan 2026
  • Design a poker gameOO designDesign the classes for a poker game: cards, deck, players, hands, betting rounds, and deciding the winner. Show the main methods, how a round flows from deal to showdown, and how…
    Last asked Jan 2026
  • All subsets of a list with duplicatesCodingReturn every distinct subset of an integer list that may contain duplicate values, with no subset repeated. Sort first and skip duplicates during backtracking, and give the output…
    Last asked Jan 2026
  • Shortest delivery route that avoids dangerous stopsCodingA delivery network is a graph of stops, and some stops are marked dangerous. Find the shortest route from the depot to the destination that avoids the dangerous stops (or limits…
    Last asked Dec 2025
  • Top K similar movies from a similarity graphCodingMovies are nodes with a rating, and an edge links two similar movies; similarity carries across edges. Given a movie and k, return the k highest-rated movies reachable from it…
    Last asked Dec 2025
  • Three sum: unique value triplesCodingReturn every unique triple of values from an integer array that sums to zero (or to a given target), with no duplicate triples in the output. Sort, then fix one value and move two…
    Last asked Dec 2025
  • Two sum with the lexicographically smallest index pairCodingGiven an integer array and a target, return a pair of indices i < j whose values add up to the target. When several pairs work, return the lexicographically smallest one (smallest…
    Last asked Dec 2025
  • Max profit when taking a value skips aheadCodingYou walk an array of positive integers from index 0. At index i you either take arri and jump to index i + 1 + arri, or skip it and move to i + 1. Return the largest total you can…
    Possibly retired
  • Autocomplete with a trieCodingBuild an autocomplete: insert words (optionally with counts) into a trie, and for a prefix return the matching words, for example the most popular few. Make sure results are…
    Possibly retired
  • Count user sessions from an activity logCodingEach log line is timestamp, user, action. A session is a run of a user's actions with no gap longer than a given timeout. Return the number of sessions per user. Parse robustly…
    Possibly retired
  • From 0/1 knapsack to bounded knapsackCodingStart with the 0/1 knapsack: items with weights and values, a capacity, and each item used at most once; return the best total value. Then each item may be used up to a given…
    Possibly retired
  • Group movies by graph traversalCodingMovies are linked to each other (for example by shared attributes or similarity pairs). Put every movie into its group, where a group is a set of movies connected through links…
    Possibly retired
  • Make your interview solution production-readyCodingAfter solving a coding problem, the interviewer asks what you would change before the code went to production. Discuss input validation and error handling, tests, logging and…
    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
  • Robust Python generator, then a weighted oneCoding1. Write a Python generator that yields the numbers of an input list, with unit tests. Handle edge cases such as None values and an empty list. 2. Change it to yield numbers from…
    Possibly retired
  • Split a two-colour necklace fairly with two cutsCodingA necklace (a circle of beads) holds two kinds of gems, each in an even count. With at most two cuts, divide it into pieces and hand them to two people so each gets the same…
    Possibly retired
  • Troubleshoot high CPU, slow responses and DNS failuresCodingA production service shows high CPU, rising latency, and some requests failing on name resolution. Explain step by step how you investigate each: the tools and commands you would…
    Possibly retired
  • Validate a bracket string after digit-driven deletionsCodingA string mixes brackets and digits, for example (())2)1(). Each digit d requires removing exactly d of the brackets that come before it. Decide whether the deletions can be chosen…
    Possibly retired
  • N-th license plate in sorted orderCodingLicense plates follow a fixed format, for example three letters A-Z then three digits 0-9 (AAA000). Sorted in dictionary order, what is the n-th plate? Compute it directly by…
    Possibly retired
  • What if the input is too big for memoryCodingA common follow-up to a coding question: what changes if the input is very large? Explain how you would answer it: whether the data still fits in memory and how to cut extra…
    Possibly retired
  • Delete a node from a binary search treeCodingGiven the root of a binary search tree and a key, delete the node with that key and return the root, keeping it a valid BST. Handle the cases of a leaf, a node with one child, and…
    Possibly retired
  • ATM queue exit orderCodingThere are n people waiting in a single line at an ATM. They are numbered 1 to n from the front of the line to the back. You are given an integer array amounts, where amountsi is…
  • Ball picking game: take one or two from the frontCodingBalls stand in a single line. Each ball has an integer value, which may be positive, zero, or negative. Two players take turns, and player 1 moves first. Both start with a score…
  • Cake order fulfillment checkCodingA bakery keeps three kinds of cake. Its stock is an array stock of length 3, where stocki is how many cakes of type i are on hand. Orders arrive one at a time in the list orders…
  • 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…
  • Count intervals covering a pointCodingBuild a data structure over a fixed list of closed intervals on the integer number line that answers many point queries quickly. An interval l, r covers a point x when l <= x <=…
  • Dot grid game winnerCodingTwo players play a dots-and-boxes style game on a 9 x 9 grid of dots. The grid has 8 x 8 = 64 unit squares ("boxes"). Rows and columns are numbered 0 to 8. You are given moves, a…
  • 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…
  • Fewest range increments to build a target arrayCodingYou start with an array of n zeros. In one move you choose a contiguous range l, r and add 1 to every element in it. Given a non-negative integer array target of length n…
  • Greatest three-digit subsequenceCodingYou are given a list digits of single digits (each 0–9). Choose at most three of them, keep them in their original order, and read them left to right as a number. Return the…
  • Grep with context linesCodingImplement a simplified grep. You get a list of text lines, a search string target, and a non-negative integer k. Return every line that contains target, together with up to k…
  • Group duplicate records that share any propertyCodingYou are given a list of records. Each record has a unique integer ID and three properties, for example a name, an email and a phone number: Two records are duplicates when they…
  • 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.
  • Largest island perimeter in a gridCodingYou are given an m x n grid where each cell is either land ("1") or water ("0"). Land cells that touch horizontally or vertically (not diagonally) belong to the same island. Treat…
  • Largest value shared by two BSTsCodingYou are given the roots of two binary search trees, a and b, holding integer values. Return the largest integer that appears in both trees. If the trees share no value, return -1…
  • Longest run of customers a bank can serveCodingA bank opens with initial dollars in its vault (initial = 0). Customers wait in a fixed queue, given as an integer array transactions: a positive value is a deposit and a negative…
  • Max flight distance with limited energyCodingYou are planning a trip over n days. disti is how far you can fly on day i (a non-negative integer). You start with k units of energy, and k is also the most energy you can hold…
  • 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…
  • Peel an N-ary tree one leaf layer per dayCodingEvery day, all leaves of an N-ary tree fall off at the same time. A leaf is a node with no children left. When a node loses its last child, it becomes a leaf and falls on the next…
  • Per-domain sliding-window rate limiterCodingA gateway receives requests one at a time, at most one per second. Each request names a domain. Build a rate limiter that keeps its state between calls and decides, for each…
  • Queue with constant-time min and maxCodingImplement a FIFO queue of integers that can also report its smallest and largest element at any time. Implement the MinMaxQueue class: - MinMaxQueue() creates an empty queue. -…
  • Reachable sum with reusable values and a huge targetCodingGiven a non-empty list nums of positive integers and a target k, return true if some multiset of values from nums sums to exactly k, and false otherwise. You may use each value…
  • Recent search history with a size limitCodingBuild the recent-searches list behind a search box. When the user focuses the box, it shows their most recent distinct searches, newest first. Every search the user runs is…
  • Red and black tile slides and jumpsCodingA strip of cells holds red tiles (R), black tiles (B) and empty cells (). The board is a string such as "RRBB". Movement rules - A red tile only moves right. A black tile only…
  • 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: -…
  • Root of the largest tree in a forestCodingYou are given a list relations. Each entry child, parent says that parent is the direct parent of child. Together the relations form a forest: there are no cycles, and every node…
  • Tallest building between parking lotsCodingA city block is drawn as a rectangular grid of strings. Each tile is one of: - 'P': a parking lot. Its height is fixed at 0. - '-': a lot where a building can go. You choose its…
  • Two cars to their destinations without collisionsCodingA parking robot controls two self-driving cars on a rectangular map. The map is a list of equal-length strings. Each character is one cell: - . is road. - is a wall. Cars cannot…
  • Type a word on a grid keyboard with a jump limitCodingYou are typing a word with one finger on an unusual keyboard: an m x n grid of characters. Moving the finger from cell (r1, c1) to cell (r2, c2) covers a Manhattan distance of r1…
  • Unix find command with pluggable filtersCodingImplement a small version of the Unix find command over an in-memory file system. The file system holds directories and files. Each file has a name and a size in bytes. Its…
  • Valid date from three integers in any orderCodingYou are given three integers a, b and c. Their order is unknown: any one of them may be the year, the month or the day. This covers formats such as yyyy-MM-dd, MM-dd-yyyy and…