Recorded grading example · 18 October 2026

Converted refunds into charges; both checks failed.

A deliberately flawed submission tested during development. This is a bounded grading fixture, not a candidate session or hiring-validity study.

The task

solve receives an object with a rows list. Input is a list of rows with account and signed amount strings, with at most two decimal places. Sum amounts as supplied per account: refunds are already negative. Retain zero and negative account totals. Return a mapping from account to an exact two-decimal string. Empty input yields {}.

Submitted work solution.py

1from decimal import Decimal
2def solve(payload):
3    rows = payload["rows"]
4    totals = {}
5    for row in rows:
6        amount = abs(Decimal(row["amount"]))
7        account = row["account"]
8        totals[account] = totals.get(account, Decimal("0")) + amount
9    return {account: format(total, ".2f") for account, total in sorted(totals.items())}

Captured reviewer findings

The implementation computes the required result for all stated inputs.

Contradicted

abs() discards refund signs before accumulation. An account with amounts '10.00' and '-3.00' returns '13.00' rather than '7.00'. Line 6 ↗

No accounts are filtered out, but offsetting amounts '3.00' and '-3.00' produce '6.00' instead of the required retained zero total. Line 6 ↗

The implementation leaves caller-owned input lists, records and vectors unchanged.

Supported

The function only reads payload and row fields. Accumulation uses a new dictionary; sorted() operates on that dictionary's items. No caller-owned container is modified. Line 2 ↗

Review limit The reviewer inspected the source. It was not given execution records; the independent checks below were saved separately.

Independent execution checks

Saved Docker checks against the same constructed submission. These two cases describe their own scope.

Failed Check 1
Input
{
  "rows": [
    {
      "account": "a",
      "amount": "90.75"
    },
    {
      "account": "a",
      "amount": "-30.25"
    }
  ]
}
Expected result
{"a":"60.50"}
Failed Check 2
Input
{
  "rows": [
    {
      "account": "b",
      "amount": "-4.12"
    },
    {
      "account": "a",
      "amount": "0.00"
    }
  ]
}
Expected result
{"a":"0.00","b":"-4.12"}
Record and provenance

holdout-data-faulty. Original task, code, checks and finding excerpts are preserved. The downloadable extract omits provider payloads and local environment details.

reportSha256
c2cf21c0e93969cf0018d6d5a4b4b8edacf32a1001ef86fed332c2f9cd646512
requestSha256
e5ef604d9326062489ef45051148496953e4d9c035a08f0266db6706e2ce621c
sourceSha256
e3965ec24d6a74023fc1bc3466beb909f2cd3bd7f5dd91b0d5f5e050104c1ebe
Download sanitized record ↓