Java - Interview Questions and Answers for 'Web services' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2137 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Web services' - 21 question(s) found - Order By Newest

Very frequently asked in companies using SOA.
  Q1. What are RESTful Web Services ?Rest
Admin
info@buggybread.com
Ans. REST or Representational State Transfer is a flexible architecture style for creating web services that recommends the following guidelines -
1. http for client server communication,
2. XML / JSON as formatiing language ,
3. Simple URI as address for the services and,
4. stateless communication.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   web services   rest   java   j2ee  architecture     Synechron  CapitalOne  Overstock.com  Ebay  At&t  HCL Technologies  Barclays  Tata Consultancy (TCS)  Cognizant (CTS)  Wipro  Infosys  EPAM  Mphasis      intermediate        frequent


 Q2. Which markup languages can be used in restful web services ? Rest
Admin
info@buggybread.com
Ans. XML and JSON ( Javascript Object Notation ).

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   web services   rest   java   j2ee   xml   json   architecture      basic        frequent


 Q3. Why Web services use HTTP as the communication protocol ?Web Service
Admin
info@buggybread.com
Ans. With the advent of Internet, HTTP is the most preferred way of communication. Most of the clients ( web thin client , web thick clients , mobile apps ) are designed to communicate using http only. Web Services using http makes them accessible from vast variety of client applications.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     rest   webservices   web servuces   http   architecture   technical architect


 Q4. Name some Java REST services frameworks ?Rest
Admin
info@buggybread.com
Ans. Jersey , Restlet , RestX, Spring , RestEasy ,Restfulie, Play Framework

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   rest   web services   frameworks


 Q5. If you are given a choice to have a functionality shared either through dependency or through a Web service, which one will you choose ?Solution2016-06-13 10:38:53

Ans. Web Service promotes looser coupling but with comes with coding and performance overheads. Jars provide better performance and may be lesser coding but are problematic with update distribution. If the situation doesn't require frequent dependency updates and if it's only read operation of persistence, Having dependencies should be a better choice , otherwise web service.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Design  Web Service vs Jar


 Q6. Can we send a request body with the Get Request ? If not, What is the alternate to pass message to the Get Request ?Web Service2016-06-22 09:18:14

Ans. Request Body in case of Get Request has no meaning and hence it's not parsed when the request is received. Alternatively Request Parameters are passed as either Path Params or Query Params.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     rest  web services  http  http methods  get request


 Q7. Is it Necessary to send a POST request with the Payload or a body ?Web Service2016-07-22 14:36:42

Ans. No, we can also send an empty body with the POST Request.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Get Request   Rest        rare


 Q8. What are the different ways in which information can be sent to server in web service call ?Web Service2016-07-22 14:57:32

Ans. 1. As Request Param
2. As Path Param
3. Part of Payload / Body in case of PUT and POST Request

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     web service   rest      basic        frequent


 Q9. Difference between GET and POST Requests ?Web Service2016-07-22 15:00:21

Ans. GET is supposed to get information from the server. Client sends the minimal information so that Server can respond with the response body on basis of request. For example - You want to get complete employment record for employee id 123

POST is supposed to send the information for submission. Payload or a Body is usually sent so that it can be persisted on the server. For example - Sending the complete information of an employee ( id, name , dept etc ) to the server for persisting it.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     get vs post   web service   rest     Wayfair  Finacus Solutions  Elsevier  Cognizant (CTS)  FlipKart      basic        frequent



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. What is a web service ?Java EE2016-12-13 14:36:35

Ans. A Web service is a service offered by one system to another, for communication over web through http. XML are JSON are usually used for sending across information from one system to another.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     web service     Myntra  Tata Consultancy (TCS)      basic        frequent


 Q11. How to create stateful Rest Services ?Rest2016-12-14 08:24:19

 This question was recently asked at 'JPMorgan Chase'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Rest  Web Services     JPMorgan Chase


 Q12. What is stub and skelton ?SOAP2017-04-26 11:13:04

Ans. RMI uses a standard mechanism for communicating with remote objects i.e stubs and skeletons. A stub for a remote object acts as a client's local representative. The caller invokes a method on the local stub which is responsible for carrying out the method call on the remote object.

Stub resides at the client that upon calling whose method results in establishing connection with the server, serializing and mar shelling the request and then waiting for the response whereas skelton resides at the server that receives the request, unmarshal it and then deserialize to fulfil the request.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     web service  soap  stub  skelton  RMI


 Q13. What are the benefits of Rest services over using SOAP ?Web Service2017-04-27 18:04:04

Ans. Rest services are light weight and hence facilitate faster development and involve less overheads compared to SOAP.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve             frequent


 Q14. In which cases using SOAP is preferred over REST ?Web Service2017-04-27 18:08:18

Ans. SOAP services are better in case we need to establish a formal and detail contract with the client or callers and hence suitable for

1. Services published for much wider unknown audience
2. Require large input payload
3. Requiring different level for authentication

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     soap vs rest  soap  rest


 Q15. How would you go about creating a get rest service if it requires multitude of params or inputs ?Rest2017-04-27 18:12:23

Ans. If the number of input values is large, we can go about passing them as query params instead of path params. If the number is even larger and complex , its better to create a post service that behaves like a get service. Though this practice is not recommended but technically it can be accomplished.I dont mind doing it if the exceptionally large number of input would make it much more confusing.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     rest  restful web services


 Q16. What is AWS or Amazon Web Services ?AWS2017-05-15 20:17:08

Ans. These are the platforms or set of services provided by Amazon for cloud services , database storage , content delivery and other business applications and solutions.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     aws  amazon web service


 Q17. If given a choice , which one would you prefer to send params to the Get service , path params or query param ?Web Service2017-05-22 08:28:27

Ans. If the number of params is quite large , I would prefer to either split it with majority of it in query params or all in query params.

If the params are all mandatory , I would keep it as path params. If it's optional , I would keep it as query param so as to keep consistent base url.

If we don't require the param name , then they can be kept as path params as query params necessitates the usage of param name.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Web Service  Get service  path vs query param  Rest  query param  path param


 Q18. Is it necessary to specify "employeeId" with @PathParam("employeeId") in this case,

@Path("/{employeeId}")
public String employeeInfo(@PathParam("employeeId") Long employeeId){
}
Rest2017-05-22 08:30:39

Ans. No, it's optional as the name of path param required is same as method param name in this case.

Even the declaration as following should work -

@Path("/{employeeId}")
public String employeeInfo(@PathParam Long employeeId){
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Web Service  Get service  Rest  path param


 Q19. What is the difference between latency, response time and processing time ?Web Service2017-06-02 12:49:11

Ans. Latency is the delay incurred while communicating a message i.e the time took the message in transit over network.

processing time is the delay it took for the server to process the request.

Response time is the sum total of latency and processing time.

For example -

Let's say it takes 1 ms for the request to reach from client to server and similar 1 ms for the response to come back to client. Moreover it takes approx 10 ms for the application to process the request. So The response time would be outward latency + processing time + inward latency = 12 ms

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     latency   response time    processing time



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q20. Can we have contracts like WSDL with Rest Services ?Web Service2017-08-26 09:27:39

Ans. Yes, we can have WADL to specify the contract but unlike SOAP , the usage is optional.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     


 Q21. Is ICICI netbanking using webservices?Web Service2017-10-13 09:21:39

 This question was recently asked at 'Capgemini'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          Capgemini




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: