0% found this document useful (0 votes)
129 views

Psa Interview Question

Uploaded by

Kushal Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views

Psa Interview Question

Uploaded by

Kushal Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 184

I.

Questions Core Java ABHISHEK

1. Define JDK, JRE and JVM.

2. Significance of Public Static void main ( ).

3. Why main method support string[] args ( )?

4. Constructor chaining.

5. OOPs Concept ( Inheritance, Polymorphism,


Abstraction encapsulation).

6. Difference b/w Interface and Abstract Class.

7. Multiple catch Block.

8. Final, Finally and Finalize.

9. Is String inheritable? and how can we create our own


inheritable class?

10. HashMap Vs Concurrent HashMap.

11. HashSet Vs HashMap.

12. Internal working of HashMap.

13. How HashSet avoid duplicate values in collection?

14. Stream API and its uses.

15. How to restrict a class to create only single instance?

16. Programs: -

• Sorting of Array

• Palindrome (string, Integer)

• Largest element in an array


• Occurrence of character in a given string.

• Programs related to collection to add elements and


iterate them.

• Program to count the number of words in string.


II

Spring Boot

1. Significance of spring boot over spring frameework.

2. Different annotations (Authorized Requested Parma etc).

3. Difference b/w @Component and @Service.

4. @Qualifier.

5. Define MVC architecture of Spring Boot.

6. Spring Initializer.

7. Spring Actuator.

8. Spring Boot Scope of Bean.

9. Default scope of bean.

Hibernate

1. What is the significance of Hibernate over JDBC.

2. What is Session and Sessionfactory in Hibernate.

3. What is Dialect in Hibernate.

4. Mappings in Hibernate.

5. What is lazy Eager Loading in Hibernate.

6. How do we declare multiple primary key in Hibernate.

7. What is a POJO Class.


8. What Parameter that Repository accepts.
III

SQL

1. Foreign Key Vs Primary Key.

2. Delete Vs truncate Command.

3. What is alias in SQL?

4. Joint and Types of Joins.

5. Self-join in SQL.

6. DDL Vs DML.

7. Finding 2nd Map Salary from a table.

8. How to find records of last 10 students.

9. Finding Duplicate Records from table

Extra Questions

1. What is String intern( ) method used for?

2. What is Runtime Polymorphism?

3. What is the need of creating incomplete methods in


Interface?

4. Difference b/w this and super keyboard.

5. How to create Email API to the Project.

6. JSP tags.
1. Oops concept? Explain briefly with example.
2. JDK, JRE and JVM. Is java call by value or call by reference?
3. What is Class Loader?
4. What are access specifiers in java?
5. Difference between abstract class and interface?
6. What are the new features are there in Java 8?
7. Difference between Java 7 and Java 8?
8. Why string is immutable?
9. Difference between string, string buffer and string
builder. When to use string, string buffer and string
builder.
10. What is boxing and unboxing?
11. What is constant pool?
12. What are the types of memory in java?
13. What is static keyword and difference between static and
non-static?
14. Difference between return and return value?
15. How many types of variables are their java?
16. What is var type in java?
17. Difference between final, finally and finalize.
18. What is constructor? How to call parent class constructor
in child class?
19. What is Constructor overloading and Constructorchaining?
20. What is default constructor?
21. What is Functional Interface in java? Can you inherit
functional interface?
22. What is Lambdas Expression?
23. What is optional class in Java 8?
24. Why main method is Static?
25. What is Sam (Single Abstract Method) Interface?
26. What is marker interface? What a l l marker interface are
there in Java?
27. What is exception and how to handle exception in java?
Exception hierarchy.
28. Different between exception and error?
29. Can we write try finally without catch?
30. Why to use finally block in try catch? Example.
31. Difference between throw, throws and throwable.
32. How to create custom exception? Write code.
33. Suppose there is three class and each class is
independent with each other if exception occur in last
class then how to handle it in first clas?
34. Can you write multi catch block?
35. What is serialization? Why we use serialization?
36. What is transient keyword?
37. What is thread?
38. Explain thread life cycle. What is thread pool?
39. What is multithreading?
40. Difference between thread and process?
41. What is thread join?
42. Difference between wait and sleep.
43. Difference between wait, notify and notify all.
44. What is thread synchronization?
45. What is type casting and class casting?
46. Difference between. equals () method and ==.
47. What is aggregation, association and composition?
48. Garbage collection in java.
49. Output:
System.out.println(i == j);
Collection
Framework
1. What is collection?
2. Difference between List and Map.
3. Difference between Array list and Linked list.
4. Difference between List and Set.
5. Difference between Array and Array List.
6. Difference between Vector and Array List.
7. Difference between Vector and Queue.
8. Difference between Hash Set and Linked Hash Set.
9. Difference between Hash Set and Hash Map.
10. Difference between Hash Map and Hash Table.
11. Difference between Hash Map and Linked Hash Map.
12. Difference between Tree Set and Tree Map.
13. Difference between Comparator and Comparable.
14. Difference between Iterator and Iterable.
15. Difference between Collection and Collections.
16. What is Collison?
17. What is Iterator?
18. How to iterate list?
19. How to iterate map?
20. What is Fail Safe Iterator and Fail Fast Iterator?
21. How to remove duplicate entries from an Array List using
stream?
22. How to add only unique records in Array List?
23. What will happen if you don’t override hashCode() method
and equals() method?
24. How hash table works internally?
25. How to sort a collection? How many ways to sort a
collection?
26. How to add a collection in another collection particular
index?
27. How to compare two collection?
Hibernate

1. What is Hibernate?
2. What is ORM?
3. What is HQL?
4. Difference between JPA and Hibernate?
5. Difference between JDBC and Hibernate?
6. What is JPA?
7. What is persistent in Hibernate?
8. What is session in Hibernate?
9. What is session factory?
10. What is session?
11. Difference between get() method and load() method.
12. What is lazy loading in Hibernate?
13. How many types of association mapping is there in
Hibernate?
14. What are the key components are in Hibernate?
15. What is transaction in Hibernate?

Advanced Java/ J2 EE
1. Write down the code for JDBC.
2. Difference between doGet() and doPost() method.
3. Explain Servlet life cycle.
4. What is session in servlet?
5. What is request dispatcher?
6. What are the features available in Spring Boot?
7. What is spring initializer?
8. Difference between spring and spring boot.
9. What is spring IOC container?
10. Explain bean life cycle.
11. What are those spring starter available in spring boot?
12. What do you mean by Dependency Injection?
13. What is bean factory?
14. Bean scope?
15. What all annotations you know in spring boot?
16. What is spring MVC?
17. What is spring profile?
18. What is spring security?
19. What is application.property file in spring boot?
20. What is spring actuator?
21. How to connect spring boot with the database?
22. Difference between @Controller and @RestController.
23. How to use two database in spring boot?
24. What is web services? Types of web services?
25. Difference between Monolithic and Micro services?
26. How you tested web services? Tool you used.
27. What is idempotent?
28. Status codes 201, 501, 500, 203, and 404.
29. What is PACT and OAUTH?
30. What is post man?
31. What all HTTP method you used in your project?
32. How to expose web service and consume web service.
33. How to send email and write code? Which dependency
you added for this?
34. What all micro services you know?

35. How you managed you codes or How to share your codes
with seniors?
36. Which design pattern you follow in your project?

37. What all configuration you have done in your project?


