Mid-LevelAPI & Integration Testing
How do you test file upload/download APIs?
- file upload
- file download
- multipart
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Upload tests: valid file types accepted, invalid rejected, size limits enforced, multipart form data correctly parsed, progress tracking works, concurrent uploads handled. Download tests: correct Content-Type and Content-Disposition headers, file integrity (checksum match), range requests for large files, expired download links rejected. Edge cases: empty files, very large files, special characters in filenames, duplicate uploads.
What interviewers listen for
- Schema-first thinkingYou validate response shape before you assert on values, every time.
- Status-code literacyYou can defend why 401 vs 403 vs 422 matters for the consumer.
- Contract awarenessYou know when consumer-driven contract tests beat end-to-end checks.
- Auth fluencyYou can describe rotating tokens across parallel workers without secrets in logs.