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
- 217Calculate the average distance between cities.MediumCodingProduct·
Waymo - 218Find the first common ancestor of two nodes in a binary tree.MediumCoding·
Meta - 219How would you sort a bitonic array efficiently?MediumCoding·
Oracle - 220Given a bookstore database schema, write SQL queries using joins and aggregations to answer questions about sales, inventory, and customer data.MediumCodingData·
Meta - 221Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?MediumCoding·
Adobe, Apple - 222Calculate Test ScoresMediumCodingData·
Google - 223Build a CalculatorMediumCoding·
Adobe, Apple - 224Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding·
Adobe, Apple - 225Find the closest number in a sorted array.MediumCoding·
DoorDash - 226Given an array of integers, return the pairs with the minimum absolute difference between them.MediumCoding·
Microsoft - 227Given an integer, reverse it. Integers are within range [-2^15, 2^15 - 1].MediumCoding·
Microsoft - 228Coin ChangeMediumCodingTechnical·
Apple, Citi - 229Construct a binary tree from an ancestor matrix.MediumCodingTechnical·
LinkedIn - 230Construct a binary tree given its preorder and inorder traversals.MediumCoding·
Adobe, Amazon - 231Given a list of words, find the number of prefix pairs, i.e. pairs i, j where words[i] == words[j] or words[i].startswith(words[j]) or words[j].startswith(words[i]).MediumCoding·
Capital One - 232Find the number of users who called three or more people in the last week.MediumCodingData·
Meta - 233Given a string, return the number of vowel substrings ('a', 'e', 'i', 'o', 'u') that include all five vowels.MediumCoding·
Oracle - 234Custom Sort StringMediumCoding·
Meta - 235Implement a decode and encode function of a general N-ary tree.MediumCoding·
Google - 236Build an image carousel that displays a sequence of images (using React.js or vanilla JS).MediumCoding·
Amazon - 237Design a data structure that supports insert, delete, search, and retrieve in constant time.MediumCoding·
Meta - 238If you have a vector with many values, mostly zeroes, how would you design a data structure to represent it?MediumCodingTechnical· WWhatsApp
- 239Design and implement a ranked cache system.MediumCodingSystem design·
LinkedIn - 240Design LFU cache.MediumCodingSystem design·
Microsoft