Salesforce Online Assessment Coding Interview: Count the Number of Days Between Two Dates

12 Views
No Comments

Given 2 dates in the format yyyy/mm/dd, return the number of days between them.

Do not use any library; parse it manually. Consider leap years and different month lengths.

This problem asks you to manually parse two dates in <code>yyyy/mm/dd</code> format and compute the number of days between them without using any date library. A common approach is to convert each date into a total day count from a fixed base date, then subtract the two values. The key details are handling month lengths correctly and applying leap-year rules so February has 29 days when appropriate.

END
 0