A partner posts one JSON object per payment. Some of them are not JSON at all, and the pipeline must not stop because of it.
A well-formed body looks like {"amount": 10.5, "currency": "INR"}.
Every input row, with the columns:
record_idstatus — 'VALID' or 'INVALID'amount — the parsed amount on a valid row, null otherwisecurrency — the parsed currency on a valid row, null otherwiseA row is VALID only when the body parses and both fields carry a value. Anything else is INVALID and carries neither field forward.
| record_id | body | status | amount | currency |
|---|---|---|---|---|
| 1 | {"amount": 10.5, "currency": "INR"} | VALID | 10.5 | INR |
| 2 | {"amount": 10.5} | INVALID | null | null |
| 3 | not json | INVALID | null | null |
{"amount": 10.5} parses perfectly well.0.0 is an amount. A JSON null is not.payloads| body | record_id |
|---|---|
| {"amount": 10.5, "currency": "INR"} | 1 |
| {"amount": 10.5} | 2 |
| record_id | status | amount | currency |
|---|---|---|---|
| 1 | VALID | 10.5 | INR |
| 2 | INVALID | null | null |
payloads| body | record_id |
|---|---|
| not json | 3 |
| {"amount": 2.0, "currency": "USD"} | 4 |
| record_id | status | amount | currency |
|---|---|---|---|
| 3 | INVALID | null | null |
| 4 | VALID | 2 | USD |
Community-reported interview topic. Not an official company question and no affiliation is implied.
Run against the public tests, or submit to score against all of them.