Web-service Interview Questions

  1.  Interceptor and its use 
  2.  How interceptor works 
  3.  Controller Advice 
  4.  How do we create interceptor 
  5. Rest
    1. Richardson Rest Maturity model (4 level that defines the maturity of rest servies)
    2. Rest Api
      1. in rest api a recommended term used to refer to multiple resources
      2. time to first hello world rest
      3. rest api to add the version in header by using accept and content type
        1. https://blog.allegro.tech/2015/01/Content-headers-or-how-to-version-api.html
    3.  Http Response Code 
    4. How communication is done between 2 rest services
    5. What is Response Body
    6. idempotent http req 
    7. restful services architecture 
    8. http methods
    9. API security
      1. using oauth , what scope is required for write access to api
      2. which grant type support refresh token
      3. property to include in json to represent subresources /in rest api (llinks/embedded?)
  6. benefit of GRAPHQL over rest approaches
  7. WebHooks vs sync api and usage
  8. how to handle transactional commit over distributed system (2phase commit , saga pattern – push or pull )
    • when to use push vs when to use pull mechanism

HTTP Verb CRUD Entire Collection (e.g. /customers) Specific Item (e.g. /customers/{id}) 
POST Create 201 (Created), ‘Location’ header with link to /customers/{id} containing new ID. 404 (Not Found), 409 (Conflict) if resource already exists.. 
GET Read 200 (OK), list of customers. Use pagination, sorting and filtering to navigate big lists. 200 (OK), single customer. 404 (Not Found), if ID not found or invalid. 
PUT Update/Replace 405 (Method Not Allowed), unless you want to update/replace every resource in the entire collection. 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid. 
PATCH Update/Modify 405 (Method Not Allowed), unless you want to modify the collection itself. 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid. 
DELETE Delete 405 (Method Not Allowed), unless you want to delete the whole collection—not often desirable. 200 (OK). 404 (Not Found), if ID not found or invalid. 

Published by

Unknown's avatar

sevanand yadav

software engineer working as web developer having specialization in spring MVC with mysql,hibernate

Leave a comment