API Interview Questions MCQs

If you are really interested in API Testing, this article covers every aspect of it. We have covered 2 major tools for API testing - SOAP UI and Postman in a very detailed manner. Theoretically, you will be able to answer the API related questions confidently once you have gone through this article.

API Interview Questions MCQs

  1. Which API method can be called a SAFE one?
    • If it doesn't change the state of a resource on the server. It should perform a read-only operation.
    • If it stores the value of the response for specific response and saves new request to server.
  2. What is true about SOAP API?
    • Data can be represented in different formats(JSON, XML, etc..)
    • It is an object acces protocol
    • Highly standardized
    • It is an architectural style
    • Each resource is represented by a unique URL
    • XML is the only data representation format
  3. What is TRUE about redirect status codes?
    • All 5xx status codes belong to them
    • Indicate that the client has sent invalid request and server cannot process it.
    • All 3xx status codes belong to them
    • All 4xx status codes belong to them
    • Indicate that the server fails to fulfill a valid request, although the request from client was correct
    • Indicate that further actions are needed. Returned if a resource was moved permanently or temporary and can be accessed via another URL.
  4. Please select tools for API testing
    • Fiddler
    • Visual Studio
    • Intellij IDEA
    • Postman
    • SOAPUI
    • Selenium
  5. What is TRUE about any HTTP status code?
    • It is issued by a server in response to a client
    • Shows error on server's side
    • Represent seconds amount spent for request transfer
    • Is issued by client
    • Indicates success state of a request sent by a client
    • The first digit specifies the family of status code
    • Shows error on client's side
  6. What is it suggested to pass the information to the server in POST request?
    • Cookies
    • Headers
    • URL
    • Body
  7. What should be passed in DELETE request?
    • Query parameters
    • Request Headers
    • Request Body
    • Cookies
  8. Why a web service is needed?
    • Acceleration of a software development
    • Reduce data amount stored in a database
    • To create a good database
    • Abstraction layer between 2 systems
  9. Why is API needed?
    • For application components interaction
    • To improve software architecture
    • To involve more programmers into the project
    • To interact with the application's end user
  10. What is the better way of POST method work correctness check?
    • Via API
    • Via UI
  11. What is not a validation testing type?
    • JSON Schema validation
    • Query Params Validation
    • Authorization validation.
    • Path params validation.
  12. What is true about a web service?
    • It is an information system for machines interaction via network
    • Each web service has own API
    • No internet connection is needed for web service work
    • API and web services are not connected terms
  13. Which data format is most common for REST API?
    • TXT
    • XML
    • JSON
    • HTML
  14. Select all the required parts of a SOAP envelope.
    • Body
    • Cookies
    • Fault
    • Error
    • Envelope
    • Header
  15. What are the main features of PUT method?
    • Is used to pass information from updating web forms.
    • Fetches data from the server
    • Is used to pass information from creational web forms.
    • Request is cachable
    • Data can be sent in Query/Body parameter to the server.
    • Response is cachable.
  16.  Select an alternative between CRUD operations for the HTTP GET method.
    • UPDATE
    • READ
    • DELETE
    • WRITE
  17.  Select an alternative between CRUD operations for the HTTP POST method.
    • CREATE
    • READ
    • UPDATE
    • DELETE
  18.  What is TRUE about JSON Schemas?
    • Provides clear human/ machine-readable documentation.
    • Should be the same for all the endpoints of your webservice.
    • Describes JSON document's data format.
    • Formats the API response automatically
    • Enables automated testing
  19. What should be validated in an HTTP POST request?
    • Request Body
    • Path Parameters
    • Query Parameters
    • All of the above
  20. What should be validated in PUT request?
    • Headers
    • Authorization
    • Path params
    • Cookies
    • Query Params
  21.  What is TRUE about informational status codes?
    • Indicate that further actions are needed. Returned if a resource was moved permanently or temporary and can be accessed via another URL
    • All 3xx codes belong to them
    • Indicate that request was received, understood, accepted and a response is generated.
    • All 2xx codes belong to them.
    • Indicate that the request is received and understood, can be processed, and alerts a client to wait for a response.
    • All 1xx codes belong to them.
  22.  What are the main features provided by the Response View Component of Postman?
    • Edit URLs
    • View response headers
    • View status code, response size, and response time
    • Use scripts to send requests
    • Create fork and merge changes
    • View response body in pretty or raw view
    • Export global variables as JSONs
    • Automatic syntax highlighting in the prettified response body
  23.  What is REST API type?
    • Architectural pattern, where each dataset can be accessed by a specific URL and retrieved in different formats.
    • Object access protocol, where each data set is represented as a massive XML document.
  24. What is TRUE about Server Error codes?
    • All 3xx status codes belong to them.
    • All 5xx status codes belong to them.
    • All 4xx status codes belong to them.
    • Indicate that the server fails to fulfill a valid request, although the request from the client was correct.
    • Indicate that further actions are needed. Returned if a resource was moved permanently or temporary and can be accessed via another URL.
    • Indicate that the client has sent invalid request and server cannot process it.
  25.  Which HTTP method can be called a CACHABLE one?
    • If it stores the value of response for specific response and saves new request to server.
    • If it doesn't change the state of a resource on the server. It should perform a read-only operation.
  26.  what is TRUE about DELETE request?
    • It is idempotent
    • It must have a request body
    • In CRUD operations it is delete operation.
    • In CRUD operations it is remove operation
    • It should not have a request body
    • It is not idempotent
  27.  What is not an API type?
    • SOAP
    • REST
    • Selenium
    • RPC
  28.  What is true about REST API?
    • It is an architectural style.
    • It is an object access protocol
    • Highly standardized
    • XML is the only data representation format.
    • Data can be represented in different formats(JSON, XML, etc.)
    • Each resource is represented by a unique URL.
  29. Where the data cannot be passed in HTTP GET request.
    • Headers.
    • URL parameters
    • Cookies
    • Request Body
  30.  What is TRUE about Client error status codes?
    • Indicate that the client has sent invalid request and server cannot process it.
    • All 3xx status codes belong to them
    • All 5xx status codes belong to them
    • Indicate that further actions are needed. Returned if a resource was moved permanently or temporary and can be accessed via another URL.
    • All 4xx status codes belong to them.
    • Indicate that the server fails to fulfill a valid request, although the request from client was correct.


