Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Puzzle Description
3.
Solution
4.
Frquently Asked Questions
4.1.
What is a leap year?
4.2.
Why is the extra day added to February in a leap year?
4.3.
What do you understand by analytical skills?
5.
Conclusion
Last Updated: Mar 27, 2024

Next Number

Author Urwashi Priya
1 upvote
Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @

Introduction

Puzzles are a really good measure of one's analytical skills and lateral thinking. Many product-based companies ask the puzzles to help them filter candidates based on their real-world problem-solving skills to approach a problem they have not seen before.

A puzzle may have multiple solutions, where the interviewer is generally interested in the candidate's approach to not only solving the puzzle but the approach to building and thinking creatively for the solution to the puzzle.

On the same note, we are going to discuss a very interesting puzzle commonly asked in interviews.

Puzzle Description

Identify the next number in the sequence

31, 28, 31, 30, __?

Here, we just need to find the following number in the given series.

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Solution

Here on seeing the sequence, we can figure out that the days in a month are given.

The first term is for 31 days in January, the second term is for 28 days in February assuming that it is not a leap year, the third term is for 31 days in March, similarly, 4th term is for 30 days in April.

Hence the next term would be 31, for the number of days in May.

The number of days in each month is given as follows:

January-31

February-28(if not a leap year), 29(if a leap year)

March-31

April-30

May-31

June-30

July-31

August-31

September-30

October-31

November-30

December-31

Frquently Asked Questions

What is a leap year?

The earth rotates around the sun in 365.25 days. After 4 years, this 0.25 days turns into 1 day, and it is added to February. The number of days in this special year becomes 366 days as a corrective measure. This year is called as a leap year. Generally, the year that can be divided by 4 is termed a leap year.

Why is the extra day added to February in a leap year?

This is due to a belief by roman that an even number is considered to be unlucky, so the day was not added as January as it would become 32. Moreover, February is the shortest month of the year.

What do you understand by analytical skills?

It refers to the ability of thinking and working with data, figuring out patterns and drawing conclusions

Conclusion

This article taught us how to solve the next number puzzle. We hope you could easily take away all critical and conceptual techniques by walking over the given examples. 

Now, we strongly recommend you to understand the other related concepts in puzzles and enhance your learning. You can get a wide range of topics similar to this on interview puzzles

You can also refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSQLSystem Design, and many more!

If you want to test your competency in coding, you may check out the Mock Test Series and participate in the Contests organized on Coding Ninjas Studio! But if you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc; you must look at the Problems, Interview Experiences, and Interview Bundle for placement preparations.

Nevertheless, you may consider our Courses to give your career an edge over others!

Do upvote our blog to help other ninjas grow. 

Happy Coding!    

Previous article
Fake Note
Next article
Celebrity Problem
Live masterclass