38. Explain project flow.
fractal
3.execption (https://www.geeksforgeeks.org/exception-handling-
with-method-overriding-in-java/) 4.program
(wap to print a char with max
consequtive occurance String
str= "aa bb aaa c ab"
(in this case aaa is max consequtive
occurance, so i should print a) String str=
"aa bbbb aaa c ab"
(in this case bbbb is max consequtive occurance, so i should
print b))
5.how to pass own attribute (i.e, name="abc") to controller layer
or service layer in spring boot 6.output:
**b.java** public class B extends A{ public static void
main(String[] args) { B b = new B(); b.test(null);

java 8 features
Lambda expression
Throw and throws keyword Final finally finalize Hashmap and
hashtable Exception Immutable class @controller and @Rest
controller
Capgemini
Java 8 features Access Specifiers
Arraylist and linkedlist Abstract class and interface @autowired
@requestmapping@ getmapping Oops conceptRuntime polymorphism
Checked and unchecked exception FinalFinally serialization Overloading
and overridingHow to connect 2 tables in spring application Project
explanation
Newgen
Polymorphism Overriding and overloading AbstractionEncapsulation
Lambda expression Functional interface Hashmap Arraylist and
LinkedList Transient keyword Synchronization ORM tool Project
Fujitsu
New features of java array list and linked listmultiple inheritance
possible in java How to change port numbersalary query from a table
SQL string constant pool string objects stored in string constant pool or
stack ? Status codes in Postman try catch finally encapsulation and
abstraction hash map @Rest controller and @controller difference
@getmapping and @ request mapping Get and Load Session Factory
and Session what is multithreading, multiprocessing, multitasking and
what is interface . .y in java 8 default keyword introduce in interface,
difference between string bufferand string builder, what is immutable
class how u will implement, what is exception and hierarchy, what is
the difference between microservice and rest API, which collection u
have used in ur project...
CORE JAVA:
1. Difference Between Object oriented programming and
procedure oriented programming.
2. Is Java 100% object oriented programming language.
3. Difference between jdk and jvm.
4. Why pointers are not used in java.
5. Explain 4 basic oops concepts.
6. Functional interface and Lambda’s expression. How these two
are related to each other.
7. Use of marker interface.
8. What is object class and Which methods are present in the
Object class.
9. Difference between abstract class and interface .If there are
interfaces present then why we use abstract class.
10. Difference between final,finally and finalize.
11. What is Exception handling and Explain Exception handling
hierarchy .
12. Difference between throw and throws keyword.
13.What is serialization and deserialization.
14.Use of super and this keyword.
15.Explain Thread Life Cycle, wait and sleep.
16.How threads are created.
17.String Builder and String Buffer.
18.Program on Comparator and Comparable.
19.Collections:
20.Difference between collection and collections.
21.Difference between Arraylist and Linked List.
22.Difference between Array and Arraylist.
23. Hashmap and Hashtable.Which one is used for better
performance.
24. Program to retrieve 2nd element of the list from the bucket of
Hashtable(Collision).
25. Difference between Hashmap, Hashtable and HashSet.
26.Program to store and retrieve data from the Hashtable.
27.Internal working of Hashmap.
28. What is Hashcode and Hashing
technique.29.Write a program for reverse of
an array Advanced Java:

1. Difference between JPA and Hibernate.


2. What is Get and Post method.
3. What is ORM technique.
4. Annotations used in Hibernate.
5. What is HQL.
6. @Value annotation.
7. Difference between Spring and SpringBoot.
8. @Qualifier,@Autowired ,@Component,@SpringBoot.
9. Which annotation starts the SpringBoot Project.
10.What is Bean Life Cycle and what is Spring IOC.
11.Difference Between @Controller and @RestController.
12.What are Stream API’s.
13.What are Webservices and Microservices.
14.REST and SOAP API’s.
MYSQL:
1. What are DML and DDL commands.
2. What is Stored Procedure.
3. Difference Between Truncate and Delete.
4. Views and Types of Joins .
5. 2nd and 7th maximum salary.
Project:
Explain briefly your project.
How many tables are
present in your project.
Which type of collection
you use in your project.
What was your day to day
work in your company.
1. What is collection
framework?
2. Difference between
arraylist and linked list?
3. Difference between
hashmapand hashtable?
4. Map interface?
5. How sort a list?
6. What is multithreading?
7. What thread and how
many way we can
create it?
8. What is string? Why it is
immutable?
1. OOPS concept (Inheritance, Polymorphism,
Abstraction, Encapsulation) details. Difference
2. between .equals and ==.
3. Different ways to use a thread. In two ways
the thread can be used
A- By extending the thread class
B- By implementing the Run able interface.
4. Java is Pass by value or Pass or reference.
Java is always pass by value. During method invocation, a
copy of each argument, whether its a value or reference, is
created in stack memory which is then passed to the
method.
5. Is there any other instance in Pass by reference.
Difference between Arraylist & Vector.
6. ArrayList is non-synchronized where as the vector is
synchronized. So arraylist performance is better than
vector.
7. What is immutable class. Give example in Java and how we
can create it
8. Difference between abstract class and interface.
9. Hash Map Vs Hash Set Vs Hashing.
10. Java 8 features.
11. Primitive Data Type Vs Object Data Type.
12. Final Vs Finally Vs Finalize.
13.If we don’t override hashcode () method then what will
happen. If you don't override hashcode() then the default
implementation in Object class will be used by
collections. This implementation gives different values for
different objects, even if they are equal according to the
equals() method.
14. Replace Vs Replace All vs Replace First.

A- The replace() method is one of the most used string


methods for replacing all the occurrences of a character
with the given character. The replace() method of JDK
1.5 replaces the char and a sequence of char values.

B- The replace All () method is similar to the String.


Replace First() method. The only difference between
them is that it replaces the sub-string with the given
string for all the occurrences present in the string.

C- The replace First() method is another method for


replacing the substring. It replaces the sub- string with
the given string. The replace First () method replaces
only the first occurrence of the sub-string.

Types of Statements in java?


Expression Statements
Expression is an essential building block of any Java
program. Generally, it is used to generate a new value.
Sometimes, we can also assign a value to a variable. In
Java, expression is the combination of values, variables,
operators, and method calls.
There are three types of expressions in Java:
o Expressions that produce a value. For example, (6+9),
(9%2), (pi*radius) + 2. Note that the expression
enclosed in the parentheses will be evaluate first, after that
rest of the expression.
o Expressions that assign a value. For example, number =
90, pi = 3.14.
o Expression that neither produces any result nor
assigns a value. For example, increment or
decrement a value by using increment or decrement
operator respectively, method invocation, etc.
Declaration Statements
In declaration statements, we declare variables and
constants by specifying their data type and name. A variable
holds a value that is going to use in the Java program. For
example:
1. int quantity;
2. boolean flag;
3. String message;
Also, we can initialize a value to a variable. For example:
1. int quantity = 20;
2. boolean flag = false;
Control Statement
Control statements decide the flow (order or sequence of
execution of statements) of a Java program. In Java,
statements are parsed from top to bottom. Therefore, using
the control flow statements can interrupt a particular section
of a program based on a certain condition.
Control Statement

Conditional Loop or Iterative Flow


Control
Or Statements Or
Selection Statements Jump
Statements
If statement for Loop
return
If-else statement While Loop
Continue
If-else-if statement do-while Loop
break
Switch statement for-each Loop

PROGRAMS->

A. Different logical questions on String (.equals and


==).
B. Occurrence of character in a given string.
C.Find length of the given string.
D.Sorting of Array.
E.Palindrome of string, integer.
F.Armstrong Number
G. Sort an ArrayList.
H. In String find how many time occurrence of
characters.
I. Remove duplicate characters from String.

SQL->
• Foreign Key Vs Primary Key.
• Drop Vs Delete Vs Truncate Command.
• Joins and their types.
• DDL Vs DML.
DDL DML

It stands for Data Definition Language. It stands for Data


ManipulationLanguage.
It is used to create database schema and
can be used to define some constraints as It is used to add,
well. retrieve or updatethe data.
Basic command present in DDL are CREATE, BASIC command present
DROP, RENAME, ALTER etc. in DML areUPDATE,
INSERT, MERGE etc.
DDL does not use WHERE clause in its While DML uses WHERE
statement. clause inits statement.

• DBMS Vs RDBMS
• SQL Vs MYSQL Vs NOSQL
• Normalizations
Normalization is the process to eliminate data redundancy and
enhance data integrity in the table. Normalization also helps to
organize the data in the database. It is a multi-step process that
sets the data into tabular form and removes the duplicated data
from the relational tables.
• Relationship in SQL and its types.
In One-to-One relationship, one record of the first table will
be linked to zero orone record of another table.
In One-To-Many relationship, A single record from one table can
be linked to zero ormore rows in another table
In Many-To-Many relationship, there is a junction table created
which holds the primary keys of another tables and marked as
foreign keys.

• How to fetch common records from two tables.


• How to select unique records from a table.
• What is index in SQL.
Indexes are used to retrieve data from the database very
fast. The users cannotsee the indexes, they are just used to
speed up searches/queries.
The CREATE INDEX command is used to create indexes in tables
(allows duplicatevalues).
Query- CREATE INDEX idx_last name ON Persons (LastName);
• 5.What is View in SQL.
In SQL, a view is a virtual table based on the result-set of an SQL
statement.
A view contains rows and columns, just like a real table. The
fields in a view are filled from one or more real tables in the
database.
Query-
• What s Cursor in SQL.
Cursor is a Temporary Memory or Temporary Work Station. It is
Allocated by Database Server at the Time of Performing
DML(Data Manipulation Language)operations on Table by User.
There are 2 types of Cursors: Implicit Cursors, and Explicit
Cursors. These are explainedas following below.
1. Implicit Cursors:
Implicit Cursors are also known as Default Cursors of SQL
SERVER. These Cursorsare allocated by SQL SERVER when the
user performs DML operations.
2. Explicit Cursors :
Explicit Cursors are Created by Users whenever the user
requires them. ExplicitCursors are used for Fetching data
from Table in Row-By-Row Manner.
WITH CTE AS ( SELECT Name, Email City ROW_NUMBER() OVER
(PARTITION BY NAME, EMAIL City)
(ROW_NUM FROM GEEK) DELETE FROM CTE WHERE row_num≥
1;
17. SPRING BOOT->
A. Spring Vs Spring Boot (Advantages, Disadvantages, Which one
is better).
B. Spring Initializer.
The Spring Initializr is ultimately a web application that can
generate a Spring Boot project structure so that we can import
that into the IDEs like eclipse…
c. Spring Actuator.
Spring Boot Actuator is a sub-project of the Spring Boot
Framework. It uses HTTP endpoints to expose operational
information about any running application.
The main benefit of using this library is that we get health
and monitoring metrics from production-readyapplications.

d. Spring Boot starter.


Spring Boot Starters are dependency descriptors that
can be added under the <dependencies> section in
pom. xml. There are around 50+ Spring Boot Starters for
different Spring and related technologies. These starters
give all the dependencies under a single name.

e. Spring MVC.
A Spring MVC is a Java framework which is used to build web
applications. It follows the Model-View- Controller design
pattern. It implements all the basic features of a core spring
framework like Inversion of Control, Dependency Injection.

f. Flow of Spring MVC.

g. Advantages of Spring MVC over other framework.


i. Excellent support for developing Restful web services.
ii. Separate roles - The Spring MVC separates each role,
where the model object, controller, view resolver, Dispatcher
Servlet, validator, etc. can be fulfilled by a specialized
object.
iii. Light-weight - It uses light-weight servlet container to
develop and deploy your application.
iv. Rapid development - The Spring MVC facilitates fast
and parallel development.
v. Flexible Mapping - It provides the specific
annotations that easily redirect the page.

h. Declaration of different layer in Spring Boot.

i. How to connect Spring Boot application to database using


JDBC.

j. What is spring starter parent dependency tag.

k. 6.How you exposing data and how do you consuming it.

l. Beanfactory vs Application context .


One difference between the bean factory and application
context is that the former only instantiates bean when you
call get Bean() method while Application Context instantiates
Singleton bean when the container is started, It doesn't wait
for the getBean to be called.

m. Types of Bean Scope.


1. SingleTone
2. prototype
3. request
4. session
5. Global Session

n. Types of Auto
Wiring.
1. no
2. By name
3. by Type
4. Constructor
5. AutoDetect
18. HIBERNATE->
A. What is ORM ?
B. Hibernate Vs JDBC.

JDBC Hibernate

It is database connectivity technology It is a framework,

It does not support lazy loading Hibernate support lazy


loading

We need to maintain explicitly database Hibernate itself manage


connection and transaction. alltransaction

Low performance High Performance

c. Session and Session Factory in hibernate.


Session Factory is a class for Session objects. It is available
for the whole application while a Session is only available for
particular transaction.
Session is short-lived while Session Factory objects are long-lived.
Session Factory provides a second level cache and
Session provides a first level cache.

d. Lazy Loading in hibernate.


Lazy loading is a fetching technique used for all the
entities in Hibernate. It decides whether to load a
child class object while loading the parent class
object.
e. Caching in hibernate.
Caching is a mechanism to enhance the performance of a
system. It is a buffer memory that lies between the
application and the database. Cache memory stores
recently used data items in order to reduce the number of
database hits as much as possible.

f. How to create immutable class in hibernate.


1. Avoid providing any methods which modify
object state. Obvious candidates are property
setters as well as any other methods adjusting
existing properties.
2. Make all fields private – to avoid modifying them
directly, especially if they are referencevariables.
3. Make all fields final – to explicitly express intent
that their values should not change. This also means
all the properties need to be assigned at the moment
of creation in constructor.
4. Ensure class cannot be extended – this eliminates
a possibility to expose its variables indirectly through a
child class. It can be accomplished by making the class
final or by providing a private constructor. Static
factory method or a builder class is used to instantiate
objects in such a scenario.

g. Hibernate Architecture.
The Hibernate architecture is categorized in four layers.
a. Java application layer
b. Hibernate framework layer
c. Backhand api layer
d. Database layer

h. IOC Container.
The IoC container is responsible to instantiate, configure and
assemble the objects.

There are two types of IoC containers. They are:


1. Bean Factory
2. Application Context

i. Get () Vs load().
Get ( ) Load ()

It is used to fetch data from the It is also used to fetch


databasefor the given identifier data from the database
for the given identifier
If object not found for the given It will throw object not
identifierthen it will return null object foundexception

It returns fully initialized object so It always returns proxy


thismethod eager load the object object so this method is
lazy load the object

It is slower than load() because it return It is slightly


fully initialized object which impact the faster.
performance of the application

If you are not sure that object exist If you are sure that object
then useget() method exist then use load()
method

j. Hibernate vs JDBC. Why Hibernate over JDBC

k. All Hibernate annotations.


l. Lazy Loding vs Eager Loading.

Lazy Eager

In Lazy loading, associated In Eager loading, data loading


data loads only when we happens at the time of their
explicitly call getter or size parentis fetched
method.
Many-To-Many and One-To- Many-To-One and One-To-
Many associations used lazy One associations used eager
loading strategy by default. loadingstrategy by default.
It can be enabled by using It can be enabled by using
theannotation parameter : theannotation parameter :

fetch = Fetch Type. LAZY fetch = Fetch Type. EAGER


Initial load time much smaller Loading too much unnecessary
thanEager loading datamight impact performance

m. States of Object in Hibernate.


1. Transient State
An object we haven't attached to any session is in the
transient state. Since it was never persisted, it doesn't
have any representation in the database. Because no
session is aware of it, it won't be saved automatically.
2. Persistamce State-
An object that we've associated with a session is in the
persistent state. We either saved it or read it from a
persistence context, so it represents some row in the
database.
3. Detached State-
When we close the session, all objects inside it become
detached. Although they still represent rows in the database,
they're no longer managed by any session.
Q. First Level Cache Vs Second Level Cache.
20. OTHER QUESTIONS ->
Is it possible to change default port number.
B. Microservices And Webservices .
C. How to integrate email API in project.
D. Which all API’S you used in your project.
E. Why would you prefer STS on other applications.
21. (Project explanation ).
What is static, non-static/instance, local variables?
22.Difference between primitive and non-primitive data
types?
23. What is Constructors and its types and need of
constructor?
24. What is SOLID principle with advantages?
25. Difference between JDK, JRE and JVM?
26. What is anonymous class?
An anonymous inner class is an inner class which is
declared without any class name at all. In other words,
a nameless inner class is called an anonymous inner
class. Since it does not have a name, it cannot have a
constructor because we know that a constructor name is
the same as the class name.
Types of Anonymous Inner Class in Java
• Anonymous inner class that extends a class
• Anonymous inner class that implements an interface
• Anonymous inner class as an argument
27. What is Garbage collector and need of garbage collector
in java?
28. Explain Types of memory in java and explain each?
29. What are Class, Method and Object in java?
30. Difference between return and return value?
31. What is this keyword?
32. What are packages in java?
packages as being similar to different folders on your
computer. Package in Java is a mechanism to encapsulate
a group of classes, sub packagesand interfaces.

Packages are used for: Preventing naming conflicts. For


example there can be two classes with name Employee in two
packages, college. staff.
33. What is type casting and its type explain each?
34.What is interface and abstract class and when to
use interface and when to use abstract class with
example?
35. What is abstract keyword?
36. What is run time polymorphism?
37.What are marker interface and its uses and need?
Marker interface is used as a tag that inform the
Java compiler by a message so that it can add
some special behavior to the class
implementing it.
38. What are java 8 features explain each?
39. What are access modifier explain each?
40. Can we change the visibility of method while overriding
41. If yes then what is condition in it?
42. What are Scanner class and its uses?
43. What is for loop?
44. Difference between While and Switch statement?
45. Difference between continue and break statement?
46. Explain main method in java?
47. What is System.out.println()?Explain
48. What is Array? And its type
49. What is Serialization with example?
50. What is Deserialization with example?
51. What is transient keyword?
52. What is volatile keyword?
53. What is var type?
54. What is string tokenizer?
String Tokenizer Split()
It is a legacy class that allows It is a method of the String class or
an application to break a the java.util.
string into tokens. regex packagethat splits this
string around
matches of the given regular
expression.

It returns one substring at a It returns an array of substrings.


time.
It can handle empty strings
It can’t handle empty strings when you need to parse empty tokens
well. like ant, bat, pat

55. Can we overload static method in java?


56. Can we override static method in java?
57. What is super most class in java?
58. What is data hiding and how to achieve?
59. What is Static block in java?
It is a block in java which runs only once when a class
is sloaded into JVM,In other word it is also called as
Static Intitialization block.
60. What is Non-Static block in java?
61. What is Super keyword in java?
62. Difference between this and Super keyword?
63. What are Exception in java and its type explain each?
64.How many ways to handle exception in java explaineach?
65. Explain exception hierarchy?
66. Can we write finally without catch block?
67. Difference between throws and throw?
68. What is exception propagation?
69. Explain Checked and unchecked exception?
70. What are command line arguments?
71. What is thread?
Threads allows a program to operate more
efficiently by doing multiple things at the same
time. Threads can be used to perform complicated tasks
in the background without interrupting the main
program.
72. What is Demon thread?
A Daemon thread is a background service
thread which runs as a low priority thread
and performs background operations like
garbage collection.

73. What is multithreads?


Multithreading is a Java feature that allows concurrent
execution of two or more parts of a program for maximum
utilization of CPU. Each part of such program is called a
thread. So, threads are light -weight processes within a
process.
Threads can be created by using two mechanisms
1. Extending the Thread class

2. Implementing the Runnable Interface

74.Difference between thread join and sleep method?


There is a difference between join() and sleep().
join() will wait until the timeout expires or
the thread finishes. sleep() will just wait for
the specified amount of time unless
interrupted.
75. Process to create thread and which is best and why?
76. What is thread scheduler?
Thread scheduler in Java is the component of JVM
that determines the execution order of multiple
threads on a single processor (CPU). It decides the
order in which threads should run. This process is called
thread scheduling in Java.
77. Explain about priority of thread?
Each thread has a priority. Priorities are represented by
a number between 1 and 10. In most cases, the thread
scheduler schedules the threads according to their
priority (known as pre-emptive scheduling).
Note that not only JVM a Java programmer can also assign
the priorities of a thread explicitly in a Java program by using
set Priority () method..
78. Explain wait, notify and notify all?
The threads can communicate with each other through wait
(), notify () and notifyAll() methods in Java.
These are final methods defined in the Object
class and can be called only from within a
synchronized context.
The wait() method causes the current thread to wait until
another thread invokes the notify() or notifyAll() methods for
that object. The notify() method wakes up a single thread
that is waiting on that object’s monitor. The notifyAll() method
wakes up all threads that are waiting on that object’s monitor.
79. What is thread pool?
80. What are executor services?
The Java ExecutorService is the interface which allows us to
execute tasks on threads asynchronously. The Java
ExecutorService interface is present in the java.util.concurrent
package. The ExecutorService helps in maintaining a pool of
threads and assigns them tasks. It also provides the facility to
queue up tasks until there is a free thread available .
81. Difference between runnable and callable interface?

Runnable interface Callable interface

It is a part of java.lang package since It is a part of the


Java1.0 java.util.concurrent package
since Java 1.5.
It cannot return the return of It can return the result
computation. of the parallelprocessing
of a task.
It cannot throw a checked Exception. It can throw a checked Exception.

In a runnable interface, one In order to use Callable,


needs to override the run() you need to overridethe call()
method in Java.

82. Advantage and Disadvantage of thread?


The Thread class
has the following
advantages:
• Threads can be utilized to free up the main thread.
• Threads can be used to break up a task into smaller units that
can be executed concurrently.
The Thread Class has the following disadvantages.
• With more threads, the code becomes difficult to debug and
maintain.
• Thread creation puts a load on the system memory and CPU
.
• We need to do exception handling inside the worker
method as any unhandled exceptions can result in the
program crashing.

83. Explain thread life cycle?


New: Whenever a new thread is created, it is always in the
new state. For a thread in the new state, the code has not
been run yet and thus has not begun its execution.
Active: When a thread invokes the start() method, it moves
from the new state to the active state. The active state
contains two states within it: one is runnable, and the other
is running.
o Runnable: A thread, that is ready to run is then
moved to the runnable state. In the runnable state, It
is the duty of the thread scheduler to provide the
thread time to run, i.e., moving the thread
the running state.
o Running: When the thread gets the CPU, it moves
from the runnable to the running state. Generally, the
most common change in the state of a thread is from
runnable to running andagain back to runnable.
o Blocked or Waiting: Whenever a thread is inactive
for a span of time (not permanently) then, either the
thread is in the blocked state or is in the waiting state.
o Terminated: A thread reaches the termination state
because of the following reasons:

o When a thread has finished its job, then it exists or


terminates normally.
o Abnormal termination: It occurs when some
unusual events such as an unhandled exception or
segmentation fault.
84. What is Synchronization?
Synchronization is the process to get control over multiple
threads.
85. What is Synchronized keyword?
86.What is String in java and why String is Immutable in
java?
87. Difference between String, stringbuffer and stringbuilder?
88. What do you mean by mutable and immutable?
89. How to make a class immutable with example?
90. Why java is platform independent language?
91. Why java is not pure object oriented language?
92. Why pointers are not used in java?
A pointer is just the address of some memory location.
Java doesn't support pointer explicitly, But java uses
pointer implicitly: Java use pointers for manipulations of
references but these pointers are not available for outside
use.
Any operations implicitly done by the language are actually NOT
visible
93.What is singleton class and how we can make a class
singleton?
94. What is Collection framework?
A collection framework is one which is used for storing and
manipulating a group of objects.
95. What are wrapper classes?
96. What is cloning?
97. What is hash code and equal method?
98. What is JDBC and write code of JDBC?
99. Difference between Collection and Collections?
Collection:
Collection is a interface present in java. util.package. It is used
to represent a group ofindividual objects as a single unit.
The List, Set, and Queue are the main sub-interfaces of the
collection interface.
The add(), remove(), clear(), size(), and contains() are the
important methods of theCollection interface.
Collections:
Collections is a utility class present in java.util.package. It
defines several utility staticmethods like sorting and searching
which is used to operate on collection.
101.) Explain Collection hierarchy? Explain List, Set
and Queue?

Collection

Map List Set


Queue
Priority Queue
Hashmap Arraylist Linkedlist Treeset
Hashset Linked

Hashset
1) List: - list is an interface.
List follows insertion order. It consist of
duplicate elements. To use list interface we can
use three classes.
i. Arraylist
The ArrayList class is a resizable array, which can be found in the
java.util
package.it is internally work like a dynamic array.
ii. Linkedlist
We can use linkedList if there is no continuous memory of
location. Adding data is easier than arraylist.it divided into 2
types – i)single LinkedList , ii)Double LinkedList.
iii. vector
It work same as array but it is synchronized and give lower
performance than ArrayList
2) Set : Set interface doesn’t follow any insertion
order and can’t contain duplicate element.
We can use set interface by 2 classes. i.Hashset
It uses hashtable internally.it contains only unique element. It is
synchronized and it doesn’t
permit null element. It is the parent class
of LinkedHashSet. LinkedHashSet use for
remove duplicate element from an array.
ii.Treeset
It is use for sort data in ascending order.
3) Queue:-
Queue is the parent interface of priority queue. Priority
queue is follows FIFO(first in first out) order for adding and
removing data. 102. Difference between ArrayList vs
LinkedList and Vector?
ArrayList stores in continuous memory location where
LinkedList doesn’t required a
continuous memory location. ArrayList is non-synchronized
where vector is Synchronized
103. Explain HashSet and HashMap?.

HashMap HashSet

Data stores as key-value pair. Data stores as object.

synchronized Non-synchronized

Doesn’t allow duplicate element It contains single null key and


multiplenull values.

It is slower than hashSet Faster than HashMap.

Implement of set interface Implement of map interface.

104. Internal working of HashMap?


It internally uses hashtable. It uses hashcode of the key object
and this hashcode used to findindex of the bucket.
105. What is Collision and how to overcome
this?
It is a situation where two or more key objects produce the
same final hash value. Toovercome it each bucket consist of
linkedlist in it.

106. Difference between synchronized


hashmap and concurrent hashmap?

Synchronized hashmap concurrent hashmap

synchronized but slower synchronized but faster


than concurrent than
hashmap synchronized hashmap

It locks whole map It locks some portion of map

107. What is Ternary operator with example?

Comparable comparator

1) Comparable provides a single The Comparator provides multiple


sorting sequence. In other words, sorting sequences. In other words,
we can sort the we

collection on the basis of a single can sort the collection on the basis
element such as id, name, and of multiple elements such as id,
price. name, and price etc.
108. What are unary operators and its example?
109.

Enumeration Iterator

Only consist read() Have both methods remove(),


read()

Access only vector and hashtable Access any class in collection.

110. What are association and its type?

The ternary operator is an operator that exists in some programming

languages, whichtakes three operands rather than the typical one or two

that most operators use.

Ex:- < ,> ,? ,==

111. Difference between Iterator and List


Iterator?
which takes one operands i.e. single input it is

use to incrementor decrement value.

ex:- ++, --

List iterator is child interface of iterator.


Iterator travel in one direction having method next(),
hasNext(). List Iterator travel in both direction having
method previous(), hasPrevious(),next(), hasNext().
112. What is Fail fast and fail safe?
An association defines a relationship
between two entity objects based on
common attributes. The relationship can
be one-to-one or one-to-many.
113. What is Servlet?
List iterator is child interface of iterator.
Iterator travel in one direction having method next(), hasNext().
List Iterator travel in both direction having method previous(),
hasPrevious(),next(), hasNext().
114. Difference between DoGet and DoPost?
Fail-fast and Fail-safe are the

iterators or collections in Java. The

major difference is fail-safe iterator

doesn't throw any Exception like fail-

fast.

115. What is Servlet?

Servlet is a java class.it helps us to perform backend coding it

interact with frontend view andbackend business logic.

116. Difference between DoGet and DoPost?


DOGET DOPOST

Getting data from database Submit data into database

Data expose to URL Data not expose to URL


When you refresh page you’ll not get When you refresh page you get security
any security pop-up alert pop-up alert

117. What is InterServlet Communication?


Here one servlet can call from another servlet.by using
getRequestDispatcher

118. What is Request Dispatcher.

It receive request from client and send it to any resources like:-


servlets, jsp or HTML file.

119. Difference between ServletConfig and ServletContext?


ServletConfig ServletContext

It represent single servlet It represent whole web application

120. Explain Servlet Life cycle?


For the 1st time when we start tomcat init method will runs

