Approach
Now, we will see a solution approach to the daughters' ages puzzle. The first hint he gave was the product of the ages of three girls as 72. So we will encounter all the possibilities of ages which gives 72 as their product and that are -
1 * 1 * 72 = 72
1 * 2 * 36 = 72
1 * 3 * 24 = 72
1 * 4 * 18 = 72
1 * 6 * 12 = 72
1 * 8 * 9 = 72
2 * 2 * 18 = 72
2 * 3 * 12 = 72
2 * 4 * 9 = 72
2 * 6 * 6 = 72
3 * 3 * 8 = 72
3 * 4 * 6 = 72
Now the second hint was that the sum of the ages of all three daughters is the number on a building they were referring to. So possibilities can be-
1 + 1 + 72 = 72
1 + 2 + 36 = 39
1 + 3 + 24 = 28
1 + 4 + 18 = 23
1 + 6 + 12 = 19
1 + 8 + 9 = 18
2 + 2 + 18 = 22
2 + 3 + 12 = 17
2 + 4 + 9 = 15
2 + 6 + 6 = 14
3 + 3 + 8 = 14
3 + 4 + 6 = 13
But here, if we see, all the sums are unique except 14 which confused the second man as he couldn’t find out with the second hint due to two possibilities. Now, we have two patterns for the Daughters' Ages. Still, we can't clearly say the daughters' ages, but the oldest one just started to play the piano, looking at the third hint. The oldest daughter is single, not twins, as the same age means born as twins.
so our final answer will be 3 + 3 + 8 = 14
The ages of the daughters are - 3, 3, 8
So, this is the approach to solve the daughters' ages puzzle.
Check out this problem - 8 Queens Problem
Frequently Asked Questions
What is the definition of a puzzle?
A puzzle is a game that uses words, toys, questions, and other items to help us improve our problem-solving skills.
What are the benefits of puzzle-solving?
People's problem-solving skills improve when they solve puzzles. It also helps a person's logic.
Do software companies frequently ask for puzzles?
Since problem-solving is an essential part of programming, all software firm applicants are regularly put to the test using puzzle problems. As a result, it's not uncommon for software companies to ask candidates to solve riddles during their interviews.
What are some of the most common interview questions and puzzles?
The following are some of the most common interview questions:
Bag of Coins Puzzle
Crossing the Bridge Puzzle
Heaven or Hell Puzzle
Gold Bar Cut Puzzle
Three Mislabeled Jars
Man Fell in Well Puzzle
Will you be asked puzzles in interviews all of the time?
While most interviewers do not specifically request puzzles, they are common, and some interviews may even contain specialized puzzle-solving sections. It's always good to be prepared if anything unexpected occurs.
Conclusion
In this article, we have extensively discussed the problem of daughters' ages with the solution.
We hope that this blog has helped you enhance your knowledge regarding encryption and if you would like to learn more, check out our articles on Camel and the Banana Puzzle and The Full Pyramid Of Odd Number Pattern.
Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.
Also check out some of the Guided Paths on topics such as Interview Puzzles, Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.
Do upvote our blog to help other ninjas grow.
Happy Learning!