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 851–875
Given two linked lists where each node contains a string, determine if the concatenated strings formed by the linked lists are equal. For example, if…
Companies: Meta
Last reported Dec 2025
Implement a full JSON parser that converts a JSON-formatted string into the corresponding nested data structures (objects, arrays, strings with escapes/unicode, numbers…
Companies: Meta
Last reported Dec 2025
Implement a JSON serializer that converts a nested data structure (primitives, strings, arrays/lists, and objects/maps, plus null/boolean) into a valid JSON string. The core…
Companies: Meta
Last reported Dec 2025
For each node c in a weighted tree, count unordered pairs of distinct servers (a,b) (neither equal to c) such that the distances from c…
Companies: NVIDIA, Rippling
Array · Depth-First Search · Tree
Last reported Dec 2025
Given two large, mostly-zero vectors provided in sparse form, compute their dot product efficiently by summing products only for matching non-zero indices; the challenge is…
Companies: Meta
Last reported Dec 2025
Given n people and pairwise dislikes, determine whether the corresponding undirected graph is bipartite — i.e., whether you can 2-color all vertices (split into two…
Companies: LinkedIn, TikTok, Uber
Bipartite Graph · Breadth-First Search · Depth-First Search · Graph Coloring
Last reported Dec 2025
Given a list of stock transactions (buy/sell operations), calculate and return the current stock portfolio showing the quantity of each stock held.
Companies: Addepar
Last reported Dec 2025
Companies: OpenAI
Data Structure Design
Last reported Dec 2025
Companies: OpenAI
Data Structure Design
Last reported Dec 2025
Given two trees, choose one vertex from each and add an edge so the resulting tree's diameter is as small as possible. Key insight: compute…
Companies: Microsoft
Last reported Dec 2025
Count how many nodes in a binary tree are "good", meaning their value is at least the maximum value seen on the path from the…
Companies: Meta
Last reported Dec 2025
Given a nested mathematical expression containing addition and subtraction operations with constants and variables, along with a variable mapping, evaluate the expression and…
Companies: HubSpot
Last reported Dec 2025
Implement a function to evaluate mathematical expressions written in Polish notation (prefix notation), where operators precede their operands. The function should handle basic…
Companies: HubSpot
Last reported Dec 2025
Given an m×n binary grid, find the maximum area (number of cells) of a 4-directionally connected component of 1s (an island), returning 0 if none…
Companies: Amazon, LinkedIn, Meta, Oracle
Last reported Dec 2025
Given you can spend up to k unit increments to raise elements, maximize how many elements can be made equal by choosing a target value…
Companies: Meta
Last reported Dec 2025
Given initial marble positions, apply each move that relocates all marbles at position moveFrom[i] to moveTo[i], and return the sorted list of occupied positions after…
Companies: Servicetitan
Last reported Dec 2025
Determine whether a string is a valid IPv4 (four dot-separated decimal octets 0–255 with no leading zeros) or IPv6 (eight colon-separated groups of 1–4 hexadecimal…
Companies: Meta
Last reported Dec 2025
Given a binary tree where nodes have values (typically 0 or 1), analyze the 'islands' (connected components of similar values) within the tree. Tasks include…
Companies: Google
Last reported Dec 2025
Given a string of '(' and ')', return the minimum number of parentheses insertions needed to make the string valid. This is solved greedily by…
Companies: Meta, Microsoft
Bracket Sequences · Greedy · Stack · String
Last reported Dec 2025
Given a binary tree and a start node, compute how many minutes it takes for an infection that spreads each minute to adjacent nodes (parent/children)…
Companies: Microsoft, Salesforce
Binary Tree · Breadth-First Search · Depth-First Search · Hash Table
Last reported Dec 2025
Given a binary array, return the length of the longest contiguous run of 1s — essentially find the maximum number of consecutive 1s in a…
Companies: Google, Microsoft
Array
Last reported Dec 2025
Design a data structure that maintains timestamp→price records which may arrive out-of-order and be corrected later, supporting efficient update(timestamp, price) and queries…
Companies: Snapchat
Last reported Dec 2025
Companies: OpenAI
Parsing & Interpreters
Last reported Dec 2025
Companies: Tesla
Last reported Dec 2025
Companies: Roblox
Last reported Dec 2025