These questions are additionally fairly helpful for Java builders making ready for internet improvement or fullstack developer interviews as REST APIs are all over the place and expertise in creating RESTful Internet service is extremely fascinating for all types of employers.
13 REST Internet companies Framework interview questions solutions
Here’s a record of my REST Interview questions, useful for a fast evaluate earlier than going for any internet companies interview on Java J2EE.
1) What are REST and RESTful internet companies?
that is the primary REST interview query on a lot of the interviews as not everyone accustomed to REST and likewise begin a dialogue primarily based on candidates response.
2) What’s variations between RESTful internet companies and SOAP internet companies ?
Although each RESTful Internet Providers and SOAP internet service can function cross platform they’re architecturally totally different to one another, right here is a few of variations between REST and SOAP:
1) REST is extra easy and straightforward to make use of than SOAP
2) REST makes use of HTTP protocol for producing or consuming internet companies whereas SOAP makes use of XML.
3) REST is light-weight as in comparison with SOAP and most popular selection in cellular gadgets and PDA’s.
5) REST internet companies name will be cached to enhance efficiency.
3) What’s Restlet framework ?
4) What’s Useful resource in REST API and Restlet framework ?
Useful resource in REST API is any entity which you’ll entry or modify. For instance, a Bookstore could publish REST APIs to create, modify, and delete books and in that case Guide is a useful resource. Like an API /ebook
It symbolize a “useful resource” in REST structure. on RESTLET API it has life cycle strategies like init(), deal with() and launch() and comprises a Context, Request and Response similar to particular goal useful resource. That is now deprecated over ServerResource class and you must use that. You possibly can additional see Restlet documentation for extra particulars.
5) Can you employ Restlet with none web-container ?
6) What’s distinction between Restlets and Jersey ?
7) What’s RESTEasy ?
RESTEasy is one other REST framework launched in JBoss Software Server. This was somewhat simple REST interview questions. you may reply intimately solely if in case you have used this or working in JBoss. Really there are a lot of extra frameworks which Java developer can use to create REST API like Spring MVC, JAX-RS, RESTlet, and Jersey, you may select no matter you want.
8) What are the instruments used for creating RESTFull internet companies ?
You should utilize AJAX(Asynchronous JavaScript with XAML) and Direct Internet Eradicating to eat internet service in internet software. Each Eclipse and NetBeans additionally supported improvement of RESTFul companies.
9) Find out how to show customized error pages utilizing RestFull internet companies ?
In an effort to customise error it’s essential lengthen StatusService and implement getRepresentation(Standing, Request, Response) technique along with your customized code now assign occasion of your CustomStatusService to applicable “statusService property”.
10) Which HTTP strategies are supported by RestFull internet companies ?
One other frequent REST interview query concerning RESTFul internet service every Useful resource helps GET, POST, PUT and DELETE http strategies.GET is mapped to symbolize(), POST – acceptRepresentation(), PUT- storeRepresentation and DELET for rmeoveRepresentation.
11) What’s the distinction between the top-down and bottom-up approaches of creating internet companies?
Within the top-down strategy first WSDL doc is created after which Java lessons are developed primarily based on the WSDL contract, so if the WSDL contract modifications you bought to vary your Java lessons whereas within the case of the bottom-up strategy of internet service improvement you first create Java code after which use annotations like @WebService to specify contract or interface and WSDL discipline will probably be robotically generated out of your construct.
12) What occurs if RestFull assets are accessed by a number of purchasers? do it’s essential make it thread-safe?
Since a brand new Useful resource occasion is created for each incoming Request there is no such thing as a must make it thread-safe or add synchronization. a number of purchasers can safely entry RestFull assets concurrently.
This is without doubt one of the hottest questions on REST which I’ve seen on latest interviews and its not shocking given trade is now transferring in direction of GraphQL which handle a lot of REST structure shortcomings like over fetching and underfetching and versioning.
REST structure at all times battle to mannequin relationship which is all over the place in actual world. In case of REST APIs, you’ve gotten assets after which APIS to create, modify, and delete these assets however you haven’t any API to fetch two carefully associated assets.
For instance, you need to retrieve, all the purchasers along with their orders. In case of REST, it’s essential first retrieve clients which can then expose REST APIs for orders and then you definitely go and fetch them, this require a number of request and wastage of time and bandwidth. GraphQL solves this drawback by exposing schema the place you may get all the info with only one endpoint. This solves the issue of over fetching and beneath fetching and likewise bandwidth and time wastage.
You possibly can clearly see that GraphQL permits us to retrieve a number of useful resource with only one question which was not doable with REST APIs. This solves a number of drawback and likewise improves efficiency.
That’s all on REST interview questions for Java and internet builders. I’ve shared solely common questions so that you simply not less than know the important REST API ideas and find out how to develop them in Java programming language. I’ll add a few extra REST Interview questions each time I acquired them from my pal circle, principally superior REST API questions on paging, safety, and exception dealing with for skilled builders however when you acquired any be at liberty to share.
Some Interview questions articles you could like