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,776–4,800
Find the n-th positive integer whose only prime factors are 2, 3, and 5 by efficiently generating the ordered sequence of such "ugly" numbers (typically…
General practice
Find the nth positive integer that is divisible by at least one of a, b, or c. Use inclusion–exclusion with lcm(a,b,c) to count how many…
General practice
Find all words that appear exactly once in one sentence and do not appear in the other; equivalently, count word frequencies across both space-separated sentences…
General practice
Given two integer arrays, pair equal elements with straight lines so that lines don't cross and each element is used at most once; return the…
General practice
Given a nested JavaScript-like data structure of objects and arrays that may contain undefined values, transform it so every undefined is replaced with null while…
General practice
Count how many distinct three-digit even numbers can be formed from the given digits, using each digit occurrence at most once and disallowing leading zeros…
General practice
Generate all structurally distinct binary search trees that store values 1..n and return them as tree roots. This is a classic divide-and-conquer / DP enumeration…
General practice
Given a list of email strings, normalize each by splitting at '@', removing all '.' and discarding anything after the first '+' in the local…
General practice
Count the number of distinct length-3 palindromic subsequences in s — i.e., unique strings of the form "a b a" that can be formed as…
General practice
Check whether the frequency of each distinct integer in an array is unique: compute counts for each value and return true if no two values…
General practice
Group rows by month (extracted from the order date) and compute, for each month, the number of distinct orders and distinct customers—returning the monthly aggregates…
General practice
Count the number of 4-directional paths from the unique start to the unique end that visit every non-obstacle cell exactly once on an m×n grid…
General practice
Count the number of distinct non-empty substrings of s that appear in the infinite wraparound alphabet (i.e., substrings where each character is the next letter…
General practice
Given a string of digits, count the number of distinct substrings in which every digit that appears occurs the same number of times. The core…
General practice
Design a structure that, given a dictionary, computes each word's abbreviation (first letter + count of omitted letters + last letter, with short words typically…
General practice
Given n units and n-1 directed conversion edges that guarantee a unique path from unit 0 to every other unit, compute for each unit the…
General practice
Given a set of pairwise unit conversion ratios, build a weighted graph or use a weighted union-find to answer queries by finding a path between…
General practice
Given a list of books and their transaction/borrow records, return the books that are "unpopular" (never borrowed or borrowed fewer than a specified threshold). This…
General practice
Design a system that records timestamped user events and answers queries about user activity within arbitrary start–end time bounds (e.g., count of events or distinct…
General practice
Count daily active users for the 30-day period ending 2019-07-27 by grouping activities by activity_date and reporting the number of distinct user_id per day (exclude…
General practice
Given a table of user activity with timestamps/dates, identify which users were active on every day in the past 30 days — requiring date-range filtering…
General practice
Design a system that processes a stream of user purchase events and answers online analytics queries such as total spend or purchase count per user…
General practice
Given a table of user message events, identify users who actively requested confirmation messages. This requires filtering for confirmation-request events, grouping by user…
General practice