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,376–1,400
Given name/time pairs, find all workers who used their keycard three or more times within any 60-minute window by grouping times per name, converting HH:MM…
General practice
Two-pile take-1-per-turn game reduces to parity: Alice wins iff x+y is odd (since exactly one flower is removed per move and Alice goes first), so…
General practice
Given a binary array, consider every split index i (0..n) and compute its score as zeros in the left part plus ones in the right…
General practice
Given two binary search trees, return a single list of all values from both trees in ascending order. The key challenge is to exploit the…
General practice
Given a directed graph and nodes source and destination, determine whether every possible path starting from source eventually ends at destination — i.e., no path…
General practice
Generate all structurally unique full binary trees with n nodes (each node has 0 or 2 children and Node.val == 0). Only odd n can…
General practice
Given a list of teams, generate every distinct match between two different teams (each unordered pair exactly once), i.e., produce all combinations C(n,2) of teams…
General practice
Given a list of follower relationships, find all pairs of users that share the maximum number of common followers. The main challenge is computing pairwise…
General practice
Generate all unique triplets (a, b, c) drawn from given values/ranges that satisfy the problem's validity rules (e.g., distinctness, ordering, and relational or aggregate…
General practice
Return a wrapper for a given function that calls the original at most once: it should invoke and return fn's result on the first call…
General practice
Convert each target letter to its board coordinates and output a shortest sequence of moves (U/D/L/R) plus '!' to spell the string by walking between…
Companies: Atlassian
Hash Table · String
Compute the alternating sum of an integer's digits, assigning a positive sign to the most significant digit and alternating signs for each subsequent digit. This…
General practice
Count how many length-3 contiguous segments in a circular binary array have the middle tile different from both neighbors (equivalently the two neighbors are equal…
General practice
Given a circular binary array and integer k, count how many contiguous length-k segments are alternating (every adjacent pair within the segment differs). Because of…
Companies: eBay
Array · Sliding Window
Maintain counts of contiguous alternating-color segments in a circular binary array while supporting point color updates and queries that ask how many length-k alternating…
General practice
Given a parenthesized digit string, produce all possible coordinate pairs by splitting the inner digits into two parts and inserting optional decimal points, enumerating all…
General practice
Given a sequence of paint intervals applied day by day, return for each day how much length of the interval was painted for the first…
General practice
Companies: Airbnb
Identify users who converted (had free_trial activity followed later by paid activity) and for each such user compute the average daily activity_duration during their…
General practice
An ant starts at position 0 and takes successive signed steps from nums (positive = right, negative = left). Count how many times its cumulative…
General practice
Given strings s and t, return the minimum characters to append to s so that t becomes a subsequence — equivalently, find the longest prefix…
General practice
Pick k distinct positive integers not in nums so their sum is minimized — equivalently, find and sum the k smallest positive integers missing from…
General practice
Given arrays apple and capacity where packs can be split across boxes, find the minimum number of boxes whose combined capacities can hold the total…
General practice