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 2,151–2,175
Companies: Infosys
Array · Dynamic Programming · Enumeration · Math
Two players alternate replacing n with n − x for any proper divisor x of n; determine whether the first player can force a win…
General practice
Given a table of DNA sequences, produce four boolean flags per sample indicating whether the sequence starts with "ATG", ends with any of "TAA"/"TAG"/"TGA", contains…
General practice
Count the number of ways to tile a 2×n board using 2×1 dominoes and L-shaped trominoes (rotations allowed), returning the result modulo 10^9+7. The core…
Companies: Goldman Sachs
Dynamic Programming
Senators from two parties take turns in a circular, round-based process where each active senator bans one opponent, and the game ends when all remaining…
General practice
General practice
Given tuples [a,b,c,m] and a target, return indices where ((a^b % 10)^c) % m equals target — the core challenge is evaluating this double modular…
General practice
Implement parallel download of file chunks. Bound the concurrent work, handle failed transfers, and verify the assembled file.
Companies: Baseten
Concurrency · Data Integrity · File Transfers
Remove duplicate rows in the customers table based on the email column, keeping only the first occurrence for each email (i.e., perform a stable deduplication)…
General practice
Given a students table/DataFrame that may contain NULL/None values in the name column, return the table with all rows having missing names removed. Preserve the…
General practice
Given a list of orders labeled by customer and type (0 or 1), remove all type-1 orders for any customer who has at least one…
General practice
Given a grid of integers (positive heal, negative damage) and moves only right or down, find the minimum positive initial health so the running health…
Companies: Intuit
Array · Dynamic Programming · Matrix
Given a Person table of (id, email), return all email addresses that appear more than once — a classic grouping/aggregation problem (GROUP BY email with…
General practice
Modify a fixed-length array in-place by duplicating every zero and shifting subsequent elements to the right, truncating any elements that fall off the end of…
General practice
During coding interview, I was asked a regular lc question. The follow up question is to support scalability and high throughput. The interviewer cared a…
Companies: Databricks
Given a mutable table of records, support dynamic "pivot" operations that reorient the table by grouping on a chosen column and computing aggregate metrics (counts/sums)…
General practice
Convert a wide table into a long/normalized form by turning a variable set of value-columns into rows (i.e., unpivoting), producing identifier + column-name/ordinal + value…
General practice
Given start times and durations for land and water rides, pick exactly one ride from each category and an order (you may wait between rides)…
General practice
Choose one land ride and one water ride (in either order) to minimize the time you finish both, where each ride can start no earlier…
General practice
Given single-worker planting times and post-plant growth times, schedule the planting order to minimize the day when all flowers have finished growing; this is a…
General practice
Given initial counts nums and a time-ordered list changeIndices where an index i can only be marked at seconds when changeIndices[s] == i (marking is…
General practice
Given initial counts and a time-ordered list of indices that can be "reset" each second, determine the earliest second by which you can schedule per-second…
General practice
Given a list of tasks where each task starts at si and takes ti time, compute the earliest finishing time by returning the minimum value…
General practice
Given n (a multiple of 4) pizza weights, partition them into n/4 days of 4 pizzas each so that on odd days you gain the…
General practice