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,176–1,200
Given a list of manager→employee relationships and a target manager, return all employees who directly or indirectly report to that manager. Build the org graph…
Companies: Amazon
Last reported Dec 2024
Design a spreadsheet API where cells can contain values or formulas that reference other cells, automatically handling updates when dependencies change. Implement dependency…
Companies: OpenAI
Last reported Dec 2024
Compute the diameter (longest path in edges between any two nodes) of an N-ary tree by using a post-order traversal to obtain subtree heights and…
Companies: Google
Last reported Dec 2024
Implement an employee referral API with functionalities: adding referrals, getting referrals, and retrieving kth-level referrals for a specific employee.
Companies: Amazon
Last reported Dec 2024
Find the leftmost index in an integer array where the sum of elements strictly to its left equals the sum strictly to its right, or…
Companies: Google
Last reported Dec 2024
Given an array of terrain heights, V droplets are poured one by one at index K and each droplet greedily rolls to the leftmost lowest…
Companies: Google
Last reported Dec 2024
Transmit a message from (0,0) to (M-1, N-1) on an M x N grid using towers. Use getTower API to determine when towers are built…
Companies: Google
Last reported Dec 2024
Assign each robot to a factory on the number line (each factory has a repair capacity) so every robot moves left or right to a…
Companies: Amazon, Google
Last reported Dec 2024
Given an m×n grid where some cells contain holes, find the minimum number of planks needed to cover all holes. A horizontal plank covers all…
Companies: Google
Last reported Dec 2024
Given non-overlapping meetings inside [0, eventTime], you may shift up to k meetings (keeping each meeting's duration and the relative order, and staying within the…
Companies: Google
Last reported Dec 2024
Implement a function to find k distinct indices in an array that sum up to a target, using a given function that returns pairs summing…
Companies: Amazon
Last reported Dec 2024
Given an array where every element appears exactly twice except for one, return the element that appears only once. Achieve O(n) time and O(1) space…
Companies: Amazon, Bloomberg, Meta
Array · Bit Manipulation
Last reported Dec 2024
Given a beautiful string s over the first k lowercase letters, find the lexicographically smallest string of the same length that is strictly greater than…
Companies: Amazon
Last reported Dec 2024
Determine the minimum cost to remove characters from a password so that no permutation contains a reference string as a subsequence.
Companies: Amazon
Last reported Dec 2024
Given an m×n matrix where each row is a student's exam scores, reorder the rows by the k-th column in descending order and return the…
Companies: Apple
Last reported Dec 2024
Given a list of unique six-letter words and an API that, for any guessed word from the list, returns the number of characters that match…
Companies: Amazon, Google
Last reported Dec 2024
Find the number of balanced subsegments in a row of servers. A balanced subsegment is a contiguous segment of 3 or more servers where the…
Companies: Amazon
Last reported Dec 2024
Coding test: Given a simple mockup implement that UI. Some CSS is already provided and an API to fetch the data also exists. The recruiter…
Companies: OpenAI
Last reported Dec 2024
Systems design: Given a simple UI with some user preferences implement the system. The UI is already given to you so you need to work…
Companies: OpenAI
Last reported Dec 2024
Count how many index triplets (i < j < k) in a strictly increasing array form an arithmetic progression with common difference diff, i.e., nums[j]-nums[i]…
Companies: Google
Last reported Nov 2024
Explain the SOLID principles in object-oriented programming with examples and discuss the problems they solve.
Companies: Amazon
Last reported Nov 2024
Given a list of N videos, each associated with k tags, determine all similar videos for a given video i by checking the videos from…
Companies: Google
Last reported Nov 2024
Rearrange the array by sorting elements at even indices in non-decreasing order and elements at odd indices in non-increasing order, then placing the sorted values…
Companies: Meta
Last reported Nov 2024
Count the number of pairs of nonnegative integer sequences arr1 (non-decreasing) and arr2 (non-increasing) of length n such that arr1[i] + arr2[i] = nums[i] for…
Companies: Meta
Last reported Nov 2024
Determine whether any permutation of the input string can form a palindrome — equivalently, check that character counts allow at most one character with an…
Companies: Meta
Last reported Nov 2024