API Testing Junior interview questions and answers
75 questions for a API Testing (Junior) interview - with correct answers, explanations and links to the docs.
Take this quiz- 1.What is API testing?
- 2.Why is API testing often done before UI testing?
- 3.What does a REST API usually use to identify resources?
- 4.Which HTTP method should only read data?
- 5.Which method is usually used to create a new resource?
- 6.What is the difference between
PUTandPATCH? - 7.What do status codes starting with 2 mean?
- 8.What do 4xx status codes mean?
- 9.What do 5xx status codes mean?
- 10.A request with an invalid email returns
500. What is the problem? - 11.What does
201 Createdusually come with? - 12.When is
204 No Contentused? - 13.What is the difference between
401and403? - 14.What should
GET /users/999return if the user doesn't exist? - 15.What should
GET /users?name=zzzusually return when nothing matches? - 16.What does
409 Conflictusually signal? - 17.What does
429 Too Many Requestsmean? - 18.What does
415 Unsupported Media Typeusually indicate? - 19.What does the
Content-Typerequest header tell the server? - 20.What does the
Acceptheader do? - 21.How is a bearer token usually sent?
- 22.What is the difference between a path parameter and a query parameter?
- 23.What is Postman mainly used for?
- 24.What is a Postman collection?
- 25.Why use environments in Postman?
- 26.What does this Postman test check?
- 27.How do you reuse an ID from one response in the next request in Postman?
- 28.What is Newman?
- 29.What does this
curlcommand do? - 30.Which
curlflag shows response headers along with the body? - 31.How can you quickly get a failing request from a web app into a bug report?
- 32.What should an API bug report include?
- 33.What should you check in an API response besides the status code?
- 34.What is negative API testing?
- 35.A field accepts quantities from 1 to 100. Which values are boundary tests?
- 36.What should happen when a required field is missing from a POST body?
- 37.What do you test by sending
"age": "twenty"instead of a number? - 38.Which methods are idempotent by definition?
- 39.What should happen when you
DELETEthe same resource twice? - 40.Why should API responses be checked for response time?
- 41.What is a JSON Schema used for in API testing?
- 42.What does OpenAPI (Swagger) describe?
- 43.What is a mock server in API testing?
- 44.What does it mean that HTTP is stateless?
- 45.How is API key authentication usually sent?
- 46.What is Basic authentication?
- 47.Why does a request work in Postman but fail with a CORS error in the browser?
- 48.What is an
OPTIONSrequest withAccess-Control-Request-Methodin the browser? - 49.Why test pagination with
pageandlimitparameters? - 50.What should a test check when sorting results with
sort=price? - 51.What should you test about date fields in an API?
- 52.Why send special characters like
&,#or spaces in query parameters? - 53.What is the main difference between GraphQL and REST for a tester?
- 54.A GraphQL response has status 200 and an
errorsarray. Did the request succeed? - 55.Why should API tests not depend on data that someone created by hand?
- 56.What is a pre-request script in Postman for?
- 57.Why shouldn't tokens and passwords be saved in shared Postman collections?
- 58.What should happen when an API receives an unknown field in a request body?
- 59.What is the risk of an API that returns more fields than the client needs?
- 60.What is an IDOR bug?
- 61.What does
Content-Lengthmismatch or a cut-off JSON body usually indicate? - 62.What is
HEADuseful for? - 63.What is the main goal of a smoke test for an API?
- 64.What does a health check endpoint like
/healthusually tell you? - 65.Why should API tests run in CI?
- 66.What does API versioning like
/v1/ordershelp with? - 67.Why are HTTPS-only APIs important to check?
- 68.Are HTTP header names case-sensitive?
- 69.How should you test a
PATCHthat updates a user's name? - 70.Why verify side effects after a successful POST?
- 71.What does a very long string, e.g. 10,000 characters, in a name field test?
- 72.Why test with Unicode such as emoji or Cyrillic in text fields?
- 73.What is the difference between authentication and authorization?
- 74.What should happen when a request uses an expired token?
- 75.What is a webhook from a tester's point of view?