The interview problem

Practice prompt

A customer archive is small to upload but exhausts memory during extraction. Redesign the import boundary.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Assume authorized document imports with potentially untrusted archive contents. Stream extraction into an isolated workspace, enforce cumulative decompressed-byte, file-count, nesting and time limits, and validate resolved paths stay inside the workspace. Reject unsupported link entries and report which limit was exceeded. Define limits with customer workload samples and provide a split-archive workflow for legitimate large imports.

2. Trace the design or derivation

Authorize upload
  → isolate extraction
  → count actual resources
  → reject unsafe paths
  → accept complete manifest

Define whether one rejected archive leaves no imported records or a documented partial manifest. For most document onboarding, staging all extracted files before acceptance gives clearer semantics. A cleanup job must remove expired workspaces without deleting another active import, using session identity and explicit ownership metadata.

3. Calculate the example

A 20 MB upload expanding by a factor of 500 requires 10 GB before parsing overhead. An upload-size cap alone therefore does not bound memory or disk use. A cumulative 1 GB extraction cap would stop this job before full expansion.

4. Failure cases and trade-offs

Nested archives and many tiny files defeat single-file limits. Trusting declared sizes is insufficient; count actual bytes written. Stricter caps reduce resource risk but can reject valid packages, so expose actionable errors rather than silent truncation or partial success.

5. Validation, follow-ups and self-review

Test path traversal, nested compression, symlinks and interrupted cleanup with synthetic fixtures. Follow-up: how should partial extracted data be handled? Self-review: enforce resource and path limits during processing, not only before it.

Sources and related practice

Technical reference: cheatsheetseries.owasp.org — Upload isolation and decompression/resource limits.

Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Add customer attachments without exposing the main application; Recover a partially accepted customer import.

Continue your preparation

Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.