Interview puzzles are critical-thinking and logical reasoning problems that make candidates use their problem-solving and analytical skills to find a solution. Interviewers prefer to ask these puzzles because it helps them understand your thought process, and your ability to solve complex problems using strategies, and high-order thinking. Usually, candidates applying for software development, data science, or engineering roles may encounter such puzzles. Much like brain teasers and logical reasoning questions, puzzles for interviews may not directly relate to your job role.
A farmer had a fox, a chicken, and some corn. He had to cross a river. There was a boat, but it could carry only the farmer and one more thing. How will he cross the river and carry all three across? If he leaves the fox and the chicken together, the fox will eat the chicken and if he leaves the chicken and the corn, the chicken will eat the corn. What should he do?
Solution
Step1 : The man and the chicken cross the river, (the fox and corn are safe together), and he leaves the chicken on the other side and goes back across.
Step2 : The man then takes the fox across the river, and since he can't leave the fox and chicken together, he brings the chicken back.
Step3 : Again, since the chicken and corn can't be left together, he leaves the chicken and takes the corn across, and leaves it with the fox.
Step4 : He then returns to pick up the chicken and heads across the river one last time.
Check the video for a detailed explanation.
No comments:
Post a Comment