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 751–775
Implement a thread-safe message queue that supports one producer and multiple consumers. The solution should correctly handle concurrent access and synchronization between the…
Companies: NVIDIA
Last reported Feb 2026
Given a string, count the number of special palindromic substrings where a special palindrome is defined as either having all identical characters or having all…
Companies: 6sense
Last reported Feb 2026
Last reported Feb 2026
Given daily stock prices, find the maximum profit achievable with at most two non-overlapping buy-sell transactions (you must sell before buying again). Expect to exploit…
Companies: Meta, Oracle
Last reported Feb 2026
Given an array of lowercase strings, choose a subsequence (order preserved) whose concatenation contains only unique characters and return the maximum possible length of that…
Companies: Meta
Last reported Feb 2026
Given a grid with trucks, obstacles, and boundary dispatch points, find the minimum time to dispatch all trucks using BFS propagation. Follow-up involves weighted propagation…
Companies: Amazon
Last reported Feb 2026
Count the number of subsequences of nums that do not contain three consecutive elements of the same parity, returning the result modulo 1e9+7. With n…
Companies: Meta
Last reported Feb 2026
Companies: OpenAI
Grids & Matrices · Simulation & State Machines
Last reported Feb 2026
Design an algorithm to parse, evaluate, and simplify mathematical expressions. The expressions may contain arithmetic operators (+, -, *, /), variables, and parentheses. Handle…
Companies: Google, HubSpot, Meta
Last reported Feb 2026
Check whether a lowercase string is a pangram by verifying it contains all 26 English letters at least once. This can be done in O(n)…
Companies: Goldman Sachs
Last reported Feb 2026
Manage tokens that expire timeToLive seconds after creation/renewal, supporting generate, renew (only if the token is still unexpired), and countUnexpiredTokens (with…
Companies: Adobe, OpenAI
Design · Doubly-Linked List · Hash Table · Linked List
Last reported Feb 2026
Simulate a robot on an infinite grid executing turn commands and unit-step moves, stopping any step that would hit an obstacle and updating its facing…
Companies: Apple, Meta, Shopify
Array · Hash Table · Simulation
Last reported Feb 2026
Find the contiguous subarray with the largest product in an integer array; because negatives and zeros can flip signs, you must track both the running…
Companies: LinkedIn, Microsoft
Array · Dynamic Programming
Last reported Feb 2026
Companies: OpenAI
Low-Level Design (OOP) · Simulation & State Machines
Last reported Feb 2026
Given a valid parentheses string, compute its maximum nesting depth — the largest number of parentheses that are open at the same time. (Equivalent to…
Companies: Meta, Rippling
Bracket Sequences · Stack · String
Last reported Feb 2026
Determine whether a given string matches the grammar of a numeric literal: an optional sign, then either an integer or a decimal (allowing formats like…
Companies: LinkedIn, Meta
Last reported Feb 2026
Companies: Anthropic
Graphs
Last reported Feb 2026
Companies: Anthropic
Data Structure Design
Last reported Feb 2026
Companies: OpenAI
Parsing & Interpreters
Last reported Feb 2026
Find the maximum absolute sum of any contiguous subarray (possibly empty) in an integer array — i.e., the maximum of the largest subarray sum and…
Companies: Upstart
Last reported Feb 2026
Given a permutation flips describing the order in which bits in an all-zero length-n binary string are turned to 1, count how many steps i…
Companies: Salesforce
Last reported Feb 2026
Companies: Salesforce
Last reported Feb 2026
Given a string representing houses ('H') and empty spaces ('-'), determine the minimum number of water tanks needed such that each house has a tank…
Companies: Geico
Last reported Feb 2026
Given a permutation P of length N, determine for each k (1 ≤ k ≤ N) if k is balanced, where k is balanced if…
Companies: Uber
Last reported Feb 2026