The Wayback Machine - https://web.archive.org/web/20231126142657/https://www.geeksforgeeks.org/birthday-puzzle/
Open In App
Related Articles

Birthday Puzzle

Improve Article
Improve
Save Article
Save
Like Article
Like

Puzzle:
On a new year day, two old friends (A and B) meet at a party. As they met after a long time person B wanted person A to guess his birthday. As both friends are not in touch for a long time person A was unable to guess his birthday. So person B decided to give some hints. Below are the hints:

  1. The day before yesterday I was 25 and next year I will be 28, then person B asked person A to find his birthday. 
  2. The above condition can be true for only one day in the year

Solution:

Person B’s birthday is on December 31.

Explanation:

Person A met his old friend on New Year that is on January 1. So, the day before yesterday was December 30 at that time person B was 25 year old and at the present Day(January 1) B is 26 years old.

This year on December 31 person B will be of age 27 and next year his age will be 28.

Date

Age

December 30 25 years old
December 31 26 years old
January 1 (This year) 26 years old
December 31 (This year) 27 years old
December 31 (Next year) 28 years old

Therefore, Person B’s birthday is on December 31.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 18 Jan, 2023
Like Article
Save Article
Similar Reads