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 876–900
Compute every node's subtree sum (sum of values in its subtree) and return the sum(s) that occur most frequently. The core challenge is performing a…
Companies: Meta
Last reported Dec 2025
Manage n seats numbered 1..n supporting reserve(), which returns and marks the smallest-numbered available seat, and unreserve(seat), which makes a seat available again; design…
Companies: Meta
Last reported Dec 2025
Sort a list of input letters where there is only a subset of possible letters from the alphabet (as in 3-4 different letters, but many…
Companies: Uber
Last reported Dec 2025
Incrementally design and implement a data loader that supports: (1) readability, (2) resuming/checkpointing, and (3) batching. Each feature is added step by step, and each…
Companies: Microsoft
Last reported Nov 2025
Companies: Meta
Last reported Nov 2025
Given a list of function call logs with start/end timestamps for nested function calls on a single-threaded CPU, calculate the exclusive execution time for each…
Companies: LinkedIn, Meta
Last reported Nov 2025
Find the minimum time t such that there is a 4-directional path from the top-left to bottom-right of an n×n grid using only cells with…
Companies: Meta
Last reported Nov 2025
Companies: OpenAI
Key-Value Stores
Last reported Nov 2025
Compute the moving average of step counts over a fixed-size sliding window for an array or stream of measurements, producing the average for each contiguous…
Companies: Meta
Last reported Nov 2025
Given a string containing only parentheses (), {}, [], digits 0-9, and operators +, -, *, /, determine if it represents a valid mathematical expression.
Companies: Amazon
Last reported Nov 2025
Assign each node coordinates (row, col) with root at (0,0) and children at (r+1,c±1), then produce a list of columns from leftmost to rightmost where…
Companies: Meta
Last reported Nov 2025
Given a list of words, generate the shortest unique abbreviation for each word of the form prefix + count of omitted middle letters + last…
Companies: Meta
Last reported Nov 2025
Count how many contiguous subarrays of length three satisfy that the sum of the first and third elements equals exactly half of the middle element…
Companies: Cognizant
Last reported Nov 2025
Companies: Anthropic
Last reported Nov 2025
Given an m×n grid and a starting pixel (sr, sc), repaint all 4-directionally connected cells that have the same color as the starting pixel to…
Companies: C3 Ai, Google
Last reported Nov 2025
Implement a double-ended queue (deque) data structure that allows efficient insertion and removal of elements from both the front and rear ends.
Companies: Microsoft
Last reported Nov 2025
Companies: Salesforce
Last reported Nov 2025
Companies: OpenAI
Bit Manipulation · Data Structure Design
Last reported Nov 2025
Given a matrix board containing multiple source points and multiple destination points, find the shortest distance between any source and any destination. Return the minimum…
Companies: Microsoft
Last reported Nov 2025
Companies: OpenAI
Parsing & Interpreters
Last reported Nov 2025
Given multiple series plotted over the same x-coordinates, compute the maximum number of pairwise intersections among the piecewise-linear lines formed by connecting points…
Companies: Meta
Last reported Nov 2025
Given boats with arrival/departure times and parking revenue, plus dock construction costs, find the maximum profit while minimizing the number of docks used. Similar to…
Companies: C3 Ai
Last reported Nov 2025
Companies: Anthropic
Concurrency
Last reported Nov 2025
Count the number of distinct paths from the top-left to bottom-right of an m×n grid when you can only move right or down and cells…
Companies: Meta, Microsoft
Last reported Nov 2025
Design and implement a cache data structure that supports configurable eviction policies when the cache reaches capacity. The implementation should allow different eviction…
Companies: LinkedIn
Last reported Nov 2025