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 951–975
Compute the positions of the clock's hour and minute hands (noting the hour hand moves continuously with minutes) and return the smaller angular difference between…
Companies: Microsoft, Salesforce, Zoho
Math
Last reported Sep 2025
Given a tree rooted at 0 with some nodes containing apples, find the minimum seconds (1 per edge traversal) to start at 0, collect all…
Companies: Meta
Last reported Sep 2025
Multiply two non-negative integer strings without converting them to numeric types or using BigInteger: compute the product by simulating grade-school digit-by-digit…
Companies: Meta, Microsoft, Pinterest
Math · Simulation · String
Last reported Sep 2025
Design a data structure that supports inserting items at specific indices, replacing items at given indices, and finding the lowest index of a specified value…
Companies: Amazon
Last reported Sep 2025
Given an n×n grid of 1s with some cells set to 0 (mines), find the largest order k of an axis-aligned plus sign made of…
Companies: Amazon
Last reported Sep 2025
Companies: Meta
Last reported Sep 2025
Generate all length-n strobogrammatic numbers—strings that appear identical when rotated 180°—by constructing valid digit pairs (0-0,1-1,6-9,8-8,9-6). The core challenge is…
Companies: Uber
Last reported Sep 2025
Given a binary array, efficiently count the number of 1s in any given subarray range when the query operation will be called multiple times.
Companies: Meta
Last reported Sep 2025
Count the occurrences of each distinct lowercase word in words.txt and output each word with its frequency sorted by descending count. The input contains only…
Companies: Meta
Last reported Sep 2025
Manage an exam room of n seats where seat() places the next student at the index that maximizes the distance to the nearest occupied seat…
Companies: Apple
Last reported Sep 2025
Choose heights within [1, maxHeights[i]] that form a mountain (nondecreasing to a single peak then nonincreasing) to maximize the total sum. Core challenge: for each…
Companies: Bloomberg, Expedia
Array · Monotonic Stack · Stack
Last reported Sep 2025
Companies: Blue Origin
Last reported Sep 2025
Return the sum of all array elements that occur exactly once by identifying values with frequency equal to one (i.e., sum elements whose count is…
Companies: Collectors
Last reported Sep 2025
Given an array of distinct integers, repeatedly compare the first two elements, keeping the larger at the front and moving the smaller to the back…
Companies: Amazon, Goldman Sachs
Array · Simulation
Last reported Sep 2025
Check whether every top-left to bottom-right diagonal in an m x n matrix contains identical values (a Toeplitz matrix), returning true if all diagonals are…
Companies: Meta
Last reported Sep 2025
Return the length of the longest contiguous run of the same character in string s — i.e., the maximum length of any substring made of…
Companies: Meta
Last reported Sep 2025
Given two sorted, pairwise-disjoint lists of closed intervals, return all non-empty intersections between intervals from the two lists. Because each list is ordered and…
Companies: Meta, Verkada
Array · Sweep Line · Two Pointers
Last reported Sep 2025
Companies: Anthropic
Bit Manipulation
Last reported Sep 2025
Companies: Anthropic
Stacks & Queues
Last reported Sep 2025
Companies: Anthropic
Stacks & Queues
Last reported Sep 2025
Companies: OpenAI
Parsing & Interpreters
Last reported Sep 2025
Companies: OpenAI
Data Structure Design
Last reported Sep 2025
Companies: Anthropic
Data Structure Design · Heaps & Priority Queues
Last reported Sep 2025
Companies: Anthropic
File & Media Storage
Last reported Sep 2025