I was given such a ridiculous interview question, absolutely no relation to real-world practices and was more of a puzzle than anything and tested no practical or algorithmic thinking. To be completely honest, I was astounded that I was given such an absurd question. I pretty much got the question right, just a few implementation details that I had to fix but ran out of time but honestly, I don't know how you would be able to solve this problem completely if you hadn't seen it before (and I had not seen it before). Absolutely useless question and tests zero conceptual thinking. It reminded me more of bit manipulation. I liked the recruiters though!