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 3,801–3,825
Companies: Infosys
Array · Math · Simulation
Given an array and a defined unit operation that changes element values, compute the minimum number of such operations required to reach a target/configuration; the…
General practice
Partition the timeline into at most k+1 contiguous segments (each segment uses a fixed array size equal to its segment's maximum element) and minimize the…
General practice
Given a target word and a dictionary, find the shortest abbreviation (letters kept + counts for omitted runs) of the target that cannot represent any…
General practice
Given an array and a set of locked indices that cannot change, find the minimum number of indices you must unlock so that by permuting…
General practice
Find the smallest positive startValue such that when added to the running sum of nums (prefix sums), every cumulative total stays at least 1. This…
General practice
Given a weighted directed graph and nodes src1, src2, and dest, find the minimum total edge weight of a subgraph that allows both src1 and…
General practice
Given a weighted tree and many queries of three distinct nodes (src1, src2, dest), return the minimum total weight of a connected subtree that contains…
General practice
Given a binary string of tiles, place up to numCarpets fixed-length intervals (carpets may overlap) to cover tiles so as to minimize the number of…
General practice
Companies: Google
Array · Bit Manipulation · Dynamic Programming · Matrix
Given two length-n arrays, permute nums2 to minimize the sum of pairwise XORs with nums1; with n ≤ 14 this is typically solved by an…
General practice
Given a square room of side p and a laser from the southwest corner that first hits the east wall q units up, determine which…
General practice
Given an array of n distinct numbers from the range [0, n], find the single number in that range that is missing from the array…
General practice
Given a sorted sequence that should form an arithmetic progression but has exactly one element missing, find the missing value by detecting the constant common…
General practice
Given an employees table with name and salary columns, return the same table with each salary doubled (salary * 2) while preserving the name column.
General practice
Given an undirected weighted graph where some edges have weight -1 (modifiable) and others are fixed, assign positive integer weights (in [1, 2e9]) to the…
General practice
Given an m x n matrix, return a new matrix where each entry equal to -1 is replaced by the maximum value found in its…
General practice
Given n, return the largest integer ≤ n whose digits are nondecreasing left-to-right (each digit ≤ the next); the challenge is to transform n's digits…
General practice
Group transactions by month (YYYY-MM derived from trans_date) and country to compute total transaction count and sum of amounts, along with the count and sum…
General practice
Given a table of transactions (customer, date, amount), aggregate spending by customer and month and identify the months where a customer's total spending strictly increased…
General practice