Design a Tax Record Store with Time-Windowed Query Support
Design a system that stores tax records (tax amount, employee ID, timestamp) and retrieves the total tax amount for a given employee over the past 30 days. As a follow-up, extend the solution to support querying tax totals over any arbitrary time range, where records may not be stored in chronological order.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early September, 2026
We need to calculate taxes for an employee. 1) We first store the tax amount , employee id and the timestamp. 2) We then get the past 30 days tax amount for a given employee id. Follow up: The tax amount is not stored in a chronological order and we can calculate taxes for any given time range.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.