Is it just me or is this a baffling tech interview question
- by Matthew Patrick Cashatt
Background
I was just asked in a tech interview to write an algorithm to traverse an "object" (notice the quotes) where A is equal to B and B is equal to C and A is equal to C.
That's it. That is all the information I was given.
I asked the interviewer what the goal was but apparently there wasn't one, just "traverse" the "object".
I don't know about anyone else, but this seems like a silly question to me. I asked again, "am I searching for a value?". Nope. Just "traverse" it.
Why would I ever want to endlessly loop through this "object"?? To melt my processor maybe??
The answer according to the interviewer was that I should have written a recursive function.
OK, so why not simply ask me to write a recursive function? And who would write a recursive function that never ends?
My question:
Is this a valid question to the rest of you and, if so, can you provide a hint as to what I might be missing? Perhaps I am thinking too hard about solving real world problems. I have been successfully coding for a long time but this tech interview process makes me feel like I don't know anything.
Final Answer:
CLOWN TRAVERSAL!!! (See @Matt's answer below)
Thanks!
Matt