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–20
Given an integer array nums and two integers k and m, perform at most k increment operations on any elements, then return the maximum possible…
Companies: Amazon
Array · Bit Manipulation · Greedy · Sorting
Last reported Oct 2026
Given a start IPv4 address and a number of consecutive addresses, produce the minimal list of CIDR blocks that exactly cover that range. The key…
Companies: Databricks
Bit Manipulation · String
Last reported Aug 2026
Choose an integer x in [0, 2^n) to maximize (a XOR x) * (b XOR x) (answer mod 1e9+7); the core challenge is picking x’s…
Companies: Atlassian, Cisco, Zomato
Bit Manipulation · Greedy · Math
Last reported Jul 2026
Return the power set of a unique-element integer array by enumerating all 2^n subsets (typical solutions use backtracking/DFS or bitmask iteration), noting the exponential…
Companies: Amazon, Docusign, Meta, Microsoft
Array · Backtracking · Bit Manipulation
Last reported Jun 2026
Given a list of money transfers among people, compute the minimum number of transactions required to settle all debts so every person's net balance becomes…
Companies: Pinterest, Salesforce, Visa
Array · Backtracking · Bit Manipulation · Bitmask
Last reported Jun 2026
Companies: OpenAI
Bit Manipulation · Networking
Last reported Apr 2026
Companies: OpenAI
Bit Manipulation · Data Structure Design
Last reported Nov 2025
Companies: Anthropic
Bit Manipulation
Last reported Sep 2025
Companies: OpenAI
Bit Manipulation · Data Structure Design
Last reported Jan 2025
Given an array where every element appears exactly twice except for one, return the element that appears only once. Achieve O(n) time and O(1) space…
Companies: Amazon, Bloomberg, Meta
Array · Bit Manipulation
Last reported Dec 2024
Add two binary strings and return their sum as a binary string by performing digit-wise addition from the least significant bit with carry, handling unequal…
Companies: Meta
Bit Manipulation · Math · Simulation · String
Count the permutations of 1..n such that for every position i, either perm[i] is divisible by i or i is divisible by perm[i]. With n…
Companies: Rippling
Array · Backtracking · Bit Manipulation · Bitmask
Count pairs of nodes in a rooted tree whose path edge-letters can be rearranged into a palindrome — equivalently, the multiset of letters on the…
Companies: Goldman Sachs
Bit Manipulation · Depth-First Search · Hash Table · Tree
Given a binary sequence that evolves each row by replacing 0→01 and 1→10 (so row lengths double each time), return the k-th symbol in the…
Companies: D. E. Shaw
Bit Manipulation · Math · Recursion
Given n, you may add or subtract any power of two per operation; find the minimum number of such operations to reach 0. The core…
Companies: Salesforce, Uber
Bit Manipulation · Dynamic Programming · Greedy
Count the number of ways to assign distinct hats (labels 1..40) to n ≤ 10 people given each person's allowed hat list, returning the answer…
Companies: Roblox
Array · Bipartite Graph · Bit Manipulation · Bitmask
Count the number of non-empty substrings (in a string of letters 'a'–'j') whose character counts have at most one odd frequency. Core idea: track a…
Companies: Uber
Bit Manipulation · Hash Table · Prefix Sum · String
Partition the 2n integers into two equal-sized groups (choose n elements for one group) to minimize the absolute difference of their sums — a constrained…
Companies: Salesforce
Array · Binary Search · Bit Manipulation · Bitmask
Given up to 16 required skills and up to 60 people each with some skills, find the smallest set of people whose combined skills cover…
Companies: Airbnb
Array · Bit Manipulation · Bitmask · Dynamic Programming
Given an array of nonnegative integers, compute the sum of Hamming distances over all pairs of numbers. Key idea: for each bit position, count how…
Companies: Apple
Array · Bit Manipulation · Math