Problems and Functions
Implement a queue with two stacks.
Assume you already have a stack implementation.Computer the nth Fibonacci number.
Careful--the recursion can quickly spin out of control!Find the area of overlap between two rectangles.
In the name of love.Write a function that will replace your role as a cashier and make everyone rich or something.
Write a function that finds the corresponding closing parenthesis given the position of an opening parenthesis in a string.
Write a super-simple JavaScript parser that can find bugs in your intern's code.
Write a function to see if a binary tree is 'superbalanced'--a new tree property we just made up.
Write a function to check that a binary tree is a valid binary search tree.
Find the second largest element in a binary search tree.
I'm making a new search engine called MillionGazillion(tm), and I need help figuring out what data structures to use.
You've hit the mother lode: the cake vault of the Queen of England.
Figure out how much of each cake to carry out to maximize profit.You're building a word cloud.
Write a function to figure out how many times each word appears so we know how big to make each word in the cloud.You've implemented a Stack class, but you want to access the largest element in your stack from time to time.
Write an augmented LargestStack class.In a beautiful Amazon utopia where breakfast is delivered by drones, one drone has gone missing.
Write a function to figure out which one is missing.Write a function to delete a node from a linked list.
Turns out you can do it in constant time!Write a function to reverse a linked list in place.
Find the kth to last node in a singly-linked list.
We'll start with a simple solution and move on to some clever tricks.Write a function to reverse a string in place.
Write a function to reverse the word order of a string, in place.
It's to decipher a supersecret message and head off a heist.Efficiently sort numbers in an array,
where each number is below a certain maximum.Find the repeat number in an array of numbers.
Optimize for runtime.Given an array of numbers in sorted order,
how quickly could we check if a given number is present in the array?I wanted to learn some big words to make people think I'm smart, but I messed up.
Write a function to help untangle the mess I made.Writing a simple recommendation algorithm
that helps people choose which movies to watch during flights.Check if any permutation of an input string is a palindrome.
Write a recursive function of generating all permutations of an input string.
Do an in-place shuffle on an array of numbers.
It's trickier than you might think!Write a function to tell us if cafe customer orders
are served in the same order they're paid for.Given a 7-sided die, make a 5-sided die.
Given a 5-sided die, make a 7-sided die.
A building has 100 floors.
Figure out the highest floor an egg can be dropped from without breaking.Figure out which number is repeated.
But here's the catch: optimize for space.Figure out which number is repeated.
But here's the catch: do it in linear time and constant space!Your friend copied a bunch of your files and put them in random places around your hard drive.
Write a function to undo the damage.Figure out the optimal buy and sell time for a given stock,
given its prices yesterday.For each number in an array, find the product of all the other numbers.
You can do it faster than you'd think!Find the highest possible product that you can get by multiplying any 3 numbers from an input array.
Write a function for merging meeting times
given everyone's schedules. It's an enterprise end-to-end scheduling solution, dog.Write code to continually track the max, min, mean, and mode
as new numbers are inserted into a tracker class.Design a ticket sales site, like Ticketmaster.