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,176–2,200
Given two identical eggs and n floors, determine the minimum number of drops required in the worst case to find the highest floor from which…
General practice
Aggregate votes (possibly per precinct or as a stream) to compute election outcomes—determine the winner(s) or ranking under specified rules (plurality, majority threshold, or…
General practice
Given an array and a sequence of operations that remove all occurrences of specified values and replace certain values with others, compute the final array…
General practice
Given each monster's time-to-arrival (dist/speed) and the ability to kill one monster per minute starting at time 0, determine how many monsters you can eliminate…
General practice
Determine the last remaining number after repeatedly removing every other element from the list [1..n], alternating left-to-right and right-to-left passes. Because n can be as…
General practice
Given Employee and Bonus tables, report each employee's name and bonus for those whose bonus is less than 1000, also including employees with no bonus…
General practice
Given a list of employees (id, importance, subordinate ids) and a target id, compute the total importance of that employee plus all direct and indirect…
General practice
Given a list of tasks with employee IDs and start/end timestamps, compute per-employee total task durations and global concurrency metrics (e.g., maximum concurrent tasks or…
General practice
Given an Employee table, return the names of employees whose salary is greater than their manager's by comparing each employee row to its manager row…
General practice
Assign employees (each with skills, availability, or cost) to projects (each with skill requirements, capacity, and value) to maximize total benefit or minimize cost while…
General practice
Given an Employees table, return the employee_id(s) (ordered) of employees with salary < 30000 whose manager has left — i.e., their non-null manager_id does not…
General practice
Given employee salary records and a table of deductions, aggregate deductions per employee (using joins/group-by) to compute each employee's adjusted salary and return the…
General practice
Given two tables with unique employee_id keys, return the employee IDs that appear in only one table (i.e., missing a name or a salary), ordered…
General practice
Implement an encode/decode system that maps long URLs to short tiny URLs and back, guaranteeing a reversible, collision-free mapping so decode returns the original URL…
General practice
Design encode and decode functions that convert an N-ary tree to a binary tree and back, preserving node values and child order. The core challenge…
General practice
Design reversible encode/decode functions that map integers to compact strings and back, ensuring uniqueness and efficiency. The core challenge is to pick a variable-length…
General practice
Implement an Encrypter that maps each character to a two-letter code and supports encrypting by replacing characters and decrypting by counting how many dictionary words…
Companies: Duolingo
Array · Design · Hash Table · String
Given two decimal strings that may include a repeating part in parentheses, determine whether they represent the same rational number (handling edge cases like 0.9(9)…
General practice
Count the number of pairs (ri, cj) in an n×n integer matrix where the i-th row and j-th column are identical sequences. With n ≤…
General practice
Given two arrays with values 1..6, change any elements to any value (1..6) and return the minimum operations to make their sums equal or -1…
General practice