Question bank
4,310 interview questions, answered.
Reference answers, what the interviewer is really testing, how it is graded, and the follow-ups that come next.
Easy 190Medium 2,498Hard 982
Filters · onDifficulty, topic, company
343 questions
- 145Write a function that takes an array of integers and checks for duplicate values in any contiguous window of size N.MediumCoding·
Meta - 146Given a castle with rooms named after flowers where each room has an instruction to the next room, write an algorithm to find the rooms containing treasure.MediumCoding·
PayPal - 147Given a collection of rooms where Alibada is in one and moves one room a day to an adjacent room, write a program to determine if you can find Alibada with the given list of rooms.MediumCoding·
Meta - 148Given an integer n, return the number of steps to reach 1 following these rules: if n is even, divide by 2; if odd, multiply by 3 and add 1.MediumCoding·
Bloomberg - 149Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding·
Meta, Microsoft - 150Given two empty jugs with capacities a and b liters and an infinite water supply, determine a way to end up with exactly X liters of water.MediumCoding·
Microsoft - 151Print all combinations of numbers from 1 to n that sum to n.MediumCoding·
Adobe, Apple - 152Find the container with the maximum volume of water.MediumCoding·
Apple, Goldman Sachs - 153Count items within compartments between specific indices of an array.MediumCoding·
Amazon - 154Cycle Detection in Package Manager.MediumCoding·
Adobe - 155Debug a metric that was off by x percentage.MediumDataCoding·
Databricks - 156Delete Node in a Binary Search Tree (BST).MediumCoding·
Microsoft - 157Design a rewarding system.MediumCoding·
Uber - 158Design a file upload feature for an AI chat application.MediumCodingSystem design·
xAI - 159Explain how to design and implement a password checker based on specific requirements.MediumCodingTechnical·
Peloton - 160Design an indexer and a retrieverMediumCoding·
Apple - 161Explain the differences between an interface and an abstract class.MediumCodingTechnical·
Goldman Sachs, Microsoft - 162Sort a list of natural numbers and their squares in the most efficient way possible.MediumCoding·
Google - 163Explain malloc, calloc, and reelloc.MediumCodingTechnical·
Google - 164Explain the differences between stack and heap memory allocation.MediumCoding·
Apple, Microsoft - 165Find a local minima in an array Last UpdatedMediumCoding·
Meta - 166Given an array with objects colored red, white, or blue, sort them so those of the same color are adjacent. Use integers 0, 1, 2 to represent RWB respectively.MediumCoding·
Apple - 167Find the equilibrium index in an array where sum of elements to the left is equal to sum of elements to the right.MediumCoding·
Meta - 168Find the median from a data stream.MediumCoding·
Bloomberg