The test isn't about whether you know the algorithm – quite the opposite. The test is about seeing how you approach a problem you haven't (possibly) solved before.
1. Someone genuinely solving the question on the fly
2. Someone who memorized the answer, and is just pretending to solve it on the fly
There are rumors that unless you are spot on perfect in Big 4 interviews, they wont advance you.
It's about understanding the computer science fundamentals in order to keep your code from burning up 1000's of cores due to asymptotically-poor characteristics.