The Convert Date to Binary interview question asks you to take a date string in the format "YYYY-MM-DD" and return a string where each part (Year, Month, Day) is converted to its binary representation, separated by dashes.
Google uses the Convert Date to Binary coding problem as a basic string parsing and number formatting test. It evaluates if a candidate can handle string splitting, integer conversion, and custom binary string generation without relying on expensive library calls.
This utilizes the Math, String interview pattern.
Input: "2080-02-29"
Be comfortable with manual decimal-to-binary conversion. Even though most languages have bin() or toString(2), interviewers might ask you to implement it manually to see your understanding of the "Divide by 2" algorithm.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Base 7 | Easy | Solve | |
| Day of the Year | Easy | Solve | |
| Number of Days Between Two Dates | Easy | Solve | |
| Excel Sheet Column Number | Easy | Solve | |
| Excel Sheet Column Title | Easy | Solve |