Process Robux Wallet Transactions With Idempotent Replays

Last updated: November 29, 2026

Quick Overview

Process a stream of Robux wallet operations (grant, purchase, transfer), each with a transaction ID, rejecting any operation that would overdraw a balance and ignoring replayed transaction IDs. Return final balances and the IDs of rejected transactions.

Roblox
Coding & Algorithms
Software Engineer
Roblox
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

0

0 solved


Process a stream of Robux wallet operations (grant, purchase, transfer), each with a transaction ID, rejecting any operation that would overdraw a balance and ignoring replayed transaction IDs. Return final balances and the IDs of rejected transactions.

Shows up as an online assessment or early screen question themed on the Robux virtual economy, where correctness of money movement matters more than cleverness. The interviewer is checking careful state handling, idempotency, and that you never let a balance go negative.

What the Interviewer Expects
  • Model balances with a dictionary defaulting to zero
  • Reject purchases and transfers that exceed the balance
  • Treat repeated transaction IDs as no-ops, not as new operations
  • Reject unknown operation types instead of crashing
  • Explain why idempotency matters for client retries
Key Topics to Cover
simulation
state machines
idempotency
hash maps
virtual currency
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you make this safe if operations for the same user arrive on different servers?
  • What if a transfer must be all-or-nothing across two shards?
  • How would you support refunds that reference an earlier purchase ID?
  • Should a rejected transaction ID be allowed to be retried later?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Operations are tuples: (id, 'grant', user, amt), (id, 'purchase', user, amt), (id, 'transfer', src, dst, amt). Balances start at zero. A purchase or transfer that would make a balance negative i...

High-Level Design

This is a small state machine: state is the balance map plus a set of seen IDs. Each operation is validated against current state and either applied atomically or recorded as rejected. Checking seen...


Submit Your Answer
Markdown supported

Related Questions