CoolMind


If you cannot measure it, you cannot improve it.

Pick a number randomly from an unlimited stream

Problem Solution Comments Problem This problem was asked by Facebook. Given a stream of elements too large to store in memory, pick a ra...

Estimate PI

Problem Solution Problem This problem was asked by Google. The area of a circle is defined as $\pi r^{2}$ . Estimate $\pi$ to 3 decimal pl...

At most distinct K

Problem Solution Problem This problem was asked by Amazon. Given an integer k and a string s, find the length of the longest substring tha...

Climb up staircase

Problem Solution Reference Problem This problem was asked by Amazon. There exists a staircase with N steps, and you can climb up either ...

An autocomplete system

Problem Solution Comments Problem This problem was asked by Twitter. Implement an autocomplete system. That is, given a query string s a...

Job scheduler

Problem Solution Reference Problem This problem was asked by Apple. Implement a job scheduler which takes in a function f and an integer...

Maximum non-adjacent sum

Problem Solution Problem This problem was asked by Airbnb. Given a list of integers, write a function that returns the largest sum of non-...

Xor linked list

Problem Solution Comments Problem This problem was asked by Google. An XOR linked list is a more memory efficient doubly linked list. In...