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,901–2,925
Remove all dashes and convert letters to uppercase, then reformat the characters into groups of size k (counting from the right) separated by dashes —…
General practice
Determine whether a set of 2D points is symmetric about some vertical line x = c — i.e., whether for every point its mirrored point…
General practice
Companies: Amazon, NVIDIA
Floyd's Cycle Finding Algorithm · Hash Table · Linked List · Two Pointers
Join Products with Orders, filter orders to February 2020, group by product to sum units, and return product names whose total units in that month…
General practice
Given a list of loan/application records with attributes, classify or filter them by specified criteria (e.g., amount, term, credit) and return the requested types, counts…
General practice
Given two quad-trees representing n×n binary matrices, produce a quad-tree representing their cellwise logical OR. Recursively combine corresponding nodes by applying OR at…
General practice
Given an m×n grid of 'B' and 'W', count how many black pixels are "lonely" — i.e., they are the only 'B' in both their…
General practice
Given an m×n grid of 'B' and 'W' and an integer N, count black pixels at (i,j) such that row i and column j each…
General practice
Check whether the string typed can be produced from name by allowing some characters to be long-pressed (repeated); verify the characters appear in the same…
General practice
Check whether the longest consecutive run of '1's in a binary string s is strictly greater than the longest consecutive run of '0's by scanning…
General practice
Find the longest contiguous subarray (length > 1) whose consecutive differences alternate +1, -1, +1, ... — i.e., each element toggles between prev+1 and prev-1…
General practice
General practice
Companies: Amazon
Array · Enumeration
Find the length of the longest subsequence of nums whose consecutive elements have the same difference (i.e., form an arithmetic progression). With n up to…
General practice
Find the length of the longest subsequence (preserving order) in which consecutive elements differ by a given fixed value. With arr up to 1e5, the…
General practice
Companies: Amazon, Bloomberg, Google, Intuit
Array · Divide and Conquer · Hash Table · Prefix Sum
Companies: Amazon, Google
Array · Divide and Conquer · Hash Table · Prefix Sum
Companies: Amazon, Bloomberg, Google, Meta
Counting · Enumeration · Hash Table · String
Companies: Amazon, Bloomberg, Google, Meta +2
Hash Table · Prefix Sum · String