JAVA Updated Interview Tips
JAVA Updated Interview Tips
JAVA Updated Interview Tips
1. Describe your experience and what are the technologies that you possess.
java
springboot
Oracle DataBase
2. Which are the feature in Java 8 that you are familiar with?
foreach and Iterator
3. Have you made use of any Java 8 feature? (Follow up questions regarding the
features that you will mention)
4. What are the concepts in J2EE/JEE that youa are familiar with?
Client Tier (Front End) -
Middle Tier (BackEnd / Business Logic) -
Data Tier (database) -
10. Can you tell me the difference between GET and POST method in HTTP.
- Both GET and POST method is used to transfer data from client to server in HTTP
protocol but
Main difference between POST and GET method is that GET carries request parameter
appended
in URL string while POST carries request parameter in message body which makes it
more secure
way of transferring data from client to server.
11. Let's imagine I have a Spring boot application with 2 REST API, defining the
controler class and 1 of them is a GET Method
and the other 1 is a POST Method, both these Methods have the same request mapping;
Let's call it /abc (both methods have the same endpoint, as in the request URI that
we used to access this API /abc) now, if I ran this application in my local machine
and I go to the web browser and in the URL part I type localhost:8080/abc will it
be GET Method be called or will it be POST Method that we called?
(Leave the Postman part aside and concentrate on the web browser, what will happen?
*Answer: It will execute a GET Method and it will return you a Image in JSON)
(Possible follow up question: If I remove this GET Method from my controler class
all together and I reroute the application and I again, go to the browser and type
localhost:8080/abc, what would happen?
(*Answer: Error 405 - Method not allowed)
12. If you are trying to call a POST method by sending a GET request, what kind of
error do we get?
If you write localhost:8080/abc, what the browser will do is look for methods
with /abc which is there;
however, it woould try to access it using GET which is not there, so, What kind of
error can we expect?
14. How does REST API's communicate with each other if I want to make an API called
from 1 REST API to another, how would I be able to do that? (By using REST Template
or Apache Kafka)
12. Give some advantages of Spring boot over the conventional Spring MVC
Architecture.
1)We need to setup the server explicitly(manually) while spring boot has an
embedded server.
2)Deployment descriptor is required for spring to work while it does need any
descriptor in spring boot
3)Faster to deploy since there is less time to configure spring boot
4)The lines of code is less in spring boot than in spring
5)Must define dependencies in pom.xml manually in spring while pom.xml
handles
the dependencies internally for springboot
14. What are the diff between SOAP and REST API?
1)soap has predefined rules that must followed while rest api has loose
guidelines and recommendations
2)Soap is function driven (data is available as services ex. getuser())
while rest data driven (data is available as resources)
3)SOAP is by default stateless (possible to make it stateful) while rest is
stateless
4)SOAP cannot be cached while rest can be cached.
5)SOAP requires more bandwidth and computing while rest requires less.
6)SOAP only supports xml while rest supports like plain text,html,xml and
json.
7)SOAP works on HTTP,SMTP,UDP and others while rest only works on http.
15. What are the ORM that you are familiar with? (For example: Hibernate or
MyBatis)
DATABASE Question:
16. Let's say I have a Table called Product and this product Table has 3 columns
which are: ID, Name, and Price. Now, if I have to find the product with the highest
Price, what would my SQL Query look like? (*Possible Answer: Select ID NAME comma
MAX PRICE from product)
(Possible follow up question: Is it possible for you to get the same result without
using the MAX Function? Tell me how your Query will look like. *Answer: Yes. Query
will look like: Order by Price decending then at the end you can just specify Limit
"What" Row)
OR
(Get the highest price with the ID and Name using MAX Functioction. *There are
several way that you can answer this but one is: Select ID Name Price from product
where Price =(Select Max (Price) From Product)
Inheritance is the process of one class inheriting properties and methods from
another class in Java.
Inheritance is used when we have is-a relationship between objects.
Inheritance in Java is implemented using extends keyword.
Allows programmers to use the same word in Java to mean different things in
different contexts.