REPOSITORY CODING · HARD
Scope credit accounts and retry receipts to the tenant
Independent tenants collide when they reuse an account ID or request key. Trace account lookup and unit-of-work receipt identity. Both identities must include tenant with unambiguous tuple encoding. An exact same-tenant retry returns its original snapshot without another audit row; a changed payload with the same key remains a request-conflict.
Database EngineeringBusiness credit reservations
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
Java · 75 minute session
- open creates an account with id, owner and positive integer limit in cents. inspect reads its used and reserved balances.
- reserve takes a hold id, account, actor, positive amount, now and expiresAt greater than now. Only the owner reserves. Amount must fit limit minus used minus reserved.
- capture requires the owner, a reserved hold and now strictly before expiry. Reserved credit becomes used credit atomically.
- release requires the owner and a reserved hold. Captured and released holds are terminal. Expired holds remain reserved until explicitly released.
- Every command includes tenant. Mutations and audit commit together; failAudit must roll back. An optional request key replays the same result and rejects changed payloads. history returns tenant audit records.
Spring Boot · 75 minute session
- open creates an account with id, owner and positive integer limit in cents. inspect reads its used and reserved balances.
- reserve takes a hold id, account, actor, positive amount, now and expiresAt greater than now. Only the owner reserves. Amount must fit limit minus used minus reserved.
- capture requires the owner, a reserved hold and now strictly before expiry. Reserved credit becomes used credit atomically.
- release requires the owner and a reserved hold. Captured and released holds are terminal. Expired holds remain reserved until explicitly released.
- Every command includes tenant. Mutations and audit commit together; failAudit must roll back. An optional request key replays the same result and rejects changed payloads. history returns tenant audit records.