once.(usually used to connect DB) DoPost and DoGet can run

several times.
121. What are Session Variables and its type?
It is a special type of variable which value can be access by
across the web pages.

There are four mode types or just modes. In-Process mode,

State Server mode, SQL Server mode, Custom mode and Off

mode.

122. What is JSP and its tag?

JSP stands for java server page.


We can write partially java code in it by using jsp tags. There are
4 types of jsp tags

1. scriptlet tag :- (<% %>)

It uses implicit object like:-session,request,response,out. Can’t


use HTML code inside it

and can’t declare any variable or method inside it.

2. Declaration tag :-(<%! %>)

Doesn’t have any implicit object. Can declare variable and


method.
Can write only one statement of code.
used for print output 4.Directive tag
:(<@ >) Jsp destroy
It is divided into 2 types :- page and include
Page directive is use to import any packages into the jsp page

and include directive use to import any file into the page

Explain JSP life cycle?

Jsp init

Jsp Jsp service


jsp translator

Jsp init can invoked once .jsp service() is used to service

the raised request by jsp .it takes request and response

object as parameters.

What is JSTL tag?

Jstl stands for jsp server tag library .we can write java code in it,
in form of html tag.

What are implicit object?

These are the readily available object present in jsp page ex:-
session,response ,request ,out .etc.

What is HTML and feature of HTML5?

Html stands for hypertext markup language . It is a pre-

defined markup language use to create User Interface(view


page).HTML 5 is the new version where audio and video are

supported.

Explain MVC architecture?

MVC architecture pattern separates an application into three


main logical component model ,view and controller.

View is use Html ,jsp ,jstl to make user Interface. Model is

used to perform business logic in it. Controller layer is used to

interact between view and model.

Difference between spring and SpringBoot?


spring SpringBoot

Complex to use Easy to use

For hibernate you’ve to download Only have to download starter tag


all dependency

Configuration done in xml file Configuration done in application.


Properties file

What is Web Services and its type?

It helps us to integrate heterogeneous

and homogenous application . Generally


it is 2 types:-i) S0AP (simple object
access protocol) , ii) Rest.
How to expose and consume web services?

If you want to exchange data between two application by json

or xml file you have to expose data to xml/json then another

application will consume this data.

Difference between SOAP and RESTFull web services?

SOAP RESTFull

Data exchange using xml file Data exchange using both xml file

& json object

Complex to implement through Simple to use json object

xml file

What is POSTMAN?

Postman is a standalone software testing API (Application

Programming Interface) platform to build, test, design, modify, and

document APIs

What are Http methods explain each?

The Hypertext Transfer Protocol (HTTP) is designed to enable

communications between clients and servers. HTTP methods

are:- I)GET :-fetch data from DB and display it as json object.

II)POST :- Save data to the DB using web

services. III)PUT :- update record to DB using


web services.

IV)Delete :-Delete record in DB using web services

Difference between micro services and


monolithic applications?

In monolithic application all module based on one

server. In micro services bigger application break

into smaller mini project and interact by web

services

What is Maven?

Maven is a build tool which is based on the concept of a

project object model (POM),. Using maven, we can build and

manage any Java-based project

What is Spring Initializer?

Spring initializer gives spring boot project structure which

we can further use to make spring boot project in eclipse.

What is Unit testing?

It is also known as White Box testing where testing done

by code level (programming level). Ex.:- jUnit ,testing.

What is Junit?

Junit used for unit testing.


Annotation used in junit are:-
@Test, @Before, @After,
@BeforeTest, @AfterTest

What is JPA?

Java persistence API(JPA) is a concept of taking the object

content and map it into the Database by ORM (object

relationship mapping).

What is Hibernate JPA?

The implementation of JPA can be done by using Hibernate.

What are Spring IOC and Its type?

Inside Spring IOC(inversion of control) dependency injection

logic written inside it. There are 2 types of Ioc available

I)BeanFactory ,

II) ApplicationContext

What is spring security?

It is a framework that focuses on providing authentication

and authorization mechanism to spring application.

What are JPA annotations used in your project


explain each?

JPA annotation are:-


(i) @Entity :-It defines which java class is map to
DB table. (ii)@Table :-When DB table and

Entity class name isn’t same we use this

annotation for mapping. (iii)@Column:-

This is used to map entity class variable

into DB column (iv)@Id :- It maps entity

class variable with primary key column of

DB.

(v)@Generated Value:- It helps us to auto-increment

value of variable in entity class while saving record in DB.

What are spring boot annotation used in your


project explain each?

Spring boot annotation are:-

@Autowired,@controller,@service,@component,@R
equestMapp n,
@RequestParam,@RestController,@GetMapping,@P
ostMapping,
@PutMapping,@DeleteMapping,@pathvariable,@m
odelAtteribute,@RequestBody,@Qualifier,@springB
ootApplication

What is Dependency injection?


It is core of spring
framework. Used to inject
bean inside Given reference
variable
Types of Autowired and
explain each?

Default

By name

By type

constructo

122. Difference
between

@Controller and

@RestController?

@controller define controller layer in spring boot ,

@Restcontroller defines webservices layer inour project.

Difference between @Autowiring and @Bean?

When interface implement only one class @Autowiring used

When interface implement more than one class @Bean used.

What is @Qualifier and @Services and

@Component and @Value and @Query ?


@Qualifier :- if one interface implement into 2 different classes
,so we’ve to tell spring which

class object should create.

@Service :- Define the service layer


of spring boot. @component :- It
tells spring boot to maintain object
life cycle. @Query :-It use to
declare query directly on repository
method.

Explain @SpringBootApplication?

It defines the starting point of execution in spring boot project.

Difference between Bean factory and Applicant icon


Context?
The application Context comes with advanced features,

while beanFactory comes with basic features

Application context implement from bean factory interface.

Difference between JPA and Hibernate?

JPA is a concept where we taking


object content and map it into the DB
and implementation done by hibernate.

Explain advantage of Hibernate over JDBC?

Jdbc is a connectivity ,hibernate is a framework


Jdbc has lower performance than

hibernate We can create database table

by using hibernate

What is Session in hibernate?

Session interface(API) is the main tool used to communicate

with hibernate It used to get a physical connection with

Database.

What are roll back and commit?

Once rollback is execute ,the database


would reach its previous state. Once the
commit statement execute ,the data
cannot be rolled back

Session management in spring boot?

I) create spring boot project from spring initializer.

ii)add spring session jdbc dependency in pom.xml

iii)add spring jdbc properties in application.

Properties.

How to create session object?

HttpSession mySession=request.getSession( );

Difference between session and sessionFactory?


Session factory is a factory class for session objects.it

available for whole application while session only available

for particular transaction.

Difference between get and load method of hibernate?

Both are used to fetch data .

Get( ) return null if no row is available on the database Load( )


throws object not found exception.

What is caching and hibernate and explain 1st


level and 2nd level caching?

Caching is the mechanism to enhance threperformance of the


system.

1st level maintained at session level and accessible only to the

session, while 2nd level maintain at the session factory level

and available to all sessions.

What are Core interface of hibernate?

- Configuration interface

- Transaction interface

- Session interface - SessionFactory interface

What is Jenkins?

Jenkins is used for testing and reporting.

What is JIRA?
Jira is a software application used for issue tracking and project
management.

How to read application. Properties in any class?

Read a property from application. Properties file using @


Configuration Properties & @value
What are response codes of POSTMAN?

200/201/204/400/401/403/404/405/500/503

Session Tracking is a way to maintain state (data) of an user.


162. Explain types of spring bean scope?
Singleton , prototype ,request ,session, global session

163. What is Actuator in spring boot?


Actuator is used to expose operational information .It is the
subproject of spring boot.
164. What is Starter tag in spring boot?
It is the default configuration of all hibernate dependency.

165. Types of hibernate mapping explain


each?

Primitive type mapping (integer

,long , short ,Boolean ) Date

