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,351–1,375
Given a list of peer-to-peer transactions, compute each account's net balance and find the minimum number of money transfers required to settle all debts by…
General practice
Given a purchaseAmount (0–100), round it to the nearest multiple of 10 (ties of 5 round up) and subtract that roundedAmount from a starting balance…
General practice
Given records of businesses with start and end dates, compute how many businesses are active at specified times or over given ranges. The core challenge…
General practice
Given timestamped user activity (or login/logout) events, compute the number of unique users considered "active" within each sliding time window or at query times. The…
General practice
Given timestamped join/leave records for participants across activities, compute attendance metrics such as current or peak participants per activity (or at specific query…
General practice
Find all (actor_id, director_id) pairs that collaborated at least three times by grouping the ActorDirector table by actor_id and director_id and returning groups with COUNT(*)…
General practice
Given event timestamps and a number of ad-free coupons (or a fixed ad-free duration per coupon), determine how to cover events with ad-free intervals to…
General practice
Add two binary strings and return their sum as a binary string by performing digit-wise addition from the least significant bit with carry, handling unequal…
Companies: Meta
Bit Manipulation · Math · Simulation · String
Given a string s and a list of words, wrap every substring of s that matches any word with ... , merging overlapping or adjacent…
General practice
Compute the digital root of a nonnegative integer by repeatedly summing its digits until one digit remains; this reduces to a mod-9 property (with a…
General practice
Given an undirected simple graph, determine whether you can add at most two edges (no self-loops or duplicates) so every vertex has even degree. The…
General practice
Given a strictly increasing array of rung heights and a maximum climb distance dist from starting height 0, determine the minimum number of integer-height rungs…
General practice
Companies: Bloomberg, Google
Binary Tree · Breadth-First Search · Depth-First Search · Tree
Given an integer represented as a digit array and an integer k, compute the array-form of num + k by simulating addition from the least-significant…
General practice
Return the sum of two given integers num1 and num2 (they may be negative); simply compute and return num1 + num2 (constraints: -100 to 100).
Companies: Google
Math
General practice
Given two promises that each resolve to a number, return a new promise that resolves to the sum of their resolved values. You must wait…
General practice
Given a string s and a strictly increasing list of indices, return the string formed by inserting a space before each character at those indices…
General practice
Given two arrays of 0/1 digits representing numbers in base -2, compute their sum and return the normalized negabinary representation (array of 0/1 with no…
General practice
Determine whether a digit string can be partitioned into at least three numbers (no leading zeros) that form an additive sequence where each number equals…
General practice
Determine whether there exists an index a such that both contiguous subarrays nums[a..a+k-1] and nums[a+k..a+2k-1] (i.e., two adjacent length-k blocks) are strictly increasing…
General practice
Given event records for ads (impressions, clicks, conversions, revenue, etc.), compute per-ad performance metrics (e.g., CTR, conversion rate, revenue per click) and return…
General practice
Given two equal-length arrays, permute nums1 to maximize the number of positions where nums1[i] > nums2[i]. This is a greedy matching problem: sort nums1 and…
Companies: Walmart Labs
Array · Greedy · Sorting · Two Pointers
Given n passengers where the first picks a random seat and each subsequent passenger takes their own seat if available or otherwise chooses uniformly among…
General practice