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 776–800
Given an array nums and an integer k, return the maximum average of any contiguous subarray of length k. This is a classic sliding-window problem…
Companies: Oracle
Last reported Feb 2026
Given an array of integers and an integer k, find the maximum possible sum by selecting exactly k elements from either the front or back…
Companies: Oracle
Last reported Feb 2026
Design an algorithm to shuffle a playlist of songs such that each song is played once in a random order. The algorithm should ensure that…
Last reported Feb 2026
Given a price array and integer k, maximize total profit using at most k non-overlapping buy-sell transactions (cannot hold multiple stocks simultaneously). This is a…
Companies: Oracle
Last reported Feb 2026
Maintain the kth largest element in a dynamic stream: implement a class initialized with k and an initial array that supports add(val) and returns the…
Companies: Cloudkitchens, Microsoft
Last reported Feb 2026
Check whether string s can be obtained from t by deleting some characters without reordering (i.e., whether s is a subsequence of t), typically solved…
Companies: Meta
Last reported Feb 2026
Determine whether a numeric string is strobogrammatic — i.e., it appears the same when rotated 180 degrees using the digit mappings 0↔0, 1↔1, 6↔9, and…
Companies: Meta
Last reported Feb 2026
Companies: Anthropic
Data Structure Design · Stacks & Queues
Last reported Feb 2026
Companies: TikTok
Last reported Feb 2026
Given a sorted array nums and a quadratic function f(x)=ax^2+bx+c, transform each element by f and return the values in sorted order. The key is…
Companies: Meta
Last reported Feb 2026
Given an array of nonnegative integers representing house values, find the maximum sum you can obtain by selecting houses with the constraint that no two…
Companies: Amazon, Apple, Goldman Sachs, Microsoft
Array · Dynamic Programming
Last reported Jan 2026
Given a numeric string n (up to 18 digits), find the closest integer palindrome different from n (ties broken by smaller value). The typical approach…
Companies: Meta, Uber
Math · String
Last reported Jan 2026
Companies: OpenAI
Data Structure Design · Intervals & Scheduling
Last reported Jan 2026
Given up to 10 unique points with integer coordinates, find the largest-area axis-aligned rectangle whose four corners are among the points and that contains no…
Companies: Microsoft
Last reported Jan 2026
Transform a string by adding one exclamation mark to every group of consecutive exclamation marks and converting all periods to exclamation marks.
Companies: Upstart
Last reported Jan 2026
Given a dictionary of valid words and scrambled words where only the middle letters are rearranged (first and last letters remain in place), decode each…
Companies: Upstart
Last reported Jan 2026
Count how many integers in [1, n] consist only of rotatable digits (0,1,8,2,5,6,9) and contain at least one digit that changes when rotated (2,5,6,9). This…
Companies: Microsoft
Last reported Jan 2026
Companies: OpenAI
Segmentation & Cohort Analysis
Last reported Jan 2026
Design and implement a monster game system with appropriate data structures and game mechanics. Focus on object-oriented design principles and efficient algorithms for game…
Companies: OpenAI
Last reported Jan 2026
Given each employee's list of working intervals, compute the finite time intervals when every employee is free by merging/combining overlapping busy intervals across multiple…
Companies: Amazon, Google, Procore
Last reported Jan 2026
Companies: OpenAI
Data Structure Design · Memory Management
Last reported Jan 2026
Given a BST where exactly two nodes' values were swapped, restore the tree in-place (without changing its structure) so it satisfies the BST property. The…
Companies: Microsoft
Last reported Jan 2026