Justworks interview question

Some algorithms.