As reported: Salesforce full-stack software developer loop (San Francisco, Jan 2025), round 2 (coding, 45 minutes, with behavioral questions).
This is LeetCode 1360 — Number of Days Between Two Dates.
Given two dates as strings YYYY-MM-DD, return the number of days between them (the absolute difference).
Example 1
date1 = "2019-06-29", date2 = "2019-06-30"
Output: 1
Example 2
date1 = "2020-01-15", date2 = "2019-12-31"
Output: 15
Constraints: the dates are valid dates between the years 1971 and 2100.
Code runner format: one JSON value per line: date1, then date2. Implement daysBetweenDates(date1, date2); the harness prints the number of days.