The interview problem
A legacy customer drops files into an SFTP folder. Your importer sometimes reads a half-uploaded file and sometimes imports the same delivery twice. Design a protocol both teams can operate.
Original practice, not a reported company interview. All scenarios and worked numbers are illustrative. Interview date: not applicable. Sources retrieved September 30, 2026.
1. Scope and assumptions
Assume control over the sender's naming convention but no transactional message broker. Confirm the server's rename and durability semantics instead of assuming every SFTP server behaves identically.
2. Worked approach
temporary upload → verified manifest → ready publication → idempotent import → durable acknowledgment
Agree on delivery ID, schema version, expected bytes, row count and checksum in a manifest. Upload data under a temporary name, close it and verify completion, then publish a ready marker or rename under documented same-filesystem semantics. The importer only processes declared-ready deliveries and verifies the manifest.
Record delivery identity and import outcome durably before acknowledging. A duplicate identical delivery returns its prior outcome; reused identity with different content is a conflict requiring investigation. Separate received, validated, committed and rejected states. Define who owns late files, replacement files and manual replay.
3. Calculate the example
At 20 MB/s, a 600 MB file takes about 30 seconds of payload transfer. A poll every 10 seconds may see it three times before completion, so observing a filename is not a commit signal. If two identical deliveries each contain 50,000 rows, append-only processing without delivery deduplication creates 100,000 rows. Row-level idempotency is still needed if one file overlaps another legitimate delivery.
4. Failure cases and trade-offs
A ready marker published before the upload finishes defeats the protocol. A matching byte count alone does not prove content integrity. A crash after database commit but before acknowledgment creates a retry that must recover the earlier result. Moving files to an archive is not a substitute for durable import state.
A manifest adds sender work but gives operational evidence. Stable-size polling is an imperfect fallback because a stalled upload can look complete. If the sender cannot change, isolate imports and require reconciliation before promoting data to production use.
5. Validate the result
Interrupt uploads, duplicate deliveries, alter content under a reused ID and crash after commit. Ask customer operations to replay a rejected file using the runbook and verify exactly the intended business records appear.
6. Interview follow-ups and self-review
How do corrections supersede a prior delivery? Which acknowledgment permits the customer to delete its source copy?
Reward an explicit completion protocol, durable deduplication, content checks and shared operational ownership.
Sources and related practice
Technical reference: man.openbsd.org — SFTP transfer/rename command reference; delivery protocol is original and requires server-specific verification.
Exact publication/update date not established in this review. Retrieved September 30, 2026. This reference supports the named technical concept; the proposed workflow and examples are original, not a documented vendor implementation or interview report.
Continue with Cut over an enterprise integration with a rollback window; Reconcile conflicting records across customer systems.
Continue your preparation
Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.