5 / 7 · Book 14 · Exercises · drill: interview Q&A← prev⊞ allnext →Get the book →
1.8Question 1
Prompt: You inherit a Postman collection with 200+ requests, no environment variables, hardcoded tokens everywhere, and no folder organization. The team wants to run it in CI within two weeks. Walk me through your remediation plan.
What a strong answer should cover:
- Prioritization: identify the critical paths first (auth, core CRUD) rather than trying to fix everything at once
- Environment variable extraction as the first step (base_url, tokens, dynamic IDs)
- Folder restructuring to mirror the API domain model
- Adding pre-request scripts for token management instead of hardcoded values
- Newman integration for CI with a plan to eventually migrate high-value tests to pytest
Example answer:
- "First, I would audit the collection to identify which requests are actually used and which are stale. I would group them by domain (auth, users, orders) and delete dead requests."
- "Next, I would extract all hardcoded URLs into a
base_urlenvironment variable and create separate environments for dev, staging, and CI. Tokens get replaced with a login pre-request script that runs once and stores the token." - "For CI within two weeks, I would export the cleaned collection and run it via Newman in GitHub Actions. The long-term plan would be migrating critical test paths to pytest, but Newman gets us CI coverage immediately."
- "The trade-off is that Newman collections are harder to maintain than code, so I would set a clear timeline for the pytest migration -- probably the following sprint."