Walmart SDE3 interview DS+coding round
Anonymous User
393

Questions:

  1. In backend systems, webhooks or payment callbacks often fail and need to be retried. Design an in-memory data structure to handle delayed retries.

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)

  1. To prevent API abuse on a refund service, we need to implement an in-memory rate limiter for specific merchants.

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

Comments (2)