Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1,276–1,300
Given a list of half-open intervals [l, r), remove any interval that is fully contained within another (c ≤ a and b ≤ d) and…
Companies: Google
Last reported Sep 2024
Return all strings in the list that can be formed by concatenating at least two other words from the same list. This is a word-break…
Companies: Amazon
Last reported Sep 2024
Generate the nth term of the "count-and-say" sequence by repeatedly applying run-length encoding to the previous term (starting from "1"), where each step converts consecutive…
Companies: Meta
Last reported Sep 2024
Implement a 5-star rating component using vanilla JavaScript
Companies: Amazon
Last reported Sep 2024
Create a gallery component using vanilla JavaScript that allows users to view images in a grid format. The component should support features such as image…
Companies: Amazon
Last reported Sep 2024
Implement an Accordion component using vanilla JavaScript
Companies: Amazon
Last reported Sep 2024
Given n, compute the minimum days to reduce it to 0 when each day you may either eat 1 orange, or—if n is divisible—eat n/2…
Companies: Google
Last reported Sep 2024
Given a dynamic row of seats with operations that occupy or free individual seats, implement a query that finds and optionally reserves k consecutive available…
Companies: Google
Last reported Sep 2024
Given a total number of days and a list of meeting intervals, return how many days in [1, days] are not covered by any meeting…
Companies: Google
Last reported Sep 2024
Check by level-order traversal that each even-indexed level contains only odd values in strictly increasing order (left-to-right) and each odd-indexed level contains only even…
Companies: Meta
Last reported Sep 2024
Given an undirected weighted graph, determine for each edge whether it lies on at least one shortest path from node 0 to node n-1. This…
Companies: Google
Last reported Sep 2024
Return the number of odd integers in the inclusive interval [low, high]. The solution is a constant-time arithmetic count (no enumeration), suitable for large bounds…
Companies: Google
Last reported Sep 2024
Companies: Google
Last reported Sep 2024
Given an array of stock prices, find the size of the widest interval over which the stock has lost value. Lost value is defined as…
Companies: Google
Last reported Sep 2024
Maximize the total customers a bank can serve given an initial amount of money and an array of customer transactions (deposits and withdrawals).
Companies: Google
Last reported Sep 2024
Read a stream of non-negative integers, stopping when a zero is received. After the stream ends, return a random number from the stream such that…
Companies: Google
Last reported Sep 2024
Given an array of strings 'sentences' and an array of strings 'usernames', find how many times each username appeared in total across all the sentences.
Companies: Google
Last reported Sep 2024
Given an array of size N and an initial capacity integer K, find the maximum sum such that for each element chosen, decrement capacity by…
Companies: Google
Last reported Aug 2024
Given an NxN matrix representing a classroom with students, calculate the minimum probability of getting caught passing notes between a starting point and final point…
Companies: Google
Last reported Aug 2024
Given an n×n binary grid where you may swap any two rows or any two columns, determine whether you can reorder rows/columns to form an…
Companies: Amazon
Last reported Aug 2024
Find the closest blue dot on the circumference of a circle to a given red dot placed outside the circle.
Companies: Google
Last reported Aug 2024
Find the longest non-decreasing contiguous sequence with one substitution. Given an array (e.g. {1, 7, 7, 2, 3, 7, 6, -20}), find the longest non-decreasing…
Companies: Google
Last reported Aug 2024
Sink zeroes down in a binary tree, swapping only values between nodes, ensuring zero nodes are either leaf nodes or have subtrees containing only zero…
Companies: Meta
Last reported Aug 2024
Implement string resolution and variable update functions. Given variable values (e.g. x = 'new', y = '%xworld', z = 'hello'), implement resolveString(string input) to resolve…
Companies: Google
Last reported Aug 2024
Determine if it's possible to make a single vertical cut through a rectangular cake with non-overlapping toppings such that the cut doesn't intersect any toppings…
Companies: Google
Last reported Aug 2024