Concept of Idempotent
If a output doesn't change on performing a same operation multiple times, it is said to be called idempotent

32. What is true about HTTP Get method?
  • Requests data from the server.
  • Should have a request body
  • Is a Read operation
  • Is a create operation.
33. What is not a feature of DELETE method?
  • Can modify resource on the server.
  • Is idempotent.
  • Should not have request body.
  • Is non-cacheable.
34. What is TRUE about validation testing?
  • Usually is used while describing exceptional case testing.
  • Used to check the data integrity.
  • It should be performed once per 2 weeks.
  • Is performed when part of the test data is incorrect.
  • Can be applied when part of the input data is missing.
  • It should be done only manually.
35.  What are the main features of POST method?
  • Is cachable.
  • Updates data set on the server.
  • Creates data set on the server.
  • Is non-cachable.
  • Usually, saves data from web forms to server.
  • Request data may be collected by browser.
36. Please, select the main JSON Schema fields that are important for testing.
  • required
  • type
  • headers
  • properties
  • cookies
  • body
37. What can be validated in HTTP DELETE request.
  • Body
  • Path parameters
  • Authorization
  • Cookies
  • Query parameters.
38. What do we usually mean when referring to validation in testing.
  • Verifying the response body's correctness
  • Checking the program's behavior under unexpected conditions.
  • Verifying that the status code is 200
  • Checking the JSON schema of response body.
39. What is true about HTTP methods?
  • Each method is represented by a verb.
  • Each method indicates some actions.
  • Each method is performed for the specific resource
  • GET has the same semantic feature that POST.
  • There is no similarity between HTTP methods.
40. What is TRUE about Success status codes?
  • All 2xx status codes belong to them.
  • Indicate that request was received, understood, accepted and a response is generated.
  • All 2xx status codes belong to them.
  • Indicate that further actions are needed. Returned if a resource was moved permanently or temporary and can be accessed by another URL.
  • All 3xx codes belong to them.
  • Indicate that the request is received, understood, and can be processed and alerts a client to wait for a response.
  • All 1xx status codes belong to them.
41. What is TRUE about PUT Request.
  • Is Create operation among CRUD.
  • It updates information about a resource.
  • Is Update operation among CRUD.
  • It should pass data to the server.
  • It should not have body.

I hope above questions will help you understand API testing in a better way. We will keep this article posted if there is any addition to above questions.



     

Comments

Popular posts from this blog

Azure Tutorials Series - Azure Networking

Coforge Interview Questions | Automation Testing profile

Testing in CI/CD