and time mapping (Date , time

,timestamp ,calendar
Binary and Large

Object Types(binary
,text ) Jdk related type

(class,timezone)

Types of inheritance in hibernate?

Hibernate supports 3 types of Inheritance Mappings:Table per


class hierarchy

Drop :- It is used to eliminate the whole database from the


table.

Truncate :- It is used to eliminate the data from the table


166. Find 2nd max salary from employee
table?

To find 2nd max salary we use sub-query.

Select max(salary) from employee where salary<( Select

max(salary) from employee where salary)

167. What is Primary key and foreign key?


Primary key can have unique value but not null.
Foreign key helps us to build relation between 2
tables it consists of repeated value

168. Explain SDLC model?


There are different software development life cycle models

specify and design, which are followed during the software

development phase. These models are also called "Software

Development Process Models


169. Explain about Agile methodology?
We can build a software at aleast possible time

without compromise quality. We generally use

scrum process for that 176. Explain JDK, JRE

and

JVM?

Java development kit (jdk) consist of development kit with

jre. It is used by developer to write and run programme.

Java runtime environment (jre) consist 0f java library and a jvm


in it
.It can used by
customer to run the
programme. Jvm is
read the .class file and
give the output.

177. Explain public static void main(String


args[]) in Java
Public :- jvm call the .class file
from another package Static :-
main method can call without
creating an object. Void :- main
method has no return type,
String args[] :- it is command line argument.
178. Why Java is platform independent?

When .java file compiled into .class file it convert into byte code
by JIT compiler
.and this byte code can use any platform because of jvm.
179. Why Java is not 100% Object-oriented?

Because without creating an object we can access the data by


through static block
180. What are wrapper classes in Java?

It stores the primitive data type value inside an object,

by doing this we get many in-built method for

manipulating the value.

181. What are constructors in Java?

Constructors are used to initialize the object we created. These


are permanently internally void

182. What is singleton class in Java and how


can we make a class singleton?

In these class only one object can create throughout the class.
To design a singleton class: 1 Make constructor as private. 2

Write a static method that has return type object of this

singleton class.

183. What is the difference between Array list


and vector in Java?

Working of array list and vector are same but vector is

synchronized where
array list is non- synchronized.

184. What are the differences between Heap


and Stack Memory in Java?

In stack memory execution of programme done and in heap

memory object will created. Stack is faster than heap because

it follows LIFO (last in first order)

185. What is Polymorphism?

Polymorphism is a oops concept .here we develop such a

feature that a method can have many form. We can achieve

polymorphism by 2 ways .:-Overriding, Overloading.

186. What is runtime polymorphism or


dynamic method dispatch?

Class upcasting done with method overriding known as rutime


polymorphism.

187. What is abstraction in Java?

In abstraction we hide internal implementation details and

showing only functionality to the user. We can achieve it by

interface and abstract class.

188. What do you mean by an interface in


Java?
Interface consist of only incomplete method in it. We can use it
by implement it into a class .

Multiple inheritance supported in interface but we can’t create


object inside in an interface.

189. What is the difference between abstract


classes and interfaces?
Interface consist of only incomplete method where abstract

class consist both complete and incomplete method .multiple

inheritance done by using interface.

190. What is inheritance in Java?

In inheritance we inherit the properties of an object from

parent class to child class . Inheritance done for reusability.

191. What are the different types of


inheritance in Java?

(i) Single inheritance :- one parent class one child


class
(ii) Multiple inheritance :- multiple parent class-

one child class (iii)Multilevel inheritance :- 1st

parent class 2nd parent class/1st child class 2nd

child class

(iv)Hybrid class :- multiple +multilevel inheritance.

192. What is method overloading and method


overriding?
In method overriding we inherit a method and change its

logic in child class . In method overloading we can create

more than one method in same class with different no of

argumentand different types of arguments.

193. Can you override a private or static


method in Java?

NO ,we can’t inherit private or static method in java

194. What is multiple inheritance? Is it


supported by Java?

When more than one classes have only one child class called as
multiple inheritance. In classlevel multiple inheritance doesn’t
support but in interface level it supports.

195. What is encapsulation in Java?


When we binding all the data and code together that is known as

encapsulation. We use getter and setter for perform

encapsulation.

196. What do you mean by aggregation?

In the case of Aggregation, an object can exist without being


part of the main object.

197. What is composition in Java?

A composition in Java between two objects associated

with each other exists when there is a strong relationship

between one class and another.

198. What is a marker interface?

A empty body interface called marker interface. Ex -


Seralizable,clonable ,etc.
199. What is a constructor overloading in Java

If more than one constructor is there inside one class

with different no. of arguments or different type of

argument Is known as constructor overloading.

200. What is a servlet?

Servlet is a class used to perform backend coding. It used for


interact between view andmodel

Servlets – Java Interview Questions


What is Request Dispatcher?

100. What is the life-cycle of a servlet?

101. How does cookies work in Servlets?

102. What are the different methods of session management


in servlets?

JDBC – Java Interview Questions


103. What are the steps to connect to a database in java?

104. What is the difference between execute, executeQuery,


executeUpdate?

Spring – Java Interview Questions


105. Explain Bean in Spring and List the different Scopes of
Spring bean.

106. Write a program for a thread safe singleton class?

107. What is autowiring in Spring? What are the autowiring


modes?

108. How to handle exceptions in Spring MVC


Framework?(@ExceptionHandler).

109. Which one will you prefer among spring and springboot
to create a program from scratch?

Hibernate-Interview Questions
110. What is Hibernate Framework?

Ans:- hibernate is an open-source object-relational mapping


(ORM) based java persistence framework. It is an ORM
mapping tool in java. Hibernate is designed with the need to
reduce complexity while connecting a relational database
through java. Hibernate framework is designed to map java
objects to implement object- oriented programming in the
relational database.

a. What are the advantages of Hibernate over JDBC ?

Ans:- Advantages of Hibernate over JDBC:

1. Hibernate is an ORM tool


2. Hibernate is an open source framework.
3. Better than JBDC.
4. Hibernate supports inheritance and polymorphism.
5. With hibernate we can manage the data
stored across multiple tables, by applying
relations(association)
6. Hibernate has its own query language called
Hibernate Query Language. With this HQL
hibernate became database independent.
7. Hibernate supports relationships like One-To-
One, One-To-Many, Many-To-One ,Many- To-
Many.
8. Hibernate supports lot of databases.
9. Hibernate supported databases List.
10. Hibernate also supports annotations along with XML.
11. Hibernate supports Lazy loading.
12. Hibernate is easy to learn it is developers friendly.
13. Hibernate maintains database connection pool.
14. Using Hibernate its Easy to maintain and it will
increases productivity

111. What is JPA can you directly implement it?

JSP Interview Questions


112. JSP lifecycle?
113. What are the JSP implicit objects?

114. What are the different tags in JSTL?

Ans:- The JSTL tags can be classified, according to their


functions, into the following JSTL tag library groups that can
be used when creating a JSP page −
• Core Tags
• Formatting tags
• SQL tags
• XML tags
• JSTL Functions
115. Explain the jspDestroy() method.

Exception and Thread - Interview Questions


116. What is the difference between Error and Exception?

117. How can you handle Java exceptions?

118. What are the differences between Checked Exception


and Unchecked Exception?

119. Checked Exception?

120. Define Threads and its types?

121. Will the finally block get executed when the return
statement is written at the end of try block and catch
block as shown below?

122. Thread life cycle?

123. What are the differences between throw and throws?


124. How to create a custom Exception?

125. What is a finally block? Is there a case when finally will


not execute?\

126. Can we write multiple catch blocks under single try


block?

127. What is OutOfMemoryError in Java?

Ans:- OutOfMemoryError is a subclass of


java.lang.VirtualMachineError in java. It is thrownby the
Java Virtual Machine (JVM) when an object cannot be
allocated due to lack of memory space and also, the
garbage collector cannot free some space.

128. What is a Thread?

129. What are the two ways to create a thread?


130. Garbage collectors in Java?

131. Can you call a constructor of a class inside another


constructor?

132. How is the creation of a String using new() different from


that of a literal?

133. Why is synchronization necessary? Explain with the help of


a relevant example.

134. What are the differences between Heap and Stack Memory
in Java?

• Ans:- ľhe majoí diffeíence between Stack memoíy and


heap memoíy is that the stack is used to stoíe the oídeí
of method execution and local vaíiables while the heap
memoíy stoíes the objects and it uses dynamic memoíy allocation
and deallocation.
135. What is JIT compiler in Java?

• Ans:- ľhe Just-In-ľime (JIľ) compileí is a component


of the JRE (Java Runtime Enviíonment) that impíoves
the peífoímance of Java applications at íun time. It
helps impíove the peífoímance of Java píogíams by
compiling bytecodes into native machine code at
íuntime .
136. What are access modifiers in Java?

• Ans:- ľhe access modifieís in java specifies accessibility


(scope) of a data membeí, method, constíuctoí oí class.
ľheíe aíe 4 types of java access modifieís: píivate.
default. píotected. public.
137. What is an object in Java and how is it created?

Ans:- a. An entity that has state and behavioí is known as an object .

b. There are five different ways to create an object in Java:


o Java new Operator
o Java Class.newInstance() method
o Java newInstance() method of constructor
o Java Object.clone() method
o Java Object Serialization and Deserialization

138. What is Object Oriented Programming?

• Ans:- ľhe object-oíiented píogíamming is basically a


computeí píogíamming design philosophy oí methodology
that oíganizes/ models softwaíe design aíound data, oí
objectsíatheí than functions and logic. An object is íefeííed
to as a data field that has unique attíibutes and behavioí.
Eveíything in OOP is gíouped as self-sustainable objects.
139. What are the main concepts of OOPs in Java?

140. What is the difference between a local variable and an


instance variable?

141. What is an infinite loop in Java? Explain with an example.

Ans:- Infinite loop in java íefeís to a situation wheíe a condition is setup


so that youí loop continues infinitely without a stop. A loop statement
is used to iteíate statements oí expíessions foí a definite numbeí of
times but sometimes we may need to iteíate not foí a fixed numbeí but
infinitely.

142. What is Java String Pool?

143. Differentiate between static and non-static methods in Java.

144. What is constructor chaining in Java?

145. Difference between String, StringBuilder, and StringBuffer.

146. What is a classloader in Java & Types?

Ans:- A ClassLoader is an object responsible for dynamically


loading Java class during runtime to prevent JVM from realizing
that ClassLoader is a part of the Java Runtime Environment. It
makes JVM life easier. JVM loads the classes into memory when
required by the application and does not load all at once.
ClassLoader then comes into the picture and loads the class into
memory.

A Java Classloader is of three types:

Three Types:

1. Bootstrap Classloader

2. Extension Classloader

3. system classloader
147. Why Java Strings are immutable in nature?

Ans:- In Java, stíing objects aíe immutable in natuíe which simply


means once the Stíing object iscíeated its state cannot be modified.
Wheneveí you tíy to update the value of that object insteadof updating
the values of that paíticulaí object, Java cíeates a new stíing object.

148. What is the difference between an array and an array list?

Ans:- The main difference between Array and ArrayList is that Array
is a fixed length data structurewhile ArrayList is a variable length
Collection class.

149. collection hierarchy below go throught all of them i have


attached the image below.

150. Internal Algorithm working of Hashmap?

• Ans:- Inteínal Woíking of HashMap in Java. ľhe function


‘hashCode’ is used to get the hash code of an object in
Java. ľhis is an object of supeí class Object. It íetuíns the
object íefeíence’s memoíy as an integeí. It is a native
function, which means no diíect method in Java can be
used to fetch the íefeíence of the object.

151. Define webservice and microservices briefly?

152. What methods were you using in REST?


Ans:- Following four HTTP methods are commonly used in REST based
architecture.
• GET − Provides a read only access to a resource.
• POST − Used to create a new resource.
• DELETE − Used to remove a resource.
• PUT − Used to update a existing resource or create a new
resource.
153. Methods of Hibernate?

Ans:- Methods of Hibernate Session

1. Save(): Save() method generates the primary key and

inserts the record in the database. It is similar to the

persist() method in JPA but it behaves differently in a

detached instance by creating the duplicate record upon

database commit.

2. Update():Update() is used to update the existing database

record. It returns an exception if the record is not found or

called in a transient instance.

3. saveOrUpdate(): It saves or updates the database based

on the entity passed. It does not return an exception in

the transient state but it makes the state to persistent

during a database operation.

4. merge(): Values from a detached entity are updated to


the database when the merge() isused by changing the

detached entity to the persistent state.

5. delete(): Delete method works in persistent mode to

remove the entity from the database. An exception is

returned if no record is found in the database.

154. Xml v/s JSON?

155. Miscelleneous Question


156. Classnotfound Exception v/s Noclassdef found Exception?

Ans:- Both ClassNotFoundException and


NoClassDefFoundError occur when the JVM can not find a
requested class on the classpath. Although they look
familiar, there are some core differences between these
two.

ClassNotFoundException

ClassNotFoundException is a checked exception which


occurs when an application tries to load a class through its
fully-qualified name and can not find its definition on the
classpath.
This occurs mainly when trying to load classesusing
Class.forName(), ClassLoader.loadClass() or
ClassLoader.findSystemClass().

NoClassDefFoundError

NoClassDefFoundError is a fatal error. It occurs when JVM


can not find the definitionof the class while trying to:

• Instantiate a class by using the new keyword


• Load a class with a method call
The error occurs when a compiler could successfully
compile the class, but Java runtime could not locate the
class file.
157. Intermediate and Terminal operations in stream?

Ans:- ľhe opeíations which íetuín anotheí stíeam as a íesult aíe called
inteímediate opeíations and the opeíations which íetuín non-stíeam
values like píimitive oí object oí collection oí íetuín nothing aíe called
teíminal opeíations.

158. Group by & order by?

159. Delete v/s Drop?

160. SIB v/s IIB?

161. Steps to create immutable class in java?

162. Map v/s Flat Map?

Ans:- flatMap would peífoím mapping each aííay not with stíeam but
with the contents of that stíeam. All of the individual stíeams that
would get geneíated while using map(Aííays::stíeam) get meíged
into a single stíeam.

163. Reduce() method?

Ans:- In Java, reduce() is a method of the Stream interface.

It is the method of combining all elements. For each element


presented in the stream, the reduce() method applies the binary
operator. In that stream, the first argument to the operator must
return the value of the previous application and the second
argument must return the current stream element.
It allows us to produce a single result from a sequence of elements
by repeatedly applying a combining operation to the elements in the
sequence called reducing.

164. What is spring boot starter?


Ans:- Spring Boot provides a number of starters that allow us to
add jars in the classpath. Spring Boot built-in starters make
development easier and rapid. Spring Boot Starters are
the dependency descriptors.

In the Spring Boot Framework, all the starters follow a similar


naming pattern: spring-boot-starter-
*, where * denotes a particular type of application. For example, if
we want to use Spring and JPA for database access, we need
to include the spring-boot-starter-data-jpa dependency in
our pom.xml file of the project.

Spring Boot Actuator Features

There are three main features of Spring Boot Actuator:

o Endpoints
o Metrics
o Audit

165. Status codes of postman?

Ans:- A status code defines the status of the íequest. On enteíing


URL, a mistake can be typed in the URL, oí theíe may be a seíveí- side
píoblem. Status code is used to know about what went wíong and

wheíe you made a mistake. ľheíe aíe diffeíent status codes, and
each of the status codes has diffeíent meanings.

166. Different errors codes like 404,400,500,200?

Ans:- 404 Not Found : The requested resource was not


found. Most commonly found error.

400 Bad Request : The request was incorrectly done.


500 Internal Server Error : This is a collection-status
code for unexpected server error.

An HľľP status code 200 means success.

167. Lazy loading v/s Eager loading?

168. Iterators and types?


Ans:- An Iterator is an object that can be used to loop
through collections,

like ArrayList and HashSet. It is called an "iterator"


because "iterating" is the technicalterm for looping.

• Types:-

• Enumeration − Enumeration is initial iterators introduced


in jdk 1.0 and is only for older collections like vector or
hashTables. Enumeration can be used for forward
navigation only. Element can not be removed using
Enumeration.

• Iterator − Iterator is a universal iterator introduced in Jdk


1.2 and can be used for any collections. Iterator can b e
used for forward navigation only. Element can be removed
using iterator if remove method is supported.

• ListIterator − ListIterator is a iterator for List type collections


and supports bidirectional navigation.
169. List iterator?

Ans:- It is used to read, remove, add, and update


the collection elements by iterating over specified
List type collection.
170. Session, session factory?

Ans:- SessionFactory is an interface. SessionFactory can be created


by providing Configuration object, which will contain all DB related
property details pulled from either hibernate.cfg.xml file or
hibernate.properties file. SessionFactory is a factory for Session
objects.

We can create one SessionFactory implementation per database in


any application. If your application is referring to multiple
databases, then you need to create one SessionFactory per
database.

The SessionFactory is a heavyweight object; it is usually


created during application start up andkept for later use. The
SessionFactory is a thread safe object and used by all the
threads of an application.

A Session is used to get a physical connection with a database.


The Session object is lightweight and designed to be
instantiated each time an interaction is needed with the
database. Persistent objects are saved and retrieved through a
Session object.

The session objects should not be kept open for a long time
because they are not usually thread safe and they should be
created and destroyed them as needed. The main function of the
Session is to offer, create, read, and delete operations for
instances of mapped entity classes.

171. Spring MVC?

Ans:- A Spring MVC is a Java framework which is used to build web


applications. It follows the Model- View-Controller design pattern.
It implements all the basic features of a core spring framework
like Inversion of Control, Dependency Injection.

A Spring MVC provides an elegant solution to use MVC in


spring framework by the help of DispatcherServlet. Here,
DispatcherServlet is a class that receives the incoming request
and maps it to the right resource such as controllers, models, and
views.
172. JPA anotations?

Ans:- @Entity, @Table ,@Column ,@Id ,@GeneratedValue.

173. Stream API with example?

Ans:- ľhe Java Stíeam API píovides a functional appíoach to


píocessing collections of objects. ľhe Java Stíeam API was
added in Java 8 along with seveíal otheí functional
píogíamming featuíes.

Ex- We can find the even

numbers,square numbers from a

number list.Like - public class A{

Psvm(){

List<Integer> data =Arrays.asList(1,2,3,4);

List<Integer> evenNum=data.Stream().filter(x-

>x%2==0).collect(Collectors toList());

Sop(evenNum);

174. Microservices v/s Monolithic architecture?

175. what is DDL and DML?

Ans:- The key distinction is that the DDL command is used to create a
database schema, while the DMLcommand is used to modify the table's
existing data.

DDL Commands- DDL stands for Data Definition Language.

The following commands come under DDL language:

o CREATE
o DROP
o ALTER
o TRUNCATE: It is used to completely remove all data from
a table, including their structureand space allocates on the
server.
o RENAME: This command renames the content in the
database.

DML Commands- It stands for Data Manipulation Language.

The following commands come under DML language:

o SELECT: This command is used to extract information from a


table.
o INSERT: It is a SQL query that allows us to add data into a
table's row.

1. Threads
• What is a thread
• Different ways to creates a thread
• Where thread are used
2. Collections
• Explain collection concept
• Difference b/w array list & linked list
• Difference b/w Hashmap and Hashtable
• Difference b/w Hashset and linked Hashset
3. What are the features of Java 8 explain all
4. JSP life cycle
5. Thread life cycle
6. Strule of cycle
7. Words a code for connecting to the database
8. Words a code for printing duplicate elements
9. Words a code for printing the occurrence of each element
10. Words a code for reusing a number and string
11. Words a code for printing Fibonacci Serves
12. Explain oOps concept
13. Different b/w Infrared and abstract class
14. What is marled Interface
15. Sterilization & dissterilization
16. Explain constructions and what is construction chaining.
17. Difference b/w static, non static variables
18. Difference b/w method and construction
19. Multiple catch block
20. Exception handling
21. What is spring boot, how etc work
22. All the annotation used in the
COMPANY HOME:- Reorient Questions

1. What is selenium
2. When do the Automation testing
3. What is locates
4. Types or locates
5. Different steps absolute anal relative x-path.
6. What is testing and their annotation
7. Some airing secretion based question
8. Different Seth retest and regression testing
Company names & quality Kiosk (mumble)
Question
1. Mosting focus on opens concept
2. What is exception
3. How to handler expectation in Java
4. Diff better throw, throw
5. what is try and catch block
6. diff better final, finally, finalized
Company name: Junera Teem
1. Asking only selenium questions
2. Locators, types
3. Testing, denotation
4. Pem
5. Asking about project in second round and agile
methodology etc
• Introduce yourself.

• OOPS real life example.

• Why Java is a platform independent software?

• Does JVM is platform independent?

• What is exception and error?

• What is finally block?

• What is throw and throws?

• What is static keyword in java?

• Can you make your class static?

• What is the benefits Threads?

• What is the way of creating threads?

• What is abstract class?

• Can we write abstract class without abstract method?

• Can you overiride abstract method?

• String pool memory


• Frequency of occurrence of characters (character
occurrence using Hashmap)

• MySQL is RDBMS?

• Candid key vs unique key

• Benefits of Spring Boot


CORE JAVA

1. OOPS, Concept

Inheritance

Abstraction

Encapsulation

Polymorphism

2. What is Java?

3. What are constructors?

4. Difference between expectation & error?

5. What is exception? How to handle it?

6. Difference between final, finally & finalize?

7. What is data hiding?

8. Why string is immutable?

9. Difference between string butter & string butter & string


builder?

10. What are thread? Multi threading?

11. Thread life cycle?

12. What is multi thread?


13. What is run able interstice

14. What is thread Pool?

15. What is wrapper class?

16. New ferries in java 8?

17. Memory of JVM? Heap & stack?

18. Types of Access modifier?

19. What is use of static?

20. String Pool?

21. What is serialization?

22. What desonialzation ?

23. Transient keyword?

24. Difference between collection & Array?

25. Interface & abstract class?


Advance Java & All

1. Difference between JPA & Hibernate

2. What is singleton?

3. What is spring security?

4. All JPA annotation & spring boot Annotation explain?

Spring boot application (IMP)

5. What is session?

6. What is session factory?

7. What is spring IOC? Types

8. Explain DI?

9. Difference between primary key, foreign key & unique key.


10. What is served & its life cycle?

11. MVC Architecture?

12. Web services?

Interview Questions The Infosys for fresher’s.

1. First they made me comfortable by wishing me the day


time and asked about my college life.

2. They asked about myself (my introduction)

3. They asked about my fourth year project but I mentioned


the project which is sir has thought and the functionalizes
and technologies used.

4. She asked me about OOPs concept co capsulation,


Polymorphism.

5. In database- primary key, foreign key.

6. String, overloading and overriding.

7. She asked me about how to mare gate from one webpage


to another and 7 answered in form tag the action attribute
word divide that.

8. Project explanation

9. Complete the series – 8, 6, 9, 23, 87 . . . . . .

8x1-2=6

6 x 2 – 3 =9

9 x 3 – 4 =23

1. What are oops concepts?


2. Java 8 new features?
3. Streams in java and name some of the method you
know?
4. Diff between Default and protected access Specifiers?
5. Diff between static and local variable?
6. Diff between compiler and JVM?
7. What is Singleton design pattern?
8. Explain Exception hierarchy?
9. Diff between compile time and runtime exception?
10. String buffer vs string builder?
11. Without using oops concept can we develop a project?
12. What is Multithreading?
13. Explain Thread lifecycle?
14. Ways to create thread?
15. What is typecasting, upcasting, downcasting?
16. What is wrapper class and examples?
17. What is boxing?
18. Diff between Array list and linked list?
19. Diff between array list and Vector?
20. (a)Collection vs Collections? (b)comparator vs
comparable?
21. Explain Collections hierarchy and explain its
components?
22. Diff between List ,Set and map?
23. Diff between HashMap and HashTable?
24. Internal working of HashMap?
25. Diff Primitive and object datatype?
26. What if two null store in HashMap?
27. What is marker interface and use of marker interface
.examples also?
28. Why java is not 100% object oriented?
29. Explain Servlet lifecycle?
30. Jdbc code to connect with database?
31. Diff between Doget and Dopost method ?
32. Diff between abstract class and interface?
33. What is optional class?
34. Why we use spring boot framework?
35. What all Annotations in spring boot?
36. How to integrate hibernate in your project?

37. Mapping in hibernate?


38. How to configure database in spring boot project?
39. Diff between @controller and @restcontroller ?
40. What are the types of Autowire?
41. Explain Dependency Injection?
42. What is spring IOC ?
43. Spring boot project flow?
44. What are the HTTP methods and explain each one?
45. What are joins in SQL and explain each one?
46. What are the aggregators in SQL?
47. Diff between Primary key and foreign key?
48. Diff between DDL and DML?
49. Diff between drop, delete and truncate?
50. WAP to find (a)given string is palindrome or not ? (b)
find max repeating character in a string? (c) count each
character in a string? (d)Reverse the given string?
(e)2nd max element from array ?(f)duplicate element in
a string?

1. CORE JAVA ->

A. OOPS concept (Inheritence,


Polymorphism, Abstraction, Encapsulation)
Indepth.
B. Difference between .equals and ==.
C. Different ways to use a thread.
D. Java is Pass by value or Pass or reference.
E. Is there any other instance in Pass by reference.
F. Difference between Arraylist & Vector.
G. What is immutable class. Give example in Java
and how we cancreate it.
H. Difference between abstract class and interface.
I. Hash Map Vs Hash Set Vs Hashing.
J. Java 8 features.
K. Primitive Data Type Vs Object Data Type.
L. Final Vs Finally Vs Finalize.
M. If we don’t override hashcode() method then what
will happen.
N. Replace Vs Replace All

NOTE-> (All the differences of concepts in Core Java areimportant).

2. PROGRAMS->

A. Different logical questions on String (.equals and


==).
B. Occurrence of character in a given string.
C. Find length of the given string.
D. Sorting of Array.
E. Palindrome of string, integer.
F. Collection related logical questions (Very
important for product-base company).
3. SQL->

A. Foreign Key Vs Primary Key.


B. Drop Vs Delete Vs Truncate Command.
C. Joins and they types.
D. DDL Vs DML.
E. Types of statement.
F. DBMS Vs RDBMS
G. SQL Vs MYSQL Vs NOSQL
H. Normalizations
I. Relationship in SQL and its types.
J. How to fetch common records from two tables.
K. How to select unique records from a table.

4. SPRING BOOT->

A. Spring Vs Spring Boot (Advantages,


Disadvantages, Which one isbetter).
B. Spring Initializer.
C. Spring Acuator.
D. Spring Boot starter.
E. Spring MVC.
F. Flow of Spring MVC.
G. Advantages of Spring MVC over other framework.
H. Declaration of different layer in Spring Boot.
I. How to connect Spring Boot application to database using
JDBC.

INTERVIEW QUESTIONS
OCT 2021 TO NOV-2021
1. Explain your project briefly
2. How many user stories you worked on during your project
development
3. How many times you attended Spring retrospective
meeting, how many and whom are there in the meeting
4. How many times scrum meeting you attended, what was
discussed in that meeting
5. How much time you took to complete one sprint
6. What are roles of srcum master
7. Size of team
8. What are Burn down/up charts , have you managed them?
9. What is discussed in sprint review
10. Day to day working how its done
11. Design patterns (singleton, prototype)
12.How to achieve singleton pattern if we can break them
using clone and reference
13. What is Junit testing
14. How to test controller service layer and data base
15. What is mocking
16. Write test case in Mockito , mock MVC, integrity testing
17. Explain REST API
18. How to implement REST API
19. How to explore JSON object
20. Difference between @RestController and @Controller
21. @SpringBootRun explain
22.Difference between @Configuration and
@Autoconfiguration
23. @Component and @Service Difference
24. @Mock annotataion explain
25. @Qualifier annotation
26. How to consume query parameter
27. Classes used to consume JSON object
28. Why to go with Microservices Architecture
29. Stream API explain in brief
30. Write a stream code for given condition
31. Lambda Expression
32.Predicate, function, consumer, supplier syntax, parameter
and return type for these
33. Functional interface, predefined fuctional interface names
34. Difference between map() and flatmap()
35. Filter() in stram
36. Collection and Collections difference
37. Diff bet array and arrayList
38. Difference MAP and SET
39. Difference between treeset and hashmap
40. Difference List and Set, Hash map Hash set
41. HashMap internal Working
42. How to add elements in Hashmap
43. Where to use hashmap and where to use hash set
44. Where to use linked list and where to use arraylist
45. Difference between hashmap and hashtable
46. Which data structure followed by hashmap and hashset
47. Which DS followed by list
48. DS followed by Queue and methods in it
49. Program to find duplicate element from an array
50. Non repeatating character from string
51. Swapping two variables without using third variable
52.Maximum addition of any two integers from an integer
array
53. Difference between truncate, drop, delete
54. Sql queries like third max salary
55. Joins
56. Difference between SQL and Mysql
57. What are integrity contraints
58. Stored procedures
59. Explain Index
60. How many indexes are there and what are they
61. Composite key
62.Explain group by order by and having clauses, queries
based on that
63. Difference between union and union all
64. DDL commands
65. DML commonds
66. What is TCL and what are the commonds included
67. Difference between DDL and DML
68. Difference between hibernate and Mysql
69. How to configure hibernate
70. All spring boot annotations
71. Difference between JPA and Hibernate
72. Why hibernate over JDBC
73. How to handle exceptions in hibernate and spring boot
74. How to do itext pdf configuration
75. Exception handling
76. Final, Finally and Finalise
77. Static and default methods
78. pillars of java
79. method overloading and overriding, code snippet on that
80. how to make a class immutable
81. why string is immutable
82. difference between equals and ==
83. difference between comparator and comparable
84. how to make a string mutable form immutable
85. Explain session factory
86. Configuration code for hibernate
87. Type and class casting code snippet
88. Programs on try catch finally
89.What is dependency injection and how many ways we do
that
90. Hibernate mapping
91. How to achieve many to many mapping in spring boot
92. What is JPA
93. JSTL and in built objects in JSTL

5. HIBERNATE->

A. What is ORM ?
B. Hibernate Vs JDBC.
C. Session and SessionFactory in hibernate.
D. Lazy Loading in hibernate.
E. Caching in hibernate (Indepth).
F. How to create immutable class in hibernate.
G. Hibernate Architecture.
H. IOC Container.
I. get() Vs load().
NOTE-> (All the annotations of SPRING BOOT and
HIBERNATE arevery important with their usage).

6. OTHER QUESTIONS ->

A. Is it possible to change default port number.


B. Microservices And Webservices (All the questions which
is providedby Sir).
C. How to integrate email API in project.
D. Which all API’S you used in your project.
E. Why would you prefer STS on other applications.

NOTE-> (Project explanation is very important).


51.
CORE JAVA INTERVIEW QUESTIONS

1) Explain the main method of the class ? ( psvm() )


2) Explain System.out.println(); ?
3) Difference between Static , Non – static , Local variables ?
4) Difference between JDK and JRE ?
5) What is var type ?
6) Explain about Constructors ?
7) Explain about Constructor overloading , Constructor
chaining , Default Constructor ?

