|
|
|
|
|
by jiggawatts
1783 days ago
|
|
There was a hilarious rant about a FAANG hiring question that was something like: "Write an algorithm for detecting if a linked list has any loops in it, in linear time, using a constant amount of memory." Apparently the correct answer is to use "Robert W. Floyd's tortoise and hare algorithm", which is trivial to explain and code. The catch? It took a decade of computer science research between the original statement of the problem and Floyd discovering the solution. So... no worries, you have an hour, a marker, and a whiteboard. Your time starts: now. |
|
"So we specifically asked for linear time."
"Uh, yeah, I did it in log(n). That's better."
"It doesn't match what's on this paper they gave me. Thanks for your time. We'll be in touch."