Honestly I think this kind of question isn't suitable for an interview and is an "edge case" of programming knowledge. You'd never write code like this in the real world, therefore it has no commercial value and seems daft to test in an interview.
In my opinion interview questions/tasks should be "real world" and allow the candidate to show their critical thinking and problem solving abilities, rather than testing their understanding of language nuances.
Well, I was not happy with this task as well. It took me about 40 minutes to solve it 😂
Other tasks were closer to the problems a programmer solves in his/her day-to-day work.
But it was very interesting for me to solve this task and it was the inspiration for this post.
Honestly I think this kind of question isn't suitable for an interview and is an "edge case" of programming knowledge. You'd never write code like this in the real world, therefore it has no commercial value and seems daft to test in an interview.
In my opinion interview questions/tasks should be "real world" and allow the candidate to show their critical thinking and problem solving abilities, rather than testing their understanding of language nuances.
Well, I was not happy with this task as well. It took me about 40 minutes to solve it 😂
Other tasks were closer to the problems a programmer solves in his/her day-to-day work.
But it was very interesting for me to solve this task and it was the inspiration for this post.
Yeah - you did a great job to be able to solve it!