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,676–4,700
Given a graph where each node has a name and a target sequence of names, find a path of the same length whose node names…
General practice
Count the number of non-empty subsets (indices distinct) of nums such that no two chosen elements have absolute difference exactly k. With n ≤ 18…
General practice
Given an Employees table, identify employees who are managers (have at least one direct report) and return each manager's id, name, the count of direct…
General practice
Given login and logout times on a 24-hour clock (where logout earlier than login means the session spans midnight) and rounds starting every 15 minutes…
General practice
Count the subsets of nums whose product is a product of distinct primes (i.e., square-free with no repeated prime factors), modulo 1e9+7. With nums length…
General practice
Given a list of passenger boarding/alighting records that specify bus id, start and end stops, and counts, compute how many passengers are on each bus…
General practice
Given many boarding and alighting events across stops for multiple buses, compute the passenger count for each bus (or at each stop) after all events…
General practice
Given a 2D array where each row lists a customer's bank balances, compute each customer's total wealth (row sum), determine the maximum wealth, and return…
General practice
Count how many ways to assign employees or positions as seniors or juniors subject to per-position, pairwise, or global constraints (e.g., minimum/maximum seniors…
General practice
Count the number of ways to label candidates as seniors or juniors that satisfy a set of pairwise constraints (e.g., relative seniority/preferences or inequality relations)…
General practice
Simulate friends arriving in chronological order and always assign each arrival the smallest-numbered free chair. Use a min-heap of available chair indices and a min-heap…
General practice
Given a list of desired products with required counts and a sequence of daily bought items, count how many users qualify for the discount by…
General practice
Count how many characters (attack, defense) are strictly dominated by another character with both attack and defense greater. With up to 1e5 pairs this requires…
General practice
Compute the expression's correct value under the given precedence (multiplication before addition, left-to-right) and then determine all values obtainable by any other…
General practice
the technical screen is basic leetcode questions, I passed one but did the harder one brute force, I was just disappointed that they never called…
Companies: LinkedIn
Compute shortest distances from the master (node 0) with a BFS to get each server's round-trip time (2*d), then for each server use its patience…
General practice
Given an array of length n+2 containing integers 0..n-1 where every number should appear exactly once but exactly two values appear twice, identify and return…
General practice
Given users' registration dates and purchase logs, identify which users meet the discount criteria (e.g., made a required number of purchases within a specified time…
General practice
Count occurrences of university names from a list and return the university with the highest vote/occurrence; if there’s a tie, break it deterministically (e.g.…
General practice
They asked me to design a memory-efficient algorithm to detect if a linked list contains a cycle, then optimize it for both time and space…
Companies: Apple
They asked me to implement a balanced binary search tree from scratch and explain its time complexity. They also wanted me to optimize it for…
Companies: Citadel