FastPrepDay of the Week Years Later
Problems/Day of the Week Years Later

Day of the Week Years Later

Jane Street logoJane Street● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in four Jane Street trading desk operations interview reports posted in 2022, mostly in the phone round. One candidate was given a Friday in July 2022 and asked for the day of the week on the same date ten years later. Two others were asked for the day of the week ten years later, one of them counting from the interview day, and one report only mentions finding the day of the week of a future date.

In the interview it was a mental puzzle about one date. We turned it into a function that takes any date, its day of the week and any number of years. The year and offset ranges, the rule that the start date is not 29 February, and the 2000 and 2096 examples are ours.

Our version is about 90% the same as the reported question.

Today is the date day/month/year, and it is a weekday. Return the day of the week of the same day and month exactly years years later.

Days of the week are written in full with a capital first letter: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" or "Sunday".

Use the Gregorian calendar. A year is a leap year if it is divisible by 4, except years divisible by 100 that are not divisible by 400. A leap year has 366 days because it includes 29 February; other years have 365 days.

Function

weekdayAfterYears(day: int, month: int, year: int, weekday: String, years: int) → String

Examples

Example 1

day = 8month = 7year = 2022weekday = "Friday"years = 10return = "Thursday"

Ten ordinary years would be 3650 days. Between the two dates there are three 29 Februaries, in 2024, 2028 and 2032, so the gap is 3653 days. That is 521 full weeks and 6 extra days, and six days after a Friday is a Thursday.

Example 2

day = 1month = 1year = 2000weekday = "Saturday"years = 1return = "Monday"

The year 2000 is divisible by 400, so it is a leap year, and going from 1 January 2000 to 1 January 2001 passes 29 February 2000. The gap is 366 days, which is 52 weeks and 2 days. Two days after Saturday is Monday.

Example 3

day = 1month = 3year = 2096weekday = "Thursday"years = 8return = "Saturday"

From 1 March 2096 to 1 March 2104 the years whose February could hold a 29th are 2100 and 2104. 2100 is divisible by 100 and not by 400, so it is not a leap year and has no 29 February. Only the leap day of 2104 counts, so the shift is 8 + 1 = 9 days, which is 2 days after removing a full week. Two days after Thursday is Saturday.

Constraints

  • 1900 <= year <= 2100
  • 1 <= month <= 12
  • 1 <= day <= 31
  • 1 <= years <= 1000
  • day, month and year form a real date, and it is not 29 February.
  • weekday is the real day of the week of that date.

More Jane Street Phone Screen questions

  • Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
  • Tree Selection and VisibilityPHONE SCREEN · Seen Nov 2026
  • Load/Store Arithmetic InterpreterPHONE SCREEN · Seen Oct 2026
  • Instrument Stack Language JumpsPHONE SCREEN · Seen Oct 2026
  • Run a Stack Language InterpreterPHONE SCREEN · Seen Oct 2026
  • Positive-Integer Expression EvaluationPHONE SCREEN · Seen Oct 2026
  • Add Two Integers Given as StringsPHONE SCREEN · Seen Sep 2026
  • Angle Between Clock HandsPHONE SCREEN · Seen Jul 2026
  • Route Length From Two CyclistsPHONE SCREEN · Seen Jul 2026
  • Sort TradesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Sqrt(x)LinkedIn · PHONE SCREENLinkedIn interview questions
  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Subtract Two Large Number StringsStackAdapt · PHONE SCREENStackAdapt interview questions
  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesStripe · PHONE SCREENStripe interview questions
  • Circular Primes Below a LimitAmazon · PHONE SCREEN
  • Palindrome NumberKotak Mahindra Bank · PHONE SCREENKotak Mahindra Bank interview questions
  • Streaming AverageXantium · PHONE SCREEN
  • Fair Coin from a Biased CoinAnthropic · PHONE SCREENAnthropic interview questions
  • Stack Formula InterpreterTypeSafe AI · PHONE SCREEN
  • Employee Count Median, Mean and ModeClay · PHONE SCREEN

Interview reports that mention this question

  • Jane Street TDO Phone Math Round: 26 Experiences (Part 9 of 10)
  • Jane Street TDO Earlier US Finals: 19 Experiences (Part 7 of 10)

Jane Street interview experiences

  • Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
  • Jane Street TDOE US Final Round: 11 Experiences (Part 5 of 10)
  • Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
  • Jane Street TDO Excel and VBA Test: 23 Experiences (Part 8 of 10)
All Jane Street interview questionsSee Jane Street hiring insights
Saved
class Solution {
    public String weekdayAfterYears(int day, int month, int year, String weekday, int years) {
      // Write your code here.
    }
}
Checking account…