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
205 questions
- 97If given two strings, each containing a number larger than 32-bit, how do you add them and return the result as a string?MediumCodingTechnical·
Waymo - 98Find all permutations of a given string.MediumCoding·
Amazon - 99You're trying to take a photograph of two teams arranged in rows. How would you order them so shorter players are in front and taller players are behind?EasyCodingTechnical·
Anduril - 100Calculate the average distance between cities.MediumCodingProduct·
Waymo - 101Find the first common ancestor of two nodes in a binary tree.MediumCoding·
Meta - 102How would you sort a bitonic array efficiently?MediumCoding·
Oracle - 103Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?MediumCoding·
Adobe, Apple - 104Calculate the height of a binary tree.EasyCoding·
Apple, Google - 105Calculate the number of times a pattern appears in a string.HardCoding·
LinkedIn - 106Build a CalculatorMediumCoding·
Adobe, Apple - 107Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding·
Adobe, Apple - 108How would you implement a child-parent relation for finding the Least Common Ancestor (LCA) without using pointers?MediumCoding·
Samsung - 109Find the closest number in a sorted array.MediumCoding·
DoorDash - 110Given an array of points on a plane (x,y), write a function to return the distance between the closest pair of points.HardCoding·
Visa - 111Given an array of integers, return the pairs with the minimum absolute difference between them.MediumCoding·
Microsoft - 112Given an integer, reverse it. Integers are within range [-2^15, 2^15 - 1].MediumCoding·
Microsoft - 113Construct a binary tree from an ancestor matrix.MediumCodingTechnical·
LinkedIn - 114Construct a binary tree given its preorder and inorder traversals.MediumCoding·
Adobe, Amazon - 115Given a string, return the number of vowel substrings ('a', 'e', 'i', 'o', 'u') that include all five vowels.MediumCoding·
Oracle - 116Count the number of ways to split a string.EasyCoding·
Google - 117Degrees of FriendshipEasyCoding·
Google - 118Design a data structure that supports insert, delete, search, and retrieve in constant time.MediumCoding·
Meta - 119If you have a vector with many values, mostly zeroes, how would you design a data structure to represent it?MediumCodingTechnical· WWhatsApp
- 120Design LFU cache.MediumCodingSystem design·
Microsoft