8) What is this keyword ?


9) What is super keyword ?
10)Explain about OOPS concept ? (Inheritance ,
Polymorphism ,Abstraction , Encapsulation )
11) Explain about Type casting and Class casting ?
12) What is run - time polymorphism ?
13) Explain about Interfaces ?
14) Explain all access specifiers ? ( public , private , protected ,
default )
15) What is final keyword ?
16)Explain new features of Java 8 ?( default , functional
interfaces ,lambda expressions , stream API ) ?
17) Explain about abstract class ?
18) Difference between Interfaces and abstract class ?
19) Explain about Exceptions ?
20) What is Exception propagation
21) Explain about multi catch ?
22) Explain about Serialization and de-Serialization ?
23) What is Transient keyword ?
24) Explain about mutable and immutable ?
25) Why String is immutable ?
26) How to create immutable class ?
27) Explain about String constant pool ?
28) Difference between String , String Buffer , String Builder ?
29) Difference between == and .equals() method ?
30) Difference between continue and break statements ?
31) What is ternary operator ?
32) Difference between Array and vector ?
33) Explain about increment and decrement operators ?
34) What are Threads ?
35) How many ways we can create threads ?
36) What are runnable interfaces and callable interfaces
37) What is Synchronization , advantages and disadvantages
38) Explain Thread priority ?
39) Explain thread schedular (wait , notify , notify all , sleep )
40) Explain the Thread life cycle ?
41) What is Thread pool , join thread , detach
42) What are Enum , Wrapper , optional , local , anonymous ?
43) What are inner classes and singleton classes ?
44) Explain about final , finally , finalize ?
45) Difference between throws and throw keyword ?
46) What are regular expressions in java ?
47) What is tokenizer ?
48) What is cloning ?
49) What is hash code ?
50) What is JDBC ?
51) What is main principle of SQL ?
52) Explain about Collections ?
53) Difference between Array list and Linked list , vectors
54) How to find the length of the list ( .size() )
55) Explain about hash table ?
56) What is hashing technique ?
57) What is collision ?
58) Explain about Set interface ?
59) Difference between List and Set ?
60) Difference between hash set and Tree set ?
61) Difference between hash map and concurrent hash map
?
62) Difference between hash set , hash map , hash table ?
63) What is the common collection concept used in spring boot

64) Difference between Iterator and List Iterator ?


65) Difference between Comparator and Comparable ?
66) What are the new versions of JDK ?
67) How you implement rest full in project
68) What are execute services ?
69) What is dynamic binding and static binding ?
70) Write 2 -d array syntax ?
71) Explain about spring , spring bean , Spring bean scope ?
72) Code snippet for string object ?
73) Actuators ?
74) Stators in spring boot ?
75) Design patterns : Singleton , prototype
76) Java bi predicate
77) API flow , Rest API
78) JBOSS architecture
79) Stream methods
80) Copy constructor
81) Types of constructor
82) Executor service
83) Call procedure from .java
84) J unit
85) Login framework
86) SOAP vs REST
87) Expose and consume of web services
88) Hibernate JPA vs JPA repository
89) Prepared statements vs statements
90) JDBC template
91) What is SDLC ?
92) What are present in object class ?
93) Spring security
94) Email API
95) Parallel stream
96) Types of design pattern ?
97) How to optimize code ?
98) What actuator in spring ?
99) Bean factory and application context ?
100) How to exclude in spring boot ?
101) Types of inheritance in hibernate ?
102) Types of bean scope
103) Types of Auto wiring

104) Key components of spring boot


105) Drop vs truncate
106) Modes of auto wired
107) Spring security
108) Spring IOC
109) Streams in java
110) Aggregation composition
111) Fail fast , fail safe
112) @component
113) What is server validation and Clint validation
114) What is SAM interface ?
115) Difference between var and let in JavaScript ?
116) HTTP methods in spring boot ?
117) Agile methodology ?
118) Difference between monolithic architecture and micro
service ?
119) OAUTH2, pact tool ?
120) Semantic monitory
121) Clint certificate
122) What you will do if micro service fail ?
123) Hibernate architecture
124) Spring initializer
125) Spring security
126) Difference between bean factory and application context
127) Different springBoot scopes
128) Different hibernate objects
129) Difference between mapping and configuration classes in
hibernate ?
130) Load balancing
131) Circuit breaker
132) Jeera
133) GIT HUB repository
134) Front controller
135) @qualifier , @path variable
136) Count number of objects in java ?
137) Functional interface sub methods and types
138) How will you pass xml in application Properties ?
139) What is postman ?
140) Repository layer and how it will work ?
141) Where we store java code ?
142) Jenkins
143) Difference between session and session factory ?
144) Replace and replace all methods ?
145) How to read application properties file ?
146) Trust full API ?
147) How to copy one hash map to other ?
148) Address of last data in linked list ?
149) Which control used in project ?
150) What is DDL , DML
151) Difference between Web server and Application server
152) How to test Web service in postman ?
153) Can multiple finally blocks execute ?
154) How to connect two tables
in spring ?155)
ADVANCE JAVA QUESTIONS
156) Explain the life cycle of Servlet , JSP ?
157) What is servlet , jsp , html pages ?
158) What is Inter Servlet connectivity ? ( ISC )
159) What are session variables ?
160) Explain about JSP tags ?
161) Explain about MVC architecture ?
162) Write a logic for JDBS connection ?
163) Explain about CSS and Java Script ?
164) Explain about JSTL tags ?
165) Different types of creating Sessions ?
166) Explain about request dispatcher ?
167) Write SQL queries ?
168) What are data types of SQL ?
169) What are constrains ?
170) Explain about joins ?
171) Difference between application server and Web server ?
172) Explain about J unit ?
173) How to create Spring boot project ? ( maven )
174) Explain about application. Properties , repository layer ,
Controller ,view , service layers ?
175) Explain about Entity classes ? ( JPA , POJO )
176) What are the annotations used in springBoot . Explain each
?
177) Explain about Session factory and logic to implement it in
project ?
178) Explain about Hibernate and advantages over JDBC ?
179) Explain about hibernate configuration and components of
its object ?
180) Explain the steps to develop a web application using
hibernate?
181) What are core interfaces of hibernate ?
182) What are the advantages of ORM over JDBC ?
183) Explain about spring ?
184) Difference between spring and spring boot ?
185) Explain about spring bean ?
186) Explain about web services ?
187) Difference between REST and SOAP ?
188) Why we use xml files over JSON ?
189) Explain about micro services ?
190) Explain about POSTMAN ?
191) What are the errors in postman . Explain about each ?
192) Explain the methods of hibernate ?
193) Explain HTTP methods ? ( get , put , patch , delete , post )
194) What are hibernate annotations . Explain each ?
195) Difference between hibernate with annotations and
hbm.xml files ?
196) Explain about Agile completely ?
197) What is dispatcher servlet , how it works ?
198) How will generate pdf in all the view ?
199) View resolver , Jack Son
200) How will you redirect to view ?
201) What are object states in hibernate ?
202) Explain dilate hibernate properties ?
203) Explain about level 1 , level 2 cache ?
204) Explain about Session tracking system ?
205) Difference between save and persist method in hibernate ?
206) What are @primary and @qualifier annotations ?
207) How to monitor more than one micro services ?
208) What are roll back and commit ?
209) How to handle exceptions in spring boot ?
210) How to authenticate application ?
211) @springBoot @cross origin @bean
212) Features of html and CSS ?
213) Difference between do get , do post ?
214) Types of dependency injection ?
215) @Component , @controller
216) @mapping annotations , @qualifier , @primary ,
@response body
217) Life cycle of spring bean ?
218) What is API ?
219) How expose and consume are done in applications ?

1. Entity class

2. ORM

3. Collection

4. How to store a student object into collection

5.How to retrieve a record from the student objects based on


your name

6. Class Object

7. Instance variables

8. What you used to do in my company MauriTech


1. Java 8 features

2. Sql join queries

3. Jpa v/s hibernate

4. Swap 2 strings without using any third variable

5. Primary key v/s unique key

1. Java 8 features

2. Sql join queries

3. Jpa v/s hibernate

4. Swap 2 strings without using any third variable

5. Primary key v/s unique key

6. Optional class

7. Qualifier annotations

8. Exception in microservices

9. Custom exception

10. Session factory

11. How to do mapping in spring boot

12. Microservices

Zafin

1. Entity class
2. ORM

3. Collection

4. How to store a student object into collection

5.How to retrieve a record from the student objects based on


your name

6. Class Object

7. Instance variables

8. What you used to do in my company

9. What is web application

10. What is enterprises application Virtusa

01. Introduce yourself

02. Write code to read excel file

03. How does data driven work... Write code for same

04. Describe your project

05. How to handle dynamic xpath

06. Different types of waits

07. Explain them

08. Write explicit and implicit wait


09. Types of expected conditions in explicit wait

10. What is http


11. What is frame ..
12. How to switch to a particular frame.

13. How to handle frames


Polus software Location: Trivandrum, Kerala Position: Automation
Engineer

Questions

1. Introduce yourself

2. Keyword driven and Data driven framework

3. STLC

4. Interesting bug you encountered in your project

5. What is selenium

6. Can you automate captcha

7. How to locate an element in a page

8. Difference between assert and verify

9. Difference between verify and soft assert

10. How to upload a file

11. What's junit

12. Annotations of junit

13. What is xpath

14. Types of waits

15. Black box and white box testing

16. Have you ever been criticised before.. how to deal with it
17. Encountered any conflicts with colleagues?

Hcl Core java Basics ... Interface collection iterable constructor


access specifiers oops concepts overloading overriding

Collection

How to remove duplicate from arraylist


Newgen
Diffrents between

Overloadingand

Overriding 2.New

feature of java 8.

3.Diffrerence between

Spring and spring boot

4.Constructor

overloading method

overloading

5.Encapsulation.

6.Difference between Left

outer join and Right outer join.

IDC

6. SQL queries for insert,

update, delete, Truncate.


MDP

1. WAP How we

perform web

services

2.Introduced

your project .
CGI ( I,II) 1 Rounds
1. Can we compile code without main.
2. Which block execute before main
3. If we have SIB and IIB

and Constructor which is run

4. first. 4.Inner classes ?

Benefits .

2 Round
Explain OOPS concepts with where your using in your project.
1. Differences between Array and Array List.
2. Differences between Array list and vector.
3. New Features of java 8
4. Explain program of palindrome number.
5. Overloading and Overriding
6. Why string is immutable.
7. Difference between spring and spring boot.
8. Explain spring MVC .
9. Annotations Controller, Rest Controller, Component,
Configuration, Qualifier, Query.
10. Explain how we calculate second max salary
11. Explain JPA hibernate.
12. How we create own query in spring boot.
13. @Eureka Spring security.

HCL

1. Explain OOPS concepts


2. 2.Hibernate JPA
3. Key value of Hibernate.
4. spring and spring boot
5. New features of java 8
6. 6.explain project.
7. Array list and Link list
8. 8.Controller and Rest Controller.
2nd Round Introduce yourself, Explain List Overloading and
Overriding Spring Security Decimation (almost 1 hour) 1st
Round WAP sort WAP palindrome number WAP

10101, 01010,10101

the
01010, 10101 All repeated questions.
2nd Round
1. All OOPS concepts with code
2. And sql queries
3. Project explanation
4. Joins
Vertusa

1) oops
2) most of core java(out of 45 qstns gvn by sir)

3) advance Java ( project related qstns, some basic


annotations, spring cloud,spring security)

4) some company related qstns


5) agile methodology

Programs

1) adding values and reading from arraylist

2) Fibonacci series Sasken Technology & first connect.


1st round:

oops full

1) program on arraylist and treeset


2) serialization deserialization
3) String vs stringbuilder vs string buffer
2nd round:

1) project MVC flow


2) annotation
3) micro service implementation

Hr round:

1) about company roles


2) about documents
and joining dateL&T

1) only core Java in first round ( out of 45 only)


2) project and annotations in second round (out of 15 only)
3) HR round about pf slary slip etc.
: Terralogic

1) oops full concepts


2) example for inheritance
3) Fibonacci

4) palindrome on integer

2nd round:

1) about project based on MVC

2) annotations
1) documents

2) date of
Verizon

1st round

1) data structers and algo


2) oops
3) thread life cycle
4) servlet life cycle

5) serialisation and deser....

6) Java 8 new features


7) implement lambda program with int as method argument
8) qstns on project
9) how to run java without compiler

2nd round

1) all annotations
2) project related qstns related to repository layer custom query

3) web services and micro services


4) core java oops and thread life cycle
5) program to reverse string
6) how you run hello world without compiler

Hr round

1) about past organization

2) documents and bank related query


3) joining date and location

1) oops
2) overriding overloading program

3) reverse string program

4) pallindrome program
5) file reader and file writer program
6) serialisation program
7) tree set program

2nd Round

1) told to implement MVC and write a simple webapp in sts to


take 2 values and compare if they are same if they are same
add to database and implement web services to expose the
same value.

3rd round
1) documents
2) about address and doj :
Fulcrum (ikrux)Told to write query, Then about spring bootProject
Explaining Core Java

- enumeration

-collection

-hash map working

-oops

- java 8
- optional class
- functional interface
- logic of pgm ( reversing a string )
- Spring boot
-@ autowired

-Starters

-Actuators

-Dependency injection

-Definition of microservices

Difference between string string buffer string builder

Comparators
Collection (array list, linked list,
hash set)Collision

Serialization

Where do we use

serialization?
Polimorphism

Replace and replace all()

Finding duplicate elements in

a list How to read application


properties file Auto

configuration in spring boot

@controllers and

@restcontrollers Spring boot

advantages

Xoriant

(X-a)(x-b)(x-c) ...... (x-z)=?

How to remove duplicate records

Deadlock
What are the Memories available
Architec

Exception and handling

exception. Design patterns

in project Database

constant pool

cognizant
1. explain about your project
2. how, you implement microservices
in your project 3.How to implement
your webservices
4.Java 8 new features ( this features u used in
your project) 5.Which collection concepts u used
in your project?
9.spring MVC
10 spring boot Annotations.
All annotations 11.oops
concept
12.some other questions base
on projects 13.Diffrence
between array list and link list
14. WAP Array list program
15. difference between list and set
16. Microservices features

HCL
1.Write a query to sort the element in ascending
order2.Difference between static and non-static

3. Explain all types of joins in SQL with example(query)


4. Explain exception and what is mean by custom exception in
java

5. difference between array list and link list


6.Difference between comparable and
comparator
7. opps concepts in java
8. explain spring boot
9. spring mvc

2 nd round
1 Java is the functional programming language or
object-orientedlanguage

1. HTTP methods (explain all HTTP Methods in


webservices)3 explain REST API in detail
4. explain postman tool how u test your web services using
postman
5. micro services features
6. spring boot database connection in detail
7. what is mean by URL, URI, URN explain all and also

