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,526–2,550
Given an array of lowercase strings and a character x, return the indices of all words that contain x (order of indices doesn't matter). This…
General practice
Given a list of words and a pool string chars, return the sum of lengths of all words that can be formed from chars where…
General practice
Count, for every x in [0, k-1], how many contiguous non-empty subarrays (equivalently removing a prefix and a suffix) have product ≡ x (mod k)…
General practice
After applying the persistent point update and removing the first start elements for that query, count how many nonempty prefixes of the remaining subarray (i.e.…
General practice
For each k-length sliding window of nums, compute the "x-sum" defined as the sum of elements whose values are among the top x most frequent…
General practice
For each k-length sliding window, compute the sum of elements that belong to the x most frequent values in that window (ties broken in favor…
General practice
Compute the XOR of arr1[i] & arr2[j] across all pairs (i,j); use per-bit parity/linearity to avoid O(n·m) work and reduce it to combining the arrays'…
General practice
Given an integer array nums, compute the xor-beauty defined as the XOR of ((nums[i] | nums[j]) & nums[k]) over all ordered triplets (i, j, k)…
General practice
Group events by session_id (and user) to compute session duration, scroll and click counts, and purchases, and return sessions with duration > 30 minutes, at…
General practice
Given a multiset of digits (with possible duplicates), generate all unique 3-digit even numbers that can be formed by concatenating three elements (using each digit…
General practice
Design a data structure that supports point-add updates to nums2 and count queries that return how many pairs (i,j) satisfy nums1[i] + nums2[j] == tot…
General practice
Given mountains as (x,height) that span intervals [x-height, x+height], count how many mountains are not completely covered by any other mountain; the core challenge is…
General practice
Group logs by user and count each user's number of unique active minutes (deduplicate minutes per user), then produce a 1-indexed array of length k…
General practice
Given a large set of timestamped call logs, identify callers whose earliest and latest calls occur on the same calendar day — the core challenge…
General practice
Given n versions and an API isBadVersion(version) where once a version is bad all subsequent versions are also bad (monotonic), find the smallest bad version…
General practice
Given an order arr of unique values and a matrix mat that maps each value to a cell, find the smallest index i such that…
General practice
Given n rooms and parity-driven movement rules determined by nextVisit, find the earliest day when every room has been visited (answer mod 1e9+7). The core…
General practice
Companies: Snap
Given a text, capitalize the first alphabetic character of each word or sentence while correctly handling punctuation, whitespace and complex Unicode grapheme clusters. The…
General practice
Transform each content_text so every word's first letter is uppercase and the remaining letters lowercase, treating hyphen-connected segments as separate parts to capitalize…
General practice
Given a lowercase string, return the character whose second occurrence appears earliest in the string (i.e., has the smallest index of a second appearance); the…
General practice