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,601–2,625
Companies: OpenAI
Generate all generalized abbreviations of a given word by replacing any subset of characters with counts that represent consecutive abbreviated letters. This is a combinatorial…
General practice
Return any lowercase string of length n in which every character appears an odd number of times. Key insight: use parity—if n is odd, repeat…
General practice
Generate all binary strings of length n that contain no adjacent zeros (i.e., every length-2 substring contains at least one '1'), returning them in any…
General practice
Given an integer array and an integer k, produce a new array where each element is the sum of k consecutive elements around the original…
General practice
Implement a generator that yields successive Fibonacci numbers (0, 1, 1, 2, 3, ...) on each next() call; the task is to produce the sequence…
General practice
Produce an ordering of all directed matches between n teams (each ordered pair i != j appears exactly once, representing home/away) so that no team…
General practice
Convert a sentence into a video tag by concatenating words into a single camelCase string prefixed with '#', then removing any non-letter characters (except the…
General practice
Given raw transaction and item records plus a set of business rules, generate a final invoice that lists aggregated line items, subtotals, taxes, discounts, and…
General practice
Find every distinct sum of the border cells of all 45°-rotated square (rhombus) shapes that fit in an m×n grid (including size-0 single-cell rhombi) and…
General practice
Given two equal-length strings and a budget, find the maximum-length contiguous substring where the sum of per-character absolute ASCII differences between s and t is…
General practice
Given datasets of questions and their answers, compute each question's answer rate (answers divided by the relevant total) and return the question(s) with the highest…
General practice
Generate an array nums of length n+1 using the recurrence nums[0]=0, nums[1]=1, nums[2*i]=nums[i], nums[2*i+1]=nums[i]+nums[i+1] (even indices copy, odd indices sum) and return…
General practice
Given two sorted arrays of distinct integers, find the maximum sum obtainable by traversing left-to-right along either array and optionally switching arrays at common elements…
General practice
Given a table of timestamped activities, return each user's second-most-recent activity. The challenge is to correctly rank events by time per user and handle edge…
General practice
Return the size of the players DataFrame by counting its rows and columns and output the result as an array [number_of_rows, number_of_columns].
General practice
Given an undirected friend graph, BFS from the given id to find all people at shortest-path distance level, tally the frequencies of their watched videos…
General practice
Given a sequence of credit issuance and usage events, where credits may expire or have usage constraints, write a function to translate the list into…
Companies: OpenAI
Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array. The result should also…
Companies: Meta
Given an array nums and a sliding window of size k moving from the very left to the very right, return the maximum value in…
Companies: NVIDIA
Companies: Meta
Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the k closest points to the origin…
Companies: Netflix