difference betweenthem
8. How u used web service in your project implementation
of web servicesin spring boot implementation micro
services in your project

9. some project related question


10. explain collection concept used
in your project12.Hibernate protocol

TCS
1. What is spring pool
2. Diff bit spring and spring boot
3. Diff but @rest controller and @controller
4. What is @rest controller
7. Diff .equals and =
9. What is thread class
10. Did you use any design patterns?
11. Explain single turn design pattern
12. Diff bit string buffer and string builder
13. Why string is immutable

14 diff bet delete and trunclet


15.which is faster inner join
or join in sql 16.How to
develop REST API
17.Diff bit hash code and hash table
18 @enable annotation what is the use of this
annotation19 @entity annotation
20. What is @componet

21. Why we create controller what is the

use of controllerJRK Infotech:


1. Order by query and 2,3 queries
2. create employee table
3. create two table using join
4. What is day to day activity
5. scum and agile
process in detail
6.Explain Business logic
of your project
7.What are the modules u used
in your project 8.diff bet
overriding overloading
What is inner classes in java
What is multitasking where did you used this in
your projectImplementation of web services
Diff bet web
services and
API What is
API explain
Rest API
@Request body
@RESTCONTROLLER where
did you used Write your
project code
Where you store
your project What
is mpls
What is mean by Jira ticket how to generate that

Umlaut Accenture

1. why u leaving your current job


2. group by query and some
order by query How to add in
column in existent table
Diff bet
delete and
drop How
to update
the fat
WAP to print emp id name salary
input and output Diff Left join and
right
yml files in spring explain deployment
of project explains what is @ rest
controller
how to create URL how to interact hibernate with spring boot in
your projectdiff bet JDBC n Hibernate Tech-1 (Chennai)
1. Explain OOPs concept.

2. Exception Handling in java

3. Exception Handling in java

4. Write a java program to check two strings


anagram or not.

5. Java Program to scope two number with


ought using third variable.

6. Write SQL Query to find Second maximum


salary in given table.

7. Join in SQL

Tech-2 (Chennai)

1. Explain your project

2. What is @ component in spring boot.


3. Spring boot application

4. How you implement email sending services


in your project.

5. How to generate PDF file.

6. What architecture you follow in your


project.

7. What is springboot advantages over


spring.

Tech – 1 (Noida)

1. What are OOPs concept.

2. Difference between string buffer and


string builder.

3. Why java does not support multiple


inheritance.

4. Difference between hashtable and


hashmap

5. Stream API.

6. Concurrent hashmap

7. Joins in SQL

8. Java program to print alternate number


from an array.

9. Why string is immutable?

10.Method overloading and method


overruding

11. Exception handling in java

12. Difference between notify and notify all.


13. Throw and throws keyword.

14.Difference between final, finally and


finalize.

15.Why we create in complete method in


abstract class and interface.

16. How we create thread in java

17.Thread life cycle.

Tech-2 (Noida)

1. Explain your rules and responsibilities in


current company.

2. Where you used ooPs concept in your


project.

3. What is MVC routing.

4. What is difference between @ controller


and @ rest controller

5. What @ query does.

6. How you perform debugging in spring


boot.

7. Work flow of project (mention in Resume)

8. How email API works.

9. What is spring IOC

10. What is Hibernate.

POLYMORPHISM
OVERRIDING AND

OVERLOADINGTYPE CASTING
UPCASTING

DOWNCASTING

ABSTRACTION

ENCAPSULATIO

N LAMBDA

EXPRESSION

SAM

INTERFACE

HASHMAP

ARRAYLIST AND LINKEDLIST

TRANSIENT KEYWORD

SYNCHRONIZATION

ORM TOOL

PRIMARY KEY AND FOREIGN KEY

COGNIZANT INTERVIEW

1. JAVA VERSION
2. WHAT ARE THE EXCEPTION BLOCKS

3. STRING IS CLASS OR IMMUTABLE CLASS


4 STRINGBUFFER AND STRING BUILDER HAVE U USED AND
WHERE

5. WHAT IS ENCAPSULATION ?HOW DO U USE IT

6. WHAT ARE THE JAVA CONCEPTS U USED IN UR


PROJECT
7 WRITE JDBC CODE

8. PREPARED STATEMENTS

9. SINGLETON PATTERN

10 WHAT IS PRIMARY KEY CAN WE CREATE TABLE


WITHOUT IT

11 WHAT IS JOINS WHAT ARE THE JOINS AND WHAT IS


RIGHT JOIN.

HOW DO U ACCESS COMMON DATA FROM TABLES

12.BRIEF PROJECT

13 WHAT ARE THE ANNOTATION USED IN SPRING BOOT


14@AUTOWIRED WHAT IS IT
@REQUEST MAPPING

15. WHAT ARE THE METHOD ANNOTATION U USED IT

16. WHY USE SPRING BOOT AND WHY XML FILE OVERJSON

17. WHAT ARE THE HIBERNATE ANNOTAION U SED IN UR


PROJECT

3.Explaing Upcasting and

Downcasting with

example. 4.Java 8

features.

5. Write a program of
validating mobile number?

6. Explain Internal

Working of Hashtable and

HashMap? 7.Why do we

use Default method in

Interface?

8. Monolithic and MicroServices Differences.

9. Explaing String Constant Pool

Concept and logical question on that

topic. 10.How thread can be created?

11.Difference

between ArrayList

and LinkedList.

12.Arraylist

Implementation?

13. Why String is immutable?

14. Write a program to display

runtime and compile time

polymorphism. 15.Explain doubly

linkedlist Structure?

19.what is
difference between

== and Equals().

20.Exception

hierarchy.

21. What is anonymous class?

22. What is difference

between == and === in

javascript? 23.Why pointers

are not used in java?

Some Questions Scenario Based Questions.

1. There are two arrays on consist arrival time and another


leaving time. Write a program in which no trains collide with
each other and find the minimum number of platform.

2. An array consist of positive and negative integers and find


out the square of each number in the array and sort them in
ascending order.

3.Write a program in which input is given as mobile number


and according to the number print the letter.

19) Difference between @before and @beforeClass?


4. Write

program to

reverse the
string?

5.Explain

Hibernate

Internal

working.

6.Program on

Upcasting and

Downcasting.

7.Remove

duplicate

elements from

Array. 8.Stream

API

programmes.

Some Questions On Project

1.What are the

scopes of Bean in

Spring Boot?

2.What is singleton

design ?
3.What are the ways of

auto-wiring in spring

boot? 4.How does

execution started in

Spring Boot?

5.How did you develop

end points in your

project? 6.How did you

use OOPS concept in

your project?

7.how can we forcefully stop

the execution of finally block?

8.What is HTTP servlet?

9. What are

executor

service?

10. Different

types of Web

Services?

11. Difference

between REST
and SOAP?

12. Junit testing Annotations that you used in your project?

13. Application Server and Static Server?

14. Why do we use Request Dispatcher?

Question Asked from Core Java.

3.Explaing Upcasting and

Downcasting with

example. 4.Java 8

features.

5.Write a program of

validating mobile number?

6.Explain Internal Working

of Hashtable and

HashMap? 7.Why do we

use Default method in

Interface?

10. Monolithic and MicroServices Differences.

11. Explaing String Constant Pool

Concept and logical question on that

topic. 10.How thread can be created?

11.Difference
between ArrayList

and LinkedList.

12.Arraylist

Implementation?

15. Why String is immutable?

16. Write a program to display

runtime and compile time

polymorphism. 15.Explain doubly

linkedlist Structure?

16. what is

SQL

Normalizatio

n?

17. explain

joins in

sql?Types of

joins.

18. Foreign

and Primary

Key?

19. what is
difference between

== and Equals().

20.Exception

hierarchy.

23. What is anonymous class?

24. What is difference

between == and === in

javascript?

25. 23.Why pointers are

not used in java?

Some Questions Scenario Based Questions.


5. There are two arrays on consist arrival time and another
leaving time. Write a program in which no trains collide with
each other and find the minimum number of platform.

6. An array consist of positive and negative integers and find


out the square of each number in the array and sort them in
ascending order.

7.Write a program in which input is given as mobile number


and according to the number print the letter.

3-C……

8. Write a

program to

reverse the
string?

5.Explain

Hibernate

Internal

working.

6.Program on

Upcasting and

Downcasting.

7.Remove

duplicate

elements from

Array. 8.Stream

API

programmes.

Some Questions On Project

1.What are the

scopes of Bean in

Spring Boot?

2.What is singleton

design ?

3.What are the ways of


auto-wiring in spring

boot? 4.How does

execution started in

Spring Boot?

5.How did you develop

end points in your

project? 6.How did you

use OOPS concept in

your project?

7.how can we forcefully stop

the execution of finally block?

8.What is HTTP servlet?

9. What are

executor

service?

10. Different

types of Web

Services?

11. Difference

between REST

and SOAP?
Vareli

Introduce yourself

What is the major

achievement in your

project Static method

can override or not

What is abstraction

Give me a real life example

Give some

code and asked

the output

Sting buffer vs

string builder

Why string

buffer is

thread

safe? What

is thread

Give some code and asked me the

output about immutable string Which

modules are created Which forms


are created Etc forgot it

Cognizant interview questions:

Difference btw

array list and

hash map Spring

boot annotation

Primary annotation
Collection

and

collectios

String

buffer

and string

builder

Vector

Difference between

string and string

buffer How to read

the string as a

character

15. Junit testing Annotations that you used in your project?


16. Application Server and Static Server?

17. Why do we use Request Dispatcher?

18. S

19. Interview Questions


20.
21. Java 8 features

22. Spring boot


annotations Spring
MVC

23. Real time example of oops concepts


Identityandaccess

1) oops concept

2) threads

3) java 8 new features

4) encapsulation program

5) Webservice implementation in project

6) microservice integration in project

7) collections hierarchy

8) exception types

12) inner join query

Cognizant
*Which version of java u used in ur project.

*Java 8 features.

*@Function interface sub methods or types.

*Lambdas expression syntax.

*Streams of java.

*Application.properties configuration and *how u ll pass XML in


application.properties.

*What is postman.

*Primitive and objects data types difference.

*Repository layer how it ll work.

*SQL querie based on Max function

*Array list nd set difference.


*String concept based questions like how to get only integer
from mixed string.

*How did u implement Webservice in your project.

*List based questions like how to get greater than 50 marks


from student list .

*How to connect with JDBC.

Xoriant

1) Java 8 features

2) Static and instance variable difference


3) Difference

between list

and set

4) Hash map

working

5) What is Immutable class and how to create it

6) what's multi

threading and how to

create it 7)ways of

reverse a string

program

8)

wt's

micr

oser

vice

and

web

seri

es

and
how

u ll

impl

eme

nt

in

ur

proj

ect

12)

wts

vie

fro

SQL

13) max,count query

14) excepti

on

handling in

java
15) oops

concepts

16) some basic program on static and non static variable

17) difference between

== and equals() method

18)some basic program

on string

19) spring boot and microservice difference

20) how u created project like we have to explain flow of project

21) interface and

abstract

difference

22)final and

immutable

classes in java

23) stream api

24) inner nd left join difference

25) runnable interface based program

(like find output of program) TCS

1) Webservice and microservice implementation in ur project?


2) whatsapp is hibernate nd how u implemented in ur project?

3) what is

JSP and jsp

lifecycle?

4)what all

Junit

methods?

5) what's is postman?

6) what all servers u used in ur project?

7) security methods in springboot?

8) Why spring oot?

9) what is DDL and DML?

10) innerjoin and sunquery question?

11) 11)throws & trow? exception handling in java ?

12) finally block? \

13) java 8 new Features?

14) oops concept? public static void main() meaning?

15) static and void related questions?

16) what is constructor?


17) try,catch related some questions.

18) can we handel exception using try catch blocks in throws


methods?

20) *CORE JAVA*

21) What are the loops and purpose of


loops?Is if else comes under loops?

22) Types of access modifiers explain

23) What is if else statement and how to use Equals and


24) == in if else statement with
examplesWhy String is immutable in
java.
25) Which class is immutable other than string?
How can we create immutable class?
26) What is singleton class and how can we create
singleton class in java with example?

27) String buffer vs string Builder vs string with


examples

28) What is string pool stack and heap memory concept.? How
many object will be created with new keyword?
29) With different scenarios

30) What is Static in java how to call static method andcan


we use static with class? If not why

31) Why we use static keyword?

32) What is String why there is concept of String?


33) Oops concept in details with real time and with
project examples.

34) Overriding vs overloading.

35) Does overloading happens in compile time or


Runtime.?

36) Can we change the whole method variables of


interface by overriding? Explain why and what will
happen?

37) Why java doesn't support multiple Inheritance?


Explain with examples

38) Why we need abstract class if we have interface.

39) Where to use abstract class and where to use


interface.
40) Why we need constructor in abstract class.

41) Can we override static method What will happen ifwe try
to override static method.

42) Can we override private method what will happen if we


try to do so.

43) Can we override overloaded method? How with


example?

44) Can we override final method if we can or cannotwhy

45) Can we use final keyword with class name. What isthe
real time use of final keyword. Where you haveused it in
your project.

46) Why we use getters and setters method? How


you achieve Abstraction in your project?What is
runtime polymorphism?
47) How to achieve
Inheritance? Why not
only getters?
48) Difference between final finally finalize with real time
examples.
49) Can we make constructor Private? Why not or why if we
can?

50) What is System.out.println explain.

51) What is public static void main (String [] args) { Can


we create object in object class? If yes/no why Ways to
create object in java.

52) Explain object life cycle.


53) *collection*

54) Difference between collection and collections? Explain


collection in details?

55) Which collection class is synchronized?

56) Is array static or dynamic? If static what we use for


dynamic? And how much size will be increased if array
have no space left and you will use array list?

57) Difference between array list and linkedlist?

58) What we use for manipulation of data and what weuse


for retrieving of data in collection?
59) Difference between hashmap and hashtable?
Difference between hashset and hashmap?
60) Methods to sort collection? How to reverse list
in collection?Internal working of hashmap?

61) If hashmap is not thread safe then if multiple


threads are invoking then what will happen?

62) How to do iteration in collection?

63) Difference between iterator, enumerator and listiterator?

64) What we use for bidirectional iteration?

65) Difference between synchronized hashmap and


concurrent hashmap?

66) What is concurrent modification exception how tohandle it?

67) What is fail safe and fail fast?

68) Why we use put method instead of add in hashmap?Why


hashmap is not a part of collection?

69) Difference between collection and hashmap?


Why linkedlist implements both queue and list?
70) Why hashmap doesn't follow insertion order if it puts entries
as linked list in the node of bucket or index?

71) Comparator vs comparable? When to use it?

*Thread*

72) What is difference between thread


andmultithreading?

73) What is difference between process and threading? Ways to


create thread class?
74) Which one is better and why?
75) Difference between join and sleep method?How
to give priority to the thread?
76) Explain wait notify and notify all? Why they are
present?

77) What is object lock vs class lock?

78) What will happen when calling thread.run() instead of


thread.start()

79) Can we call run method before start method?


Why we need to overide run method?

80) What is synchronized keyword?

81) What is deadlock and how to avoid it?

82) What is thread safe? Benefits of thread safe.

83) *JAVA 8 FEATURES*

84) What java 8 features you know?

85) Explain functional interface with example?


Where to use lambdas expressions?

86) What methods we use in functional interface


otherthan runnable and callable?
87) What is stream api? Why ae use stream api for
collection?

88) Methods for stream api with basic coding sortingetc.

89) Difference between filter and map


What is date time api with
examples?

90) *EXCEPTION AND EXCEPTION HANDLING*

91) Difference between exception and errors.


Types of exception?
92) Types of checked and unchecked exception?
Explain exception hierarchy?
93) Ways to handle exception in
java? Explain try catch and
finally?
94) Can we use multiple catch and finally block with and
without try block?

95) Difference between throw and throws.

96) How you used to handle exception in Spring boot?


97) How to create your own customized exception?

98) Why there is concept of compile time exception if exception


shows at runtime?

99) Why throwable is class not interface?

100) What types of exception you got in project and how you
handled it?

101) *JUNIT*

102) How you performed unit


testing? What you used for
unit testing?
103) Annotations for Junit?

104) How to test controller class with junit?


Which annotations to call first using junit.

ADVANCED JAVA

105) *jsp- Servlets*

106) Difference between jsp and


Servlets? How to configure database
with JDBC What is request
dispatcher?

107) Jsp life cycle? Servlets lifecycle?


What is Servlets? What is MVC
pattern?

108) What are the tags in jsp? Explain it.

109) *Spring Boot*

110) Why Spring Boot?All annotations :-


111) Component, controller, repository,
service, requestParam, modelAttribute,
SpringBoot Application, @Autowired etc.
112) Start point of spring boot application
113) Controller vs Rest Controller Request mapping vs get
mappingSpring vs spring boot Advantages of Spring boot
114) What is spring mvc?
115) How to handle exception in Spring
bootDependency injection

116) Types of dependency injection Types


of scope

117) Spring AOC Spring container


Pom.xml

118) What is profiling in Spring boot?


How to set profiles in Spring boot?
Spring actuator?

119) What is DAO class?

120) How to do debugging in Spring boot?


What are breakpoints and watch points?

121) What is spring security?

122) Difference between authentication and authorization?

123) *Hibernate*

124) Why hibernate over jdbc?Jpa vs hibernate


125) Orm vs jpa
126) Annotations of hibernate?What is entity class?
127) Session Session factoryTransaction
128) Session management
129) Get vs load
130) Save vs saveorupdate Lazy vs eager loading Many to one,
one to manyN+1 problem
131) Hibernate life cycle

132) If we need mobileNo. validating only 9,10,11 digits?How will


you do? Which annotations to use?

133) How to config hibernate with database?

134) *Microservices and web services*

135) What is Rest

136) Rest api vs Restful web servicesRest Controller

137) How to expose Restful web services How to consume


Restful web services

