Questions:
When an event fails, it needs to be retried after a specific delay (e.g., 5 seconds, then 15 seconds, etc.).
Please explain the data structures you would use to implement these two methods efficiently:
public void scheduleRetry(String eventId, long executeAtTimestamp)
public List getEventsToExecuteNow(long currentTimestamp)
The rule is: A merchant can only initiate 'K' refunds within a rolling 5-minute window.
Explain the data structures you would use to implement a method boolean allowRefund(String merchantId, long timestamp) that returns true if the refund is allowed, and false if they have exceeded their limit in the last 5 minutes."
The interviewer was kind enough to explain the question multiple times. It was medium level coding questions