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 1,101–1,125
Given a string s and an integer k, determine whether s can be transformed into a palindrome by deleting at most k characters — equivalently…
Companies: Meta
Last reported Mar 2025
Companies: LinkedIn
Last reported Mar 2025
Companies: Snap
Last reported Mar 2025
Count how many pairs of distinct leaf nodes in a binary tree have a shortest-path length less than or equal to a given distance. The…
Companies: LinkedIn
Last reported Feb 2025
Return the third distinct largest value in an integer array (treat duplicate values as one); if fewer than three distinct values exist, return the maximum…
Companies: Meta
Last reported Feb 2025
Design an algorithm to elect a restaurant from a set of choices for a team outing. Each team member can select n options in their…
Companies: LinkedIn
Last reported Feb 2025
Given a BST root and a value not already present, insert the value as a new leaf in the correct position to preserve BST ordering…
Companies: Anduril, LinkedIn
Binary Search Tree · Binary Tree · Tree
Last reported Feb 2025
Given a stream of daily stock prices, implement an online data structure that returns for each new price the number of consecutive days (including today)…
Companies: Meta
Last reported Feb 2025
Design a data structure that manages a fixed pool of phone numbers (0..maxNumbers-1) supporting get (assign and return an available number), check (report if a…
Companies: Apple
Last reported Feb 2025
Given an n×n matrix, rotate it 90° clockwise in-place (no extra matrix allowed), i.e., rearrange the elements so each row becomes the corresponding column after…
Companies: Bloomberg, ByteDance, Meta, NVIDIA
Array · Math · Matrix
Last reported Feb 2025
Check whether the characters in pattern and the space-separated words in s have a bijective (one-to-one and onto) mapping that preserves order — i.e., each…
Companies: Google, Meta
Last reported Feb 2025
Implement an iterator over a 2D vector that yields integers in row-major order via next() and hasNext(). The core challenge is maintaining indices and skipping…
Companies: Google, Meta
Last reported Feb 2025
Given an m×n rectangle and a list of prices for specific h×w pieces (rotation not allowed), maximize total revenue by cutting the rectangle with full-width…
Companies: Meta
Last reported Feb 2025
Given an undirected weighted graph, find the minimum possible path score between city 1 and city n, where a path's score is the smallest edge…
Companies: Amazon
Last reported Feb 2025
Given an even-length array of [freq, val] pairs representing run-length encoding, return the decompressed list formed by repeating each val freq times and concatenating the…
Companies: Meta
Last reported Feb 2025
Given two arrays of lowercase strings, determine whether concatenating each array’s elements in order produces the same overall string. This can be solved by comparing…
Companies: Meta
Last reported Feb 2025
Given a binary tree where each node has left, right, and an extra random pointer to any node (or null), produce a deep copy of…
Companies: Meta
Last reported Feb 2025
Count the number of ways to paint n fence posts with k colors such that no more than two adjacent posts have the same color…
Companies: Amazon
Last reported Feb 2025
Like LeetCode 415. Add Strings, but with the additional consideration that there can be decimals with varying precision.
Companies: Oracle
Last reported Jan 2025
Normalize the paragraph to lowercase and ignore punctuation, count the frequency of each word while skipping any banned words, and return the most frequent non-banned…
Companies: Datadog
Last reported Jan 2025
Given a string s and an array of equal-length words, find all starting indices of substrings in s that are a concatenation of each word…
Companies: Google
Last reported Jan 2025
Given a sorted array of distinct integers and a target, return the index where the target is found or the index where it should be…
Companies: Bloomberg, Google, Grammarly, Meta
Array · Binary Search
Last reported Jan 2025
Given an array nums, return diff where diff[i] = (number of distinct elements in nums[0..i]) minus (number of distinct elements in nums[i+1..n-1]). This is solved…
Companies: Google
Last reported Jan 2025
Given a string s and integer k, find the longest subsequence where the absolute difference between every two adjacent letters' positions in the alphabet is…
Companies: Microsoft
Last reported Jan 2025