REPOSITORY CODING · HARD
An audit outage consumes the expense budget
An unsuccessful payment changes the available budget. Subsequent retries can also pay a completed report again. Trace transaction isolation and payment state together.
Repository ImplementationExpense clearing office
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
Django · 80 minute session
- budget creates an account with a positive integer amount in cents. balance returns its remaining amount.
- submit captures a report owner, budget and 1–100 uniquely identified lines with positive integer amounts. Its total is the sum of its lines.
- approve records a distinct reviewer. The owner cannot approve. Reports below 1000 cents require one approval; reports of 1000 cents or more require two.
- pay requires pending status, enough approvals and sufficient budget. Debit and paid status commit together. A paid or cancelled report cannot be paid again.
- cancel is owner-only and pending-only. pending lists the owner’s pending reports sorted by ID.
- Every command includes tenant and op. IDs belong to a tenant. Invalid commands return an error without stopping later commands.
- Mutations and their audit records commit together. failAudit rolls back all changes. Read operations do not increment revision.
- An optional request key makes retries idempotent per tenant. Reusing the key with different fields returns request-conflict.
- Use the authenticated workspace API for state across HTTP requests. /run is a disposable fixture. Time and failures are explicit inputs, so tests are repeatable.
Flask · 80 minute session
- budget creates an account with a positive integer amount in cents. balance returns its remaining amount.
- submit captures a report owner, budget and 1–100 uniquely identified lines with positive integer amounts. Its total is the sum of its lines.
- approve records a distinct reviewer. The owner cannot approve. Reports below 1000 cents require one approval; reports of 1000 cents or more require two.
- pay requires pending status, enough approvals and sufficient budget. Debit and paid status commit together. A paid or cancelled report cannot be paid again.
- cancel is owner-only and pending-only. pending lists the owner’s pending reports sorted by ID.
- Every command includes tenant and op. IDs belong to a tenant. Invalid commands return an error without stopping later commands.
- Mutations and their audit records commit together. failAudit rolls back all changes. Read operations do not increment revision.
- An optional request key makes retries idempotent per tenant. Reusing the key with different fields returns request-conflict.
- Use the authenticated workspace API for state across HTTP requests. /run is a disposable fixture. Time and failures are explicit inputs, so tests are repeatable.
Python · 80 minute session
- budget creates an account with a positive integer amount in cents. balance returns its remaining amount.
- submit captures a report owner, budget and 1–100 uniquely identified lines with positive integer amounts. Its total is the sum of its lines.
- approve records a distinct reviewer. The owner cannot approve. Reports below 1000 cents require one approval; reports of 1000 cents or more require two.
- pay requires pending status, enough approvals and sufficient budget. Debit and paid status commit together. A paid or cancelled report cannot be paid again.
- cancel is owner-only and pending-only. pending lists the owner’s pending reports sorted by ID.
- Every command includes tenant and op. IDs belong to a tenant. Invalid commands return an error without stopping later commands.
- Mutations and their audit records commit together. failAudit rolls back all changes. Read operations do not increment revision.
- An optional request key makes retries idempotent per tenant. Reusing the key with different fields returns request-conflict.
- Use the authenticated workspace API for state across HTTP requests. /run is a disposable fixture. Time and failures are explicit inputs, so tests are repeatable.