This is a verified interview question from Willingness. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Day Date Calculation - Willingness Online Assessment IIT BHU" covers key patterns like DP.
"Given: * The number of **days in a year** * The number of **days in a month** * The number of **days in a week** * A given **date** Determine which **day of the week** the given date falls on. The days of the week are represented using letters from **A to Z**. The first day of the year is considered the first day of the week. ### Input * `daysInYear` — total number of days in the year. * `daysInMonth` — number of days in each month. * `daysInWeek` — number of days in a week. * A date consisting of: * `day` * `month` * `year` ### Output Return the corresponding day of the week represented by a character from `A` to `Z`. ### Example Suppose: ```text daysInYear = 365 daysInMonth = 30 daysInWeek = 7 date = 2/3/2025 ``` Calculate the number of days elapsed before the given date and use modulo `daysInWeek` to determine its weekday. If the calculated weekday index is: ```text 0 → A 1 → B 2 → C 3 → D 4 → E 5 → F 6 → G ``` then return the corresponding character. ### Important The exact date format and whether the input contains **one fixed number of days per month or actual month lengths** should be confirmed from the original question."
Join thousands of developers practicing for Willingness.