138) Methods to consume Restful web servicesWhat are the http


methods explain Difference between get and post

139) Diff between do get and do postDiff between post and put

140) Diff between put and patchWhat is json

141) Structure of jsonWhat is payload


142) What package Rest api come from?

143) Why Rest over Soap?Rest resources

144) Why microservices? Disadvantage of microservices Why


Restful web services Advantage of microservices
Disadvantages of microservices?What is file format

145) Why json?


146) When to use request mapping when to use getmapping

147) Suppose we have 4 microservices A, B, C and D andif C is


down or have some bugs how to tackle this situation?

148) *AGILE SCRUM METHODOLOGIES*

149) What is agile?

150) What is scrum methodology?

151) Why you chose agile instead of waterfall as waterfallis safe?

152) What are scrum ceremonies?

153) HAVE you attended scrum meetings? What you did?


Have you interacted with customers?

154) What user stories you worked on?What is story points?

155) Day to day work?Scrum master?

156) Who did Effort estimation?

157) What were the sprints in your project?

158) How much developers and testers were in yourproject?


159) Whom you used to report to?
160) How you used to get your assignments of
project?What were the backlogs in your project?
161) *SQL QUESTIONS*
162) DDL VS DML
163) Diff between primary, foreign and unique keys. What are
joins why we use joins and types of joins Diff between inner
and outer join
164) Diff between left and right join
165) How to increase query performance?Indexing in sql
166) What are the constraint
167) How to join different columns.? Triggers in sal
PreparedStatement in sal
168) How to select data in my sql
169) CRUD operation in mysql:- insert, delete, update, etc2nd Max
salary in sql ( Any max salary too)
170) *CODING*
171) FIBONCCI
172) Palindromeeven or odd
173) Sort using stream api, bubble sort, etc Create an abstract
class
174) Create an inner class Create a singleton class
175) Create a functional interface
176) Reverse String without using pre-defined methods or
functions

177) Get 1st non repetitive element in the given string Remove
duplicates from String and array
178) Sort the given string then find the mid element andprint the
sum of even numbers

179) Print all non repetitive


character Print vowels /
consonant
180) *ATLEAST LEARN HOW TO USE ABOUT FOR LOOPS IF
ELSE, COLLECTION METHODS, HOW TO CREATE THREAD
CLASS*
181) *PROJECT RELATED QUESTIONS*
182) Explain your project Explain your project flow
183) Roles and responsibilities in yout project Tools and
technologies used in your project?
184) Why chose microservices for your project?
185) What collections concept you used in your projectand where
with examples?
186) What java 8 features you used in your project and where
with examples?
187) What oops concept you used in your project?Have you used
thread in your project?
188) Have you used abstract class in your project?

189) Explain how implemented Restful web services and


microservices in your project?

190) Why used spring Mvc for your project?

191) Which tool you used for testing web services?


How you used to share your codes with others?How
you used to communicate with testers?
192) What exceptions you got in your project and how you
handled it?
193) Where you used hashmap in your project? What were your
project functionalities?
194) What bugs you got?
195) How you did email configuration in your project? How you
did pdf integration in your project?
196) What framework you used in your project?
197) *NOTE 1:-*

198) FOR SPRING SECURITY, Deployment, CI/CD, DOCKER,


CONVERTING JAR TO WAR OR WAR TO JAR,
AUTHENTICATION, HIGH LEVEL DEBUGGING
199) ANSWER IS:-

200) *MY SENIOR USED TO TAKE CARE OF IT*


201) *NOTE 2:-*
202) *IF YOU DON'T KNOW THE ANSWERS THEN TRICK
YOUR INTERVIEWER JUST DON'T SAY I DON'T KNOW*
203) *AND PLEASE DON'T TELL WRONG ANSWERS IF YOU
DON'T KNOW THE ANSWERS*
204) *NOTE 3:-*

205) *PREPARE TELL ME ABOUT YOURSELF AND PROJECT IN


WELL

206) ORGANIZED MANNER AND INYOUR WORDS*

INTERVIEW QUESTION

1) What is static, non-static/instance, local variables?


2) Difference between primitive and non-primitive data types?
3) What is Constructors and its types and need of constructor?
4) What is OOPS concept? Explain
5) What is SOLID principle with advantages?
6) Difference between JDK, JRE and JVM?
7) What is anonymous class?
8) What is Garbage collector and need of garbage collector in
java?
9) Explain Types of memory in java and explain each?
10) What are Class, Method and Object in java?
11) Difference between return and return value?
12) What is this keyword?
13) What are packages in java?
14) What is type casting and its type explain each?
15) What is interface and abstract class and when to use
interface and when to use abstract class with example?
16) What is abstract keyword?
17) What is run time polymorphism?
18) What are marker interface and its uses and need?
19) What are java 8 features explain each?
20) What are access modifier explain each?
21) Can we change the visibility of method while overriding?
If yes then what is condition in it?
22) What are Scanner class and its uses?
23) What is for loop?
24) Difference between While and Switch statement?
25) Difference between continue and break statement?
26) Explain main method in java?
27) What is System.out.println()? Explain
28)What is Array? And its type
29) What is Serialization with example?
30) What is Deserialization with example?
31) What is transient keyword?
32) What is volatile keyword?
33) What is final, finally and finalize in java?
34) What is var type?
35) What is string tokenizer?
36) Can we overload static method in java?
37) Can we override static method in java?

38) What is super most class in java?


39) What is data hiding and how to achieve?
40) What is Static block in java?
41) What is Non-Static block in java?
42) What is Super keyword in java?
43) Difference between This and Super keyword?
44) What are Exception in java and its type explain each?
45) How many ways to handle exception in java explain each?
46) Explain exception hierarchy?
47) Can we write finally without catch block?
48) Difference between throws and throw?
49) What is exception propagation?
50) Explain Checked and unchecked exception?
51) What are command line arguments?
52) What is thread?
53) What is Demon thread?
54) What is multithreads?
55) Difference between thread join and sleep method?
56) Process to create thread and which is best and why?
57) What is thread scheduler?
58) Explain about priority of thread?
59) Explain wait, notify and notify all?
60) What is thread pool?
61) What are executor services?
62) Difference between runnable and callable<T> interface?
63) Disadvantage of thread?
64) Explain thread life cycle?
65) What is Synchronization?
66) What is Synchronized keyword?
67) What is String in java and why String is Immutable in
java?
68) Difference between String, stringbuffer and stringbuilder?
69) What do you mean by mutable and immutable?
70) How to make a class immutable with example?
71) Why java is platform independent language?
72) Why java is not pure object oriented language?
73) Difference between .equals method and == operator in
java”?
74) Why pointers are not used in java?
75) What is singleton class and how we can make a class
singleton?
76) What is Collection framework?
77) What are wrapper classes?
78) What is tokenizer?
79) What is cloning?

80) What is hash code and equal method?


81) Why to override hashcode and equal method?
82) What is JDBC and write code of JDBC?
83) Difference between Collection and Collections?
84) Explain Collection hierarchy?
85) Explain List, Set and Queue?
86) Difference between ArrayList vs LinkedList and Vector?
87) Explain HashTable and HashMap?
88) Internal working of HashMap?
89) What is Collision and how to overcome this?
90) Difference between synchronized collection and
concurrent collection?
91) Difference between comparable and comparator?
92) Difference between Enumeration and Iterator?
93) What is Tenary operator with example?
94) What are unary operators and its example?
95) What are association and its type?
96) Difference between Iterator and ListIterator?
97) What is Fail fast and fail safe?
98) What is Servlet?
99) Difference between Doget and Dopost?
100) What is InterServlet Communication?
101) What is Request Dispatcher?
102) Difference between ServletConfig and ServletContext?
103) Explain Servlet Life cycle?
104) What are Session Variables and its type?
105) What is JSP? And its tag?
106) Explain JSP life cycle?
107) What is JSTL tag?
108) What are implicit object?
109) What is HTML and feature of HTML5?
110) Explain MVC architecture?
111) Difference between spring and SpringBoot?
112) What is Web Services and its type?
113) How to expose and consume web services?
114) Difference between SOAP and RESTFull web services?
115) What is POSTMAN?
116) What are Http methods explain each?
117) Difference between micro services and monolithic
applications?
118) What is Maven?
119) What is Spring Initilizer?
120) What is Unit testing?
121) What is Junit?

122) What is JPA?


123) What is Hibernate JPA?
124) What are Spring IOC and Its type?
125) What is spring security?
126) What are JPA annotations used in your project explain
each
127) What are spring boot annotation used in your project
explain each?
128) What is Dependency injection?
129) Types of Autowire and explain each?
130) Difference between @Controller and @RestController?
131) Difference between @Autowiring and @Bean?
132) What is @Qualifier and @Services and @Component and
@Value and @Query ?
133) Explain @SpringBootApplication?
134) Difference between BeanFactory and ApplicationContext?
135) Difference between JPA and Hibernate?
136) Explain advantage of Hibernate over JDBC?
137) What is Session in hibernate?
138) What are roll back and commit?
139) Session management in spring boot?
140) How to create session object?
141) Difference between session and sessionFactory?
142) Difference between get and load method of hibernate?
143) What is caching and hibernate and explain 1st level and
2nd level caching?
144) What are Core interface of hibernate?
145) What is Jenkins?
146) What is JERA?
147) How to read application.properties in any class?
148) What are response codes of POSTMAN?
200/201/204/400/401/403/404/405/500/503
149) Explain Session Tracking System
150) Explain types of spring bean scope?
151) What is Actuator in spring boot?
152) What is Starter tag in spring boot?
153) Types of hibernate mapping explain each?
154) Types of inheritance in hibernate?
155) Difference between Drop and Truncate?
156) Write SQL basic query?
157) Find 2nd max salary from employee table?
158) What is Primary key and foreign key?
159) What are joins in SQL explain each?
160) Explain SDLC model?
161) Explain about Agile methodology?

Interview Questions

1. Spring Security
2. Authorization vs Authentication
3. Polymorphism
4. Can we override private methods
5. What is the return type of Overloading method
6. Switch program like case 2 and case 3 execute with same
statement
7. Create a method which can pass n number of argument of
string
8. Http response status codes like 500, 503, 400, 202, etc.
9. Aggregation vs Composition
10. Is java pure object oriented?
11. Runtime polymorphism and compile time polymorphism
12. Singleton Design Pattern
13. get() vs load()
14. Why Hibernate
15. Hibernate cache
16. Many to Many example
17. LinkedList vs HashMap
18. Main difference between HashTable and HashMap
19. Sql queries - create table, write select query
20. Exception & How to handle it
21. List vs Map
22. Write a program for email validation
23. How to generate pdf
24. How to configure email sending services in your project
25. OOPS concept
26. Controller vs Rest Controller
27. What is the scope of spring bean
28. Singleton design pattern & it’s code
29. Dependency Injection
30. Fail-fast vs Fail-safe
31. ConcurrentModificationException
32. SQL Joins
33. Primary key
34. Foreign key
35. DDL & DML
36. Delete vs Truncate vs Drop

Spring Security

1. What is Authentication & Authorization.


2. Which all methods present in spring security.

Hibernate.

1. Why you are cesing hibernate instead of JDBC.


2. What in hyber & why in called ORM.
3. What in entity / POJO class why you regerired
4. D/f b/w cession & version factory.
5. D/f b/w JDBC & hibernate
6. What in hibernate mapping types.
7. Hibernate cache & its advantages.
8. Get () & load ().
9. D/f b/w 1st level cache & 2nd level cache
Monolithic & Micro services

1.Why your come for microservice instead of monolithic.


2.Explain microservice from the scratch.
3.How you will exposes the consume webservices.
4.Give me one practical eg now will lee the exceptions & how
to handle it.
Project

1. Explain your project & what your rules.


2. Business logic of the project & which domain your project
belongs to.
3. Explain project flow & which all modules you developed
4. D/f spring & springboot why you are using springboot
5. Bean life cycle/ actuator/spring initializes.

12.Where did you change the part No. (tell me that line of code)
13.Which is the starting point of your applications (explain flow)
14.Where did you used collection concept in your applications
15.D/f b/W JPA & CRUD repository.
16. Explain JSTL tags.
17. What in API & which API in used in your application.
18.D/f b/W controller & part controller.

Webservices.
1. Explain webservices & which all annotation in used & types
of webservices.
2. Explain the structure of J8on.
3. Explain postman & nttp methods & error code.

JSP & secrets Advance Java

1. What are serutes.


2. How you read the front and data in the backend in learvles.
3. How you configure JDBC connection (code write) explain.
4. Reguest dispatcher (ases) write code.
5. What are session variables write a code on it.
6. JSP & explain JSP tages, what is the cese JSP
7. JSP translator.
8. Implicit subject explain.
9. Explain MVC architecture.
10. Serve life cycle & JSP life cycle.
11. D/f b/w doget & dopost
12. Why you required Tomcat and version.

Spering boot

1. Version of STS & how you create a springboot project in


STS.
2. Explain maven & pom.xml file (maven repository)
3. Which unit testing tool is used & its annotations.
4. D/f b/w Eclipse & STP.
5. D/f b/w JPA & hibernate.
6. Entity, controller, application, prop repository, services,
(why we regvi)
7. Explain all springboot annotations.

8. How you read front end data in the backend (which all
ways & what annotation)
9. What all methods you used in services loyer in order to
perform CRUD operations.
10.Where did you implemented hibernate in you application&
which all loyers of hibernate & its annotations (version)
11. What in dependency injection & what are different ways.
12.Spring I oc & where did you used oops concept in your
applications.
13. What in rollback & commit.
14. Explain normalizations.
15. They are asking some questions on agile.
16. Logical questions.
1. Palindrome No/string
2. Prime No.
3. Reverse a string
4. No of words in a given string.
5. How to find a duplicate element in an array.
6. Short on array & find maximum & minimum Valarie’s in on
array.
7. Armstrong No. & Fibonacci services
8. Explain Eager loading & lazy loading.

SQL

1. What in database & why it in required.


2. Examples which your covered.
3. Print the enamel who in having more salary.
4. Built in functions
5. Give me the example of like keyword.
6. Primary, foreign, unigue key
7. Truncate, delete, drop
8. 2nd, 3rd max some times 10th max.
9. Sub quires & they ask to find some thing
10. Take your ex & write the query for joins (cgi) & explain joins.

1. What is overloading and overriding?


2. Difference between abstraction and incapsulation
3. Difference between abstract and interphase.
4. Why we use default method?
5. Compile time polymorphism and run time polymorphism.
6. Explain oops concept with real time example.
7. Where we use oops concept in project?
8. Explain final, finally and finalize
9. Difference between throw and throws.
10.What is exception handling?
11.Difference between error, and exception.
12.What is composition and aggregation.
13.What is file handling?
14.Difference between list and set.
15.Array list vs linkedlist
16.Internal working of hashmap.
17.Difference between stringbuffer and string builder.
18.Write a program to check given string pallindror or dot.
19.Write program on arraylist.
20.Static and non-static
21.Pattern programs.
22. Difference between comparator and comparable.
23. S difference between spring and springboot
24.What is dependancey injection?
25.Springboot and notations.
26. JPA notations.

Citius tech

1. Class not found vs no class deformed


2. How you filter
3. What is error
4. When you pass in the overheaded method of type object of
string what should it call.
5. What is lock interface.
6. What is database schema
7. Oops wish real time example.
8. Internal working of hashmap.
9. How to connect with database in hibernate
10. Get () vs load ()
11. Load
12. Multithread
13. How to make 2 threads
14. How to make 2 threads run one after another.
15. Lock interface.
16. How you consume webservice.
17. Print prime no det o to so
18. Find 3rd max salary without using sub query.
19. Types of class loader in JVM.
Capgemini

1. Java 8 features .
2. @functional interface.
3. Abstract class vs interface.
4. Singleton class
5. What is immutable class? Eg of immutable class in java.
6. String vs string buffer vs string builder
7. What is thread sole
8. Arraylist vs vector
9. How to make arraylist synchronized
10. Internal working of hashmap.
11. Spring vs springboot
12. How you connect with database in springboot
13. Default server of springboot
14. Can you change the server
15.Have you ever got the error like server port B already in
use? How you resolved it
16. What is hashset
17. What is monolith architecture

Kloud Partal

1. Advantages of springboot
2. What is constructor
3. Arraylist vs linkedlist
4. Hashtable vs concurrent hashmap
5. Depending management
6. What is maven? How you configured moven
7. @ request pardon & @ path variable
8. Overloading & overriding.
9. What is SQL & my SQL
10. What is “as” in SQL
11. JPA vs hibernate vs spring data JPA
12. What B d/w database of database table.
Cognizant

1. How can you change server no .


2. Do you, use file.
3. Spring actuators
4. Spring JPA @ table
5. @ entity, @ colomn, QId, (all scenario types)
6. d/w. @ Id vs @ column,
7. how you stare multiple data in hibernate.
8. Advantages of JDBC
9. How do you perform queries in hibernate
10. @ repository? Where did you used in project.
11. Commit of rollback? Used in project.
12. Server slates (200, 404, 500)
13. @ restcontroller
14. @ get yapping vs @ post mapping.
15. Get vs post
16. Disadvantages of get.
17. Why usl is not exposed in post.
18. @ Query param.
19. If these are two numbers in vrl how you will get that.
20. How you authenticate application.
21. How you deployed the project.
22. Dependency management.
23. How you manage the dependencies
24. Which serves you used to deploy (not tomcat)
25.Asked so many quest on deployment even the I told I am
not the part of deployment.
26. Disadvantages of micloservices
27. Monolith arch lure.
Virtisa (Ist round)

1. Singleton class ? write program for this.


2. In the given string covert the different characters.
3. What is concurrent hashmap?
4. How you configure hibernate.
5. What are different application servers.
6. Java 8 features.
7. What are intermediate & terminal in stream
8. Give a scenario where synchronized can used.
9. What is dependency injection of types to perform injection.
10. What is IOC
11. Using stack how you perform quench
12.In which scenario inread class or runnable info face is
suitable.
13. 2nd max salary in SQL.

Tech Square (wipro)

1. Advantages of oops
2. What is overriding & overloading
3. What is abstract class
4. Of there is a abstract class & the implementation of
abstract class so how to call the method.
5. Data boxing of data unboxing
6. What is arraylist
7. d/w arrcylist & likedlist.
8. How arraylist increase the size.
9. In which scenario we should use arraylist of linkedlist.
10. d/w set & list
11. d/w threeset & hashes
12. how the hashset internally works.
13. d/w “ = =” & “ equals”
14. d/w thread of process
15.which is should we prefers tread class or runnable
interface.
16. How thread will communicate with each other.
17. What is wait( ) of sleep ( )
18.Where this method are present? Why this method are in
object class.
19. If we are using h.start ( ) two times what will hoppen.
20. Which servers comes by default with SB.
21. How the change the part.
22. How year connecting with database.
23. How mapping happening in hibernate.
24. Gives me the ex of queries which years written in project.
25. One inner join question
26. What is group by & order by.
27. Scope of bean? Default scope
28. How to change the scope.
29. @auto configuration.
30. What type of security using in SB.

MERCEDESE. BENZ

1. What is need of static block.


2. What is initialize block
3. What is immutability means.
4. Why sting is immutable.
5. How to create the immutable class.
6. If you have any immutable reference in year class how
you handle .
7. What is functional interface.
8. d/w map () & flatmap () in stream
9. what is reduce () method
10. what is date APIS
11. what is optional class
12.how to call a default par static method of interface from
other class.
13. What is abstract method & how to call.
14. Internal walking of linked list.
15. Custom code of linkedlist.
16. Scope of bean.
17. @Enable auto configuration
18. @sringboot Application
19. Advantages of springboot
20. What is SB starter POM.
21. How to usc jetty instead of tomcat.
22. How to test webservices.
23. One API is Secure then how you test.
24. How to implement circuit breaker.
25. d/w monolith & microservices
26. what is eureka serves
27. security implementation d/w post & patch
28. d/w post & patch
29. what is idempotenary .
30. what is transient
31. what is serialization & how to implement.
32. d/w get( ) & load ( )
33. how to implement second level caching.
34. How the instances are created in hibernate.
35. How you handle the exception in SB
36. What is out wiring & its types.
37. @qualifies.
38. Embedded contains supparled by SB.
39.Without restarting the serves how to reflect the change in
SB.
40. How to write code far webservices.

Orate

1. Reverse the string – I/P:- sai o/P:- ias

2. I/P:- 123 O/p:- one hundred twenty three.


3. String str = “index”,
SOP (str. Charat (2): - o/p:-d

4. Integer a=5;
Integer b = 5;
If (a= b) £
S.O.P (true) ; - o/p:- true £ else £ S.O.P (false);

Collabra

1. Immutable concept & how to create it.


2. What is concurrent modification exception
3. What is fail fat & failsafe iterates
4. Reverse the string using recursion.
5. How you created springboot project
6. Types of mapping.
7. Checked exception & unchecked exception.

No Broker (Product Base Company)

1. Explain about year project & flow of project & so many


related to project.
2. Garbage collection.
3. How you used quircs in spring boot.
4. Types of memories
5. Serialization & deserialization.
6. If we make parent class serialized does child class get
serialized .
7. Singleton program
8. Static class.
9. Internal working of hashset.
10. Synchronized keyword.
11.Two DSA questions
12.Volatile Keyword.
Impetus

1. Last project & worked on & technologies used & roles.


2. New features in Java 8.
3. What is optional class.
4. Methods available in stream.
5. D/w function & predicate.
6. If there is user-defined class called employee & it as instance
of age of name then How to sort according to the age.
7. Collections
8. Comparable & comparator.
9. If we have list of employee & it have ID, name& age, we
need to sort according to name & of name is equal then
compare with age.
10. Program – frequency of characters in the given string.
11. Internal working of Hashmap.
12. Does Hashmap allow null
13. d/w Hashmap & Hashtable.
14. How to achieve abstraction.
15. In rows/in row d/w
16. Arraylist vs linkedlist.
17.Can we override static method & can we overload the static
method.
18. How to create immutable class.
19. Rules of construction.
20. Why constructor is available in abstract class
21. Wrapper classes.
22. What is class loader.
23. What is string pool.
24. What is heap memory.
25. d/w this & super keyword.
26. d/w abstract & interface.
27. Transient & volatiles keyword
28. What are the ways to create thread.
29. d/w wait ( ) & sleep ( )
30. Dependency Injection.
31.
Mouri tech

1.what is functional interface

2.@qualifier

@rest controller

sort elements program's

5.pesudo code on rest controller

6. why string is immutable Difference b/w list and linked list

Technology we know Oops concept Can we start the tread twice


Can we inherit static member Internal working of hashmap
Transient keyword What is volatile Multicatch blocks Questions
based on try finally block Scenario based Questions 2nd maximum
salary Find a vowels from the given string Types of object Deloitte
What is functional interface What is stream API Difference
between hashmap and hash table Filter program in steam API
Difference between java 7 and java 8 What are session variables
What is session factory What is bean factory What to create bean
in spring boot application What is difference between@primary
and @qualifier Difference between@controller and
@Restcontroller What is @controllerAdvice How to handle
exception in spring boot application Difference between
monolithic and micro services What is the procedure to
communicate different modules Use of RestTemplet What is the
use of repository What all strategies can be followed for
deployment What Is Eureka What is PACT and OAUTH What is
idempotent What is API gate way How to run two modules at a
time What all configurations can be done in application.properties
What tools used for deployment Explain about spring bean life
cycle How to sort in data base Why it is adviced to use hibernate
instead of JDBC what is postman Http methods How to write a
URL in Post man Difference between HTTP AND STTP Mouri tech
What is stream Api Stream Api methods How to sort in stream api
Where have you used stream api in your project What is class
loader Types of class loader and explain each of them What is rt
jar file in jvm rt jar file real life example where you used every
day Topmost exception explain types of compile time and runtime
exception Daemon thread Scenario based question on daemon
thread What is searilisation explain briefly How to go from one jsp
to another How to change tomcat server @componentscan Spring
actuator ? Explain briefly And many more I forgot

MERCEDES BENZ

What is the difference that u get u see in interface befor and


after version 8 Stream API Serialisation Thread life cycle What is
object class Exception hierarchy How to get customized exception
Armstrong number program Concurrent hashmap Difference
between spring and spring boot @value @path param nd @query
param @Request Body @RequestMapping Spring actuator Spring
Cloud What data base u used Data base view Why micro services
is not preferred What u know about web services What is REST
API cache Write the structure of url that to use in postman What
all operations can be performed using postman Do u have any
idea about cloud AWS etc. How UI used for front end in your
project How to write query in hibernate Infinite solutions What all
technologies used in your project Difference between spring and
spring boot Difference between@Autowired and @Bean Explain
the flow of your project What all annotations used Why we have
put method though we can update using post method What is
200 400 404 and 500 errors What pattern used in your project
Tell me how you created bean using singleton pattern in project
What is MVC architecture Explain the flow of MVC architecture
What is dispatcher servlet Explain oops concepts Dead lock What
is collection
Why you didn't used java 8 features in your project Cognizant
What all technologies u used in your project Difference between
Hibernate and JPA Spring security Explain all layers used in
project @Controller and @RestController Write a code for
consuming and exposing web services Write code for emai
sending services How to generate pdf What dependency u added
to get JSON object What is persistence Write a query to get 20
records from table Instead of SQL what you have in hibernate
TCSWhat is optional class Instance variables Difference between
Stream api and collection Functional interfaces Lambda expression
Garbage collection Serialisation Synchronize keyword SQL queries
Spring boot life cycle How to implement web services Difference
between@controller and @restcontroller How to change port
number Difference between string buffer and string builder
Cognizant 2nd round What is multiple inheritance What is compile
and run time polymorphism What is package What is type casting
How to call constructor from another constructor How to get
threads in program What is thread join Difference between wait
and sleep What is boxing Difference between hashmap and set
What all commands u know in SQL How to add two table and
write it's query (Foreign key) If I have a employees table how to
get the total count write query How to connect our eclipse with
data base write code How to do crud operation in hibernate.
Session factory code What we create application using micro
services What all annotations u know in spring boot How to
create database schema write complete code Difference between
spring boot and spring Spring Actuators
1. Can u tell me the procedure for connecting our spring
boot application with data base Explain JDK, JRE and
JVM?

2. Explain public static void main(String args[]) in Java

3. Why Java is platform independent?

4. Why Java is not 100% Object-oriented?

5. What are wrapper classes in Java?


6. What are constructors in Java?

7. What is singleton class in Java and how can we make a


class singleton?

8. What is the difference between Array list and vector in


Java?

9. What is the difference between equals() and == in Java?

10. What are the differences between Heap and Stack


Memory in Java?

11. What is Polymorphism?

12. What is runtime polymorphism or dynamic method


dispatch?

13. What is abstraction in Java?

14. What do you mean by an interface in Java?

15. What is the difference between abstract classes and


interfaces?

16. What is inheritance in Java?

17. What are the different types of inheritance in Java?

18.What is method overloading and method overriding?

19. Can you override a private or static method in Java?

20. What is multiple inheritance? Is it supported by Java?

21. What is encapsulation in Java?

22. What do you mean by aggregation?


23. What is composition in Java?

24.What is a marker interface?

25. What is a constructor overloading in Java?

Servlets – Java Interview Questions

26. What is a servlet?

27. What are the differences between Get and Post methods?

28.What is Request Dispatcher?

29. What is the life-cycle of a servlet?

30. How does cookies work in Servlets?

31. What are the different methods of session management in


servlets?

JDBC – Java Interview Questions

32. What are the steps to connect to a database in java?

33.What is the difference between execute, executeQuery,


executeUpdate?

Spring – Java Interview Questions


What is Spring?

34. Tell some of the important annotations


?(ex.@Auitowired,@Qualifier)
35. Explain Bean in Spring and List the different Scopes of
Spring bean.
36. Write a program for a thread safe singleton class?

37. What is autowiring in Spring? What are the autowiring


modes?(modes ex. byName,byType).
38. How to handle exceptions in Spring MVC
Framework?(@ExceptionHandler).

39. Spring v/s SpringBoot?

40. Which one will you prefer among spring and springboot to
create a program from scratch?

Hibernate-Interview Questions
41. What is Hibernate Framework?

42. What are the differences between get and load methods?

43. What are the advantages of Hibernate over JDBC?

44. What is JPA can you directly implement it?

JSP – Interview Questions

45. JSP lifecycle?

46. What are the JSP implicit objects?

47.What are the different tags in JSTL?

48. Explain the jspDestroy() method.

Exception and Thread - InterviewQuestions

49. What is the difference between Error and Exception?

50. How can you handle Java exceptions?

51. What are the differences between Checked Exception and


Unchecked Exception?

52. Checked Exception?


53. Define Threads and its types?

54. Will the finally block get executed when the return
statement is written at the end of try block and catch
block as shown below?

55. Thread life cycle?

56. Final v/s finally v/s finalize ?

57. What are the differences between throw and throws?

58.What is exception hierarchy in java?

59. How to create a custom Exception?

60. What is a finally block? Is there a case when finally will not
execute?
61. What is synchronization?

62. Can we write multiple catch blocks under single try block?

63. What is out of Memory Error in Java?

64. What is a Thread?

65. What are the two ways to create a thread?

66. Garbage collectors in Java?

Collections-Interview Questions

67.Difference btw Collection and Collections?

68.Collections full hierarchy?


Learn all the differences btw all types of List,Set,Map
very nicelythey can ask any of the differences ?

69. Can you call a constructor of a class inside another


constructor?

70. How is the creation of a String using new() different from


that of a literal?

71. Why is synchronization necessary? Explain with the help


of a relevant example.

72. What are the differences between Heap and Stack Memory
in Java?

73. What is JIT compiler in Java?

74.What are access modifiers in Java?

75. What is an object in Java and how is it created?

76.What is Object Oriented Programming?

77. What are the main concepts of OOPs in Java?

78. What is the difference between a local variable and an


instance variable?

79. What is an infinite loop in Java? Explain with an example.

80. What is Java String Pool?

81. Differentiate between static and non-static methods in


Java.
82. What is constructor chaining in Java?

83. Difference between String, StringBuilder, and StringBuffer.

84.What is a classloader in Java & Types?

85. Why Java Strings are immutable in nature?


86. What is the difference between an array and an array list?

87. collection hierarchy below go throught all of them i have


attached the image below.

88. Internal Algorithm working of Hashmap?

89.Define webservice and microservices briefly?

90.What methods were you using in REST?

91. Methods of Hibernate?

92. Xml v/s JSON?

93. Explain System.out.println();?

Miscelleneous Question

1. Classnotfound Exception v/s Noclassdef found Exception?

2. Intermediate and Terminal operations in stream?

3. Groupby & orderby?

4. Delete v/s Drop?

5. SIB v/s IIB?

6. Steps to create immutable class in java?

7. Map v/s FlatMap?

8. Reduce() method?

9. What is spring boot starter?

10. Spring Actuators?


11. Status codes of postman?

12. Different errors codeslike 404,400,500,200?

13. Lazy loading v/s Eager loading?


14. Iterators and types?

15. List iterator?

16. Session, session factory?

17. Spring MVC?

18. JPA nnotations?

19. Stream API with example?

20. Microservices v/s Monolith architecture ?

Tips:-

1) In every interview they will just focus on your core java


level (90 percent questions will come on core java only, so
read core java notes atleast 5 to 10 times) and they will
ask 2 to 3 questions on spring boot and 2 to 3 questions
related to your project, rear case they will ask questions on
SQL that’s it…

2) Always read the concept like (what, why, where, when) it


will really helpful you to tackle cross questions which are
asked by interviewer example – inheritance (what is
inheritance, why did they introduced in java, where have to
used in our project, when we have to use this concept
practically)

3) Before attending the interview you ask them to share the


job description… read that job description.. prepair
according to job description- because in JD they clearly
mentioned like we are looking for a candidate like know
html, css javascript-that means questions will come on
these things only you should prepare on these.

4) Don’t study in last minute to the interview… finish your


revisions before half an hour.. otherwise you will be nerves
sometimes, difficult to remember the answer… so that be
calm and be confidence

5) While answering the questions don’t do hurry burry…. Say


the answer properly and slowly…and be bold and confident
while giving the answer.

6) If you rally don’t know the answer directly say sorry sir I
don’t about it definitely I will learn about this for sure

7) For example they ask what is stream api-assume that you


given the answer .. the next question they will ask write a
program on this or where did you used in your project…to
escape these kind of questions directly say sorry sir I didn’t
use this concept in our project..i just aware of this
concept..

(read all the concept and understand each concept which


are taught by Pankaj Sir but…These are the fixed repeated
questions you can expect in every interview (my
experience)

1) Explain oops concept

2) Explain were did you used each oops concepts in your


project

3) Diff between this and super keywords


4) Diff between comparable and comparator

5) Dif between overload and override

6) Diff between interface and abstract class

7) Diff between hasmap and hashtable

8) Diff array list and linked list

9) diff between array and arraylist

10) All java 8 features (default, lamda, functional


interface and stream api)

11) Diff between spring and springbootm

12) Explain dependency injection

13) Explain roles and responsibilities

14) Roles and resp.. –you should read to explain each


and every points which you have mentioned in your
resume) (in these above differences only definitions are
not enough.. you should ready to explain like for
example when we have use comparable and when we
have to use comparator)
These below are not fixed questions but you can expect
the questions on

In SQL

1) What is the query to find 2nd max or 3rd max or nth max
salary in employee table

2) All joins were very important (definition + syntax you


should know) (inner, left, right, full)
3) They can ask to write a query for create a table with 4
column names

4) Use of commit and rollback

5) All the keys were very imp (primary, foreien, unique)

In spring boot and hibernate

1) All the annotations are very important (you should know


the practical usage of these annotations)

2) What are the components of springboot

3) Explain hibernate mapping

4) Explain MVC architecture


Extra Questions you should know

1) Explain agile methodology

2) How you pass your code in your project

3) What is the challenges you faced in your project how you


overcome from that challenge

4) How you were fixing the bugs explain the implementation


of webservies in your project
Extra Questions you should know

1) Explain agile methodology

2) How you pass your code in your project

3) What is the challenges you faced in your project how you


overcome from that challenge
4) how you were fixing the bugs

5) Explain the implementation of webservies in your project

6) Explain the implementation of email services in your project

7) What is spring actuator

8) Diff between controller and rest controller

9) What is bean and @bean

10) Explain spring ioc container

Every technical interview they might be ask these type of


programs to write

1) Reverse a string (most imp)

2) Reverse a words (example- hi Manoj= manoj hi)

3) Swap a number with and without using third variable

4) All patterns program very very imp

5) You should ready to write a program that explaining oops


concepts (Ex= overriding program, multilevel inheritance
example program)

6) Array descending order

7) Hashmap or hashtable or list related program is very


important

8) Fibonacci series program

9) Find prime and amstrong number between 0 to 100


1. Singleton
2 cout no of word in string
3 Reverse string
4 find vowels.
5 fibannoci series 6.palindrome
6 How to make a traingle ya square
7 Prime no.
8 Armstrong number
9 cout 2 swap without using 3rd variable
10 Cgi
1. oops concept
2. 2.thread life cycle
3. mvc architecture
4. collection frameworks
5. swap two elements without 3rd element
6. 6.algorithm for fibanocii
7. algortithm for prime number
8. what is supermost class in exception
Newgen technologies
1. differnce b/w this keyword and super keyword 2.what is
inheritance
2. Scenario based ques on inheritance concept
3. Try and catch block scenario based ques
4. joins
5. Types of joins
6. Did you know about JavaScript
7. Primary key, foreign key
8. Why we use hibernate

9. string buffer v/s string builder v/s string 9.spring Acutator


10. where did u use web services in your project

You might also like