GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • Fundamentals & OOPs
  • Data structures and algorithms
  • Aptitude
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 27 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
AptitudeQuantitative aptitude · Clocks and Calendars

Calendars

Using odd days and the leap-year rule to find the day of the week for any date, shift days across weeks, months and years, count weekdays, and spot repeating calendars.

5 min read 45 questions
Practice questions

On this page

1/10
  1. 011. Why calendars appear in placement tests
  2. 022. Odd days: the core tool
  3. 033. The leap-year rule
  4. 044. The day of the week of any date
  5. 055. Days, weeks and years from a known day
  6. 066. Counting a weekday in a month or year
  7. 077. Repeating calendars
  8. 088. Common traps
  9. 099. Revision sheet
  10. 10Practice
Back to top

1. Why calendars appear in placement tests

A calendar question gives you one date and asks for the day of the week — of that date, or of another date some days, months or years away. You could never memorise a calendar, so the tests reward a method. The whole subject rests on a single idea: the week repeats every 7 days, so only the remainder after dividing by 7 matters. That remainder is called the number of odd days.

If two dates are a whole number of weeks apart, they fall on the same weekday. If they are a whole number of weeks plus 3 days apart, the second is 3 weekdays later. So every calendar problem becomes: count the days between, divide by 7, keep the remainder, and step that many weekdays on (or back).

Every 7 days the weekday repeatsMon1+7Mon8+7Mon15
Dates 7 days apart share a weekday; only the leftover days beyond whole weeks change the answer.

2. Odd days: the core tool

The odd days of a stretch of time are the days left over after taking out whole weeks. For 10 days, 10 = 7 + 3, so there are 3 odd days. The weekday also follows a fixed numbering when you count from a Sunday: 0 odd days means Sunday, 1 means Monday, and so on up to 6 for Saturday.

PeriodDaysOdd days
Ordinary year3651
Leap year3662
100 years—5
200 years—3
300 years—1
400 years—0

An ordinary year gives 1 odd day (365 = 52×7 + 1); a leap year gives 2 (366 = 52×7 + 2). Over 400 years the odd days cancel out to 0, so the whole Gregorian calendar repeats every 400 years.

3. The leap-year rule

A year is a leap year if it is divisible by 4 — except a century year (one ending in 00), which is a leap year only if it is divisible by 400. So 2004, 2008 and 2012 are leap years; 1900 is not (not divisible by 400), but 2000 is. This single exception is the most common trap in the chapter.

Year÷ 4?÷ 400?Leap?1900yesnoNo2000yesyesYes2024yes—Yes
For century years the ÷400 test decides; for all other years, ÷4 alone decides.

Why it matters: a leap year carries 2 odd days instead of 1, and it contains 29 February, so counting leap years correctly is what makes a multi-year jump come out right.

4. The day of the week of any date

To find the weekday of a date directly, add up the odd days from four blocks: a base that is a multiple of 400 years (0 odd days), the extra whole centuries, the whole years after that, and the days into the final year. Take 15 August 1947:

  1. Base 1600 years (a multiple of 400) → 0 odd days.
  2. Next 300 years → 1 odd day.
  3. 46 years with 11 leap years → 46 + 11 = 57 ≡ 1 odd day.
  4. 227 days from 1 January to 15 August → 227 ≡ 3 odd days.
  5. Total = 1 + 1 + 3 ≡ 5 odd days = Friday.
BaseCenturiesYearsDays160030046227
Convert each block to odd days, add them, and read off the weekday — 15 August 1947 was a Friday.

5. Days, weeks and years from a known day

Most questions give you a known weekday and ask for another, so you never need the absolute method. Just count the gap and reduce it mod 7. "What day, 100 days after a Tuesday?" — 100 = 14×7 + 2, so 2 days on from Tuesday is Thursday. "n years later" is the same idea: add 1 odd day for each ordinary year and 2 for each leap year in between.

A neat consequence: in an ordinary year, 31 December falls on the same weekday as 1 January (365 = 52 weeks + 1 day, and the last day is 364 days — exactly 52 weeks — after the first). In a leap year, 31 December is one weekday later than 1 January.

6. Counting a weekday in a month or year

A 31-day month is 4 weeks + 3 days, so three weekdays occur 5 times and the other four occur 4 times; the three lucky weekdays are the ones the month starts on and the next two. A 30-day month gives two weekdays 5 times. February in an ordinary year (28 days) gives every weekday exactly 4 times.

Over a whole year the same logic applies to the leftover day(s). An ordinary year (52 weeks + 1 day) has one weekday occurring 53 times — the weekday it starts on. A leap year (52 weeks + 2 days) has two such weekdays: the starting one and the next. So "a year with 53 Mondays" that is ordinary must have begun on a Monday.

7. Repeating calendars

Two years share an identical calendar when they start on the same weekday and have the same leap-year status (so that February and every later date line up). To find the next match, add the odd days of each passing year until the running total is again a multiple of 7, checking that the leap status agrees. The year 2023, for instance, repeats in 2034 — 11 years later.

When a calendar comes back2023ordinary+11 yr2034same
Ordinary years usually repeat after 6 or 11 years; a leap year repeats only after 28 years.

Leap years are special: because the 29 February must also match, a leap-year calendar repeats only every 28 years (in a run with no century exception).

8. Common traps

  • Treating 1900, 2100 or 2200 as leap years — a century year needs to be divisible by 400.
  • Forgetting that a leap year adds 2 odd days, not 1, when jumping across years.
  • Counting the gap but not reducing it mod 7, or stepping in the wrong direction for "ago" / "before".
  • Assuming any year with the same start day repeats the calendar — the leap status must match too.
  • Mixing up the day-numbering (0 = Sunday) when using the absolute odd-days method.
  • Counting 29 February inside a span that does not actually contain it.

9. Revision sheet

  • Odd days = days ÷ 7, keep the remainder. 0 = Sunday … 6 = Saturday.
  • Ordinary year → 1 odd day; leap year → 2. 100/200/300/400 years → 5/3/1/0 odd days.
  • Leap year: divisible by 4, but a century year only if divisible by 400.
  • Day of any date = (centuries + years + days) odd days, from a 400-year base.
  • n days / weeks / years away: reduce the gap mod 7 and step that many weekdays.
  • Ordinary year: 31 Dec = same weekday as 1 Jan; one weekday occurs 53 times.
  • Same calendar: same start weekday and same leap status (ordinary ≈ +6/+11, leap +28).

Practice

45 questions in 3 sets. Every answer comes with its explanation, and each question you get right earns XP.

  • Easy · 15
  • Medium · 15
  • Hard · 15
Start practising
PreviousSimplification and ApproximationNextClocks
Log inStart free