Failed Trades Log Parsing
Turn an overnight settlement log into the morning fails summary with a short shell pipeline — counts, top reasons, worst counterparty, repair list.
The scenario
It's just after the overnight settlement batch and the exception monitor has written out the day's settlement log. The head of ops wants the morning fails summary before the 7am call — how many trades failed, why, which counterparty is the worst, and which ones need a manual repair. No spreadsheet: you do it in the shell.
Where this shows up
Pulling answers out of a settlement log with a short shell pipeline is a realistic ops / production-support take-home for post-trade roles at firms of this type.
Firms such as Citi, BNY, State Street.
DeskPrep is not affiliated with, endorsed by, or sponsored by any named firm. Firm names are used for illustrative, educational purposes only and do not imply that these materials are official assessments of, or are connected with, those firms.
Task brief
# Failed Trades Log Parsing **Role relevance:** Settlements / post-trade operations take-home. **Estimated time:** 40 minutes · **Difficulty:** Intermediate · **Format:** Shell (.sh) + log file ## What you are given - `failed_trades_log_parsing_starter.sh` — the brief, the log format and four TODO tasks - `settlement_fails.log` — 40 settlement events: `timestamp,trade_id,counterparty,instrument,status,reason` ## What you must deliver 1. How many trades **FAILED** (match on the status field — exclude PENDING) 2. Failure **reasons** ranked most-common first 3. The **counterparty** with the most fails 4. The trade IDs failing for **SSI_MISMATCH** (need a standing-instruction repair)
Your tasks
- 01Count how many trades FAILED to settle — matching on the status field, so PENDING (in-flight) trades are excluded.
- 02Rank the failure reasons by frequency.
- 03Identify the counterparty with the most fails.
- 04List the trade IDs failing for SSI_MISMATCH — the ones that can't re-instruct until the standing instructions are repaired.
How you're assessed
The full points-based mark scheme is included with the pack.
What you'll learn
- The filter → extract → count shape that answers almost any log question.
- Why you match on the status field, not a bare substring — and why PENDING isn't a fail.
- How a one-line pipeline turns a raw log into a prioritised worklist.