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 4,701–4,725
Format a non-negative integer as a string by inserting a dot "." every three digits from the right (thousands separator). Handle numbers up to 2^31-1…
General practice
Check whether an integer array contains any contiguous run of three odd numbers and return true if such a triple exists, otherwise return false.
General practice
Determine whether n has exactly three positive divisors — equivalently, check if n is a perfect square and its square root is prime, since only…
General practice
Given a binary array, find indices to split it into three non-empty contiguous parts that represent the same binary value (leading zeros allowed), or return…
General practice
Given an array and many queries [l, r, threshold], return for each query the element in nums[l..r] that appears at least threshold times (choosing the…
General practice
Given an n×m rectangle (1 ≤ n,m ≤ 13), find the minimum number of integer-sided squares needed to exactly tile it. The core challenge is…
General practice
Given a list tickets[] and index k, compute how many seconds until person k finishes in a round-robin queue where each second the front buys…
General practice
Given a tree-structured company hierarchy rooted at headID where each employee i takes informTime[i] minutes to notify its direct subordinates, compute the minimum time to…
General practice
Determine the minimum time for a set of people/tasks to all pass through a single constrained doorway (with per-person crossing times, ordering/arrival constraints and limited…
General practice
Given a tree where marking spreads to a neighbor in 1 unit if the target node index is odd and 2 units if it's even…
General practice
Simulate a priority-driven scheduling problem where k workers, each with times to cross right, pick, cross left, and put, must move n boxes across a…
General practice
Return a cancel function for a delayed call: schedule fn(...args) to run after t milliseconds, but if the returned cancel function is invoked before that…
General practice
Implement expect(val) that returns an object with two methods: toBe(x) which returns true if val === x or throws "Not Equal", and notToBe(x) which returns…
General practice
Convert every uppercase ASCII letter in a given string to its lowercase counterpart and return the resulting string. Input length is up to 100 and…
General practice
Given a stream of transaction amounts and a trailing window, flag days whose amount is at or above the top P-th percentile of the previous…
General practice
Given a dataset of wineries and their performance metrics (e.g., ratings or sales), return the top three wineries per group (such as region or year)…
General practice
Aggregate each user's total distance from Rides (treat users with no rides as 0) and return every user's name with their travelled_distance. Order the results…
General practice
Given n biased coins with specified probabilities of landing heads, compute the probability of getting exactly a target number of heads. This requires combining independent…
General practice
Compute the sum of distinct-character counts for all substrings of a lowercase string s (n up to 1e5). The challenge is to avoid O(n^2) brute…
General practice
Given s and t, perform t rounds where each non-'z' character becomes the next letter and each 'z' becomes "ab", and return the final string…
General practice
Model the process as a linear map on a 26-dimensional vector of letter counts (each letter expands into a fixed set of next letters), then…
General practice
Select k workers to minimize total hiring cost by repeatedly choosing the lowest-cost worker from either the first or last candidates workers (breaking ties by…
General practice