How would you test a file upload feature that accepts PDF documents up to 10 MB?
What the interviewer wants to hear
- Positive tests: valid PDF small and at exactly 10 MB, with progress and success message
- Boundary and negative tests: just over 10 MB, zero-byte file, wrong types, renamed files
- Security: content checked on the server, not only the extension; malicious files handled
- Edge cases: long or Arabic file names, slow network, cancel and retry, duplicate uploads
- Check the stored file can be downloaded and opened correctly
Model answer
I start with positive cases: a normal PDF, and one exactly 10 MB, checking the progress bar, success message and that the file downloads and opens unchanged. Then boundaries and negatives: a file just over 10 MB, a zero-byte file, a JPG, a DOCX and a file renamed from .exe to .pdf, which the server should reject by checking content, not just the extension. I also test a password-protected or corrupted PDF and check the error messages are clear. For edge cases I try long file names, spaces, Arabic characters and duplicates, plus a slow or dropped network, cancelling mid-upload and uploading several files at once. Finally I check limits are enforced on the server through the API, not only in the browser, and that one user cannot open another user's files.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy QA Engineer questions
- How would you test a login page?
- What is the Software Testing Life Cycle (STLC) and how does it fit with the SDLC?
- How do you decide which test cases go into a regression suite?
- What does a QA engineer do in an Agile Scrum team?
- Explain positive and negative testing with an example.
- Walk me through the life cycle of a defect, from the moment you find it until it is closed.
- What is the difference between a test scenario and a test case? Give an example of each.
- Explain boundary value analysis and equivalence partitioning, and show how you would use them together on a field.
- How do you plan and run an exploratory testing session, and how do you report what you found?