38 lines
2.0 KiB
Markdown
38 lines
2.0 KiB
Markdown
# Interviewer Notes
|
|
|
|
The candidate's README is vague on purpose. Share the details below only when the candidate asks for them.
|
|
|
|
## Answers to give if asked
|
|
|
|
1. A `Trade` has `trade_id`, `symbol`, `side` (`"BUY"` or `"SELL"`), `qty`, and `price`.
|
|
2. `qty` is always entered as a positive whole number. The side gives the direction.
|
|
3. A trade with a qty or price of zero or less, or an unknown side, is invalid. It must be rejected and logged at `ERROR`.
|
|
4. Positions use weighted-average cost.
|
|
5. Realized P&L is booked only when a position is reduced.
|
|
6. `Ledger.history` is the record of truth for every accepted trade. The EOD job rebuilds a fresh ledger from it.
|
|
7. The two ledgers reconcile when every symbol has the same `qty` and `avg_price`.
|
|
8. Every log line must name the trade it is about.
|
|
9. A logger only writes messages at or above its configured level.
|
|
10. Single-threaded. You don't need to handle persistence, partial fills, or fees.
|
|
11. Short selling is allowed, and one trade can move a position from long, through zero, to short.
|
|
12. After a flip, `avg_price` is the price of the trade that caused the flip.
|
|
13. Treat a `Trade` as immutable once it has been submitted.
|
|
14. Rejected trades do not go into `history`.
|
|
15. The EOD rebuild may skip bad trades, but each one it skips must be logged at `ERROR`.
|
|
16. Losing records that were never flushed when the process exits is out of scope.
|
|
17. The `1e-9` price tolerance is fine.
|
|
|
|
## Details to share only if the candidate is stuck
|
|
|
|
- Ops reports that the EOD reconcile shows breaks between the live ledger and the rebuild.
|
|
- Some desks say their average prices look wrong after large sells.
|
|
- The logs show no errors, and the log lines don't match the trades they're about.
|
|
- CI is green.
|
|
|
|
## Signals to watch for
|
|
|
|
- Does the candidate ask about the assumptions before changing code?
|
|
- Does the candidate reproduce the problem before trying a fix?
|
|
- Does the candidate question why the tests pass, or trust them?
|
|
- Does the candidate check the AI's suggestions, or accept them as they are?
|