Validation interview problems
Validation problems are about deciding, record by record, whether input is acceptable and what to do when it isn't. You might validate log lines, API payloads parsed from JSON, config files or user-supplied schedules. The tools are ordinary Python. int() and float() inside a narrow try/except ValueError, isinstance checks after json.loads, str.isdigit with its known gaps (it accepts superscript digits and rejects a minus sign), and dataclasses with a __post_init__ that raises. Some questions ask you to collect every error instead of stopping at the first, which changes the shape of the code.
Interviewers look for validation that happens before any state changes, so a rejected record never leaves a counter half-updated. They also look for catching the specific exception rather than a bare except, treating bool as a subclass of int when it matters, and handling NaN and infinity when floats are involved. A good answer puts the checks in the cheap order, keeps the rules in one place so a follow-up rule is a one-line change, and returns or raises something the caller can act on. When asked to report rejection reasons, count them per reason instead of logging free text.
2 open problems
- 01Inference Log Summaryeasy
Parse pipe-delimited inference logs, skip malformed lines, and report request counts, successes and average latency per model.
- 31Chunked File Copy with Bounded Memoryeasy
Copy a file of any size in fixed-size chunks so memory stays flat, and refuse inputs that would destroy data.
9 locked
These open in order of demand. Open one and press I want this one to ask for it.
- 02Normalize Inference Requests Lockedeasy
Parse raw JSON inference requests, validate required and optional fields, fill defaults and drop anything malformed.
- 04Reassemble Streamed Tokens Lockedeasy
Rebuild each request's output from interleaved, out-of-order and duplicated token events keyed by request id and sequence number.
- 05Priority Batch Scheduler Lockedmedium
Pick which inference requests go into one GPU batch: highest priority first, FIFO on ties, skip what does not fit, never exceed the token budget.
- 09Concurrent Inference Batch Lockedmedium
Run a batch of async inference calls with a concurrency cap, isolate per-request failures and return results in input order.
- 33Streaming File Checksum Lockedeasy
Compute and verify a SHA-256 checksum of a large file by hashing it in chunks, rejecting malformed expected digests.
- 39Streaming JSONL Parser Lockedmedium
Parse JSON Lines from arbitrary byte chunks into records, handling split lines and UTF-8, with a strict mode and a skip-invalid mode.
- 40Length-Prefixed Message Parser Lockedmedium
Decode a stream of 4-byte big-endian length-prefixed messages from arbitrary chunks, rejecting oversized and truncated frames.
- 44Resumable Download Lockedmedium
Resume an interrupted file download from the bytes already on disk, append streamed chunks, report progress, and reject wrong-sized data.
- 47Token Budget Batching Lockedeasy
Greedily group inference requests into ordered batches capped by both a maximum request count and a maximum total token count.