0% found this document useful (0 votes)
29 views11 pages

Interview Questions: Core Java

This document contains a list of interview questions related to Core Java, JSP/Servlets/Scripting, and databases. There are over 100 questions total covering topics like OOP concepts, collections, concurrency, exceptions, JDBC, servlets, JSP tags, and more. The questions range from conceptual questions to code examples.

Uploaded by

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

Interview Questions: Core Java

This document contains a list of interview questions related to Core Java, JSP/Servlets/Scripting, and databases. There are over 100 questions total covering topics like OOP concepts, collections, concurrency, exceptions, JDBC, servlets, JSP tags, and more. The questions range from conceptual questions to code examples.

Uploaded by

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

Interview Questions

Project SCB(LRO/Core Banking/Retail Banking/Whole


Banking)
List of Resources attended

Core Java
1 Difference between Interface and Abstraction , where have you used in you project, Give real time
senerio for this. Which one you will prefer and why? (3)
2 What is serialVersionUID
3 Is Resultset interface ? who implements it (2)
4 What is Reflection
5 How do you make two classes loosely coupled in core java (Without using spring)
6 What is synchronization? Where did you used serialization in you project (3)
7 Write synchronized method
8 Explain internal working of Hashmap (3)
9 Do hashmap allows duplicates keys or not
10 Class A extends B,C - > is it possible in Java
11 ArrayList<String> list = new ArrayList<String>;
list.add(“str”);
list.add(10);
will it compile successfully or not?
12 What is method overloading and method overriding (2)
13 Why Java does not support multiple inheritance (3)
14 What is hashcode method and why do you override hashcode and equals method (4)
15 Can we have two objects with same hashcode
16 What are the features of the Java
17 What is the diff between static block and static keyword
18 When do you go for abstract class and when do you go for interface
19 Write your own immutable class (4)
20 Write final class
21 Difference between hashmap and linkedhashmap (3)
22 Explain OOPS concepts (Asked to write on White Board)
23 What is concurrent Hashmap (2)
24 What is auto boxing and unboxing
25 What are the wrapper classes in Java
26 How memory will be allocated for String
27 What is the diff between List and Vector (2)
28 What is treeMap and internal working of the same
29 What is the diff between Comparable and Comparator (4)
30 Sort Employee Objects based on Salary using treeMap
31 Write your Own Exception Class (2)
32 What is Garbage Collection
33 Java 5 , 6,7, 8 Features
34 What is the use of Lambda Expressions
35 How do you implement static in your project
36 How do you implement synchronization in your project
37 Can you create object for interface
38 what is war,ear,rar?
39 Difference between hashmap vs concurrenthashmap? (2)
40 How to remove duplicates in arraylist?
41 Difference between arraylist vs linkedlist? (2)
42 try{
..........
}
catch(ArithmeticException e){
...
}
catch(Exception e){
....
}
catch(FileNotFound e){
...
}
is correct or not?
43 Difference between encapsulation and abstraction? (3)
44 What are Java 1.7 Features
45 How to implement custom hashmap?
46 How to handle exceptions in java 1.7 using multiple catch blocks? (2)
47 Real time scenario in using Arraylist. Write the code
48 JDK 1.5 features
49 JDK 1.7 try with resources feature
50 why HashTable not allow null?
51 what happen if we trying to add duplicate key in HashMap ?
52 how to read data from file and store it in another file.
53 I have one interface we have 3 methods, but i want to implement one method?
54 how to achieve abstraction
55 can I able to create 1000 objects for singleton ? if yes/no how/reason ?
56 throws and throw usage in project?
57 comparable and comparator implementation and internal mechanism? (2)
58 try with finally is possible ?
59 return 1 in catch and return 0 in finally what will be the output ?
60 return 2 in try , return 1 in catch and return 0 in finally what will be the output ?
61 which one will take more memory int or Integer and why ?
62 what is copyOnWriteArrayList ?
63 How to deal with out of memory error?
64 Apart from collections what is the use of hashcode and equals method ?
65 Difference between primitive and wrapper types ?
66 What is string builder, where you used in your project ?
67 Difference between String,StringBuffer and StringBuilder ? (2)
68 write program for How to access static and non-static variable from another class ?
69 Explain about OOPs concepts ?
70 Are you used multithreading and where ?
71 I am having map1 and map2, how to combine two maps in single map ?
72 final vs finally ? system.exit() in finally what will happen ?
73 given string is palindrome or not ?
74 Explain about System.out.println ?
75 How to concat String and how to append string buffer
76 Where did you used static and dynamic polymorphism
77 How JVM works internally
78 Can I implement abstraction in POJO or Model class
79 Diff between finally , finalize, final
80 What are exception, checked , un checked exception
81 Scenario based questions on exception
Try{
Try{
}
}catch(Exception e)
Is it valid?
82 Diff between hashmap and hashtble
83 Why immutable concept in java
84 You have list of 10 object in list. Check these objects exist in DB or not
85 Diff between array and arraylist
86 What is constructor , can we have private constructor, can you access outside of a class
87 If all the methods is abstract in abstract class then why we need interface
88 Shallow Cloning and deep Cloning
89 How to find method is synchronized or not
90 DOM parser vs SAX parser
91 List<String> lst= new ArrayList<String>();

If we decompile this how the code generated in class file.

92 List<?> lst =new ArrayList<?>()


What is the use of ?
93 project scenario based procedure and function program ?
94 What are generic classes
95 Difference between static and dynamic polymorphism
96 How would you make a class immutable?
97 Write a program to reverse a string without using predefined methods
98 What are the two ways of creating threads and which scenario we go for extend and implement?
99 Practical reason on why we should use Runnable interface over Thread class?
100 What is Serialization and deseralization?
101 Using threads how will you reduce the time taken to read 1lakh records from DB and write it to
file?
102 How will you optimize the code?
103 how many ways we can we create Thread, which one is better
104 what is the difference between wait and sleep
105 what about notify(), notifyAll() methods
106 why String is immutable
107 what is the advantage of ArrayList over Array
108 What can you tell about the transient and volatile keywords?
109 How can you make a page an error page in JSP?
110 What is JNDI?
111 What is tomcat?
112 What is db block?
113 How can we deploy a project in tomcat server?
114 How can you configure the session time out in tomcat?
115 How does two applications hosted on the same server communicate with each other?
116 If I have my source code in a drive, how do I make the application to be up and running?
117 How do you use files in java?
118 What are the steps to establish db connection?
119 How would you find out if a file is present in a specified path?
120 How we create the Custom Exception? Why we Custom Exception?
121 Why we are using Thread priorities? What will Happen?
122 How we can communicate the 2 Threads?
122 How we will access the file randomly?

Jsp/Servlets/Script (J2EE)
1 Diff between jsp include action tag and include directive and Purpose (2)
2 What is AJAX
3 How do create deadlock in servlet class
4 How do you get count of how many times servlet is accessed
5 How do you ensure the session is closed when browser is closed without logging out
6 Explain servlet life cycle (5)
7 What is session and When is the session id created
8 Can we call destroy method inside the init method and what will happen
9 Diff between page and pagecontext
10 Diff between http servlet and generic servlet. Which one have you used in your project and why
11 What are the JSP implicit objects (4)
12 Given a user form , how to pass from front end to back end in your project
13 What are the servlet scopes
14 Given one textbox in JSP , how do you save data in DB, The flow from front end to backend
15 What are the JSP tags used
16 What is JSTL , can you write custom tag library
17 How to invalidate the session
18 How to get the session object
19 How to get the request dispatcher
20 What is Servlet Collaboration
21 Tell me something about cookies
23 Diff between ServletContext and PageContext
24 Write ajax call syntax
25 How to get the text box value in jquery
26 Difference between web server vs application server?
27 For example in servlet mapping file having multiple mappings with same which one is taken

<servlet-mapping>
<servlet-name>sample</servlet-name>
<url-pattern>/sam</url-pattern>
<url-pattern>/sam</url-pattern>
<url-pattern>/sam</url-pattern>
</servlet-mapping>
28 Why we need filters in servlet? (2)
29 Who is responsible for servlet initialization?
30 JSP custom tags(JSTL)
31 JSP directives
32 How do you declare variables in JSP?
33 How to comment code in jsp and html?
34 How to convert jsp to Servlet ?
35 Three fields having same ID,but i want all three field values, How to get ?
36 How SinglePageApplication(SPA) will work ?
37 Three fields having same ID, If iam getting value using ID what will happen ?
38 how to get values from Jquery and javaScript ?
39 What are the javascripts validation done in your project (2)
40 Diff between Servlet and filter ?
41 Servlet is multi-threaded or not
42 How JSP converted to HMTL internally
43 What are the data type in json
44 How to navigate from one page to another
45 Difference between servlet Config and ServletContext?
46 Difference between forward() and sendRedirect()?
47 How we will handle the exceptions in servlet?
48 What is contextparam?How we can write Context params in web.xml?
49 How we can write the code Using ServletContext object?
50 Difference between Action Include() and Directive Include()?
51 What is Action elements in Jsp?How we can access applet to Jsp?
52 Implicit objects in Jsp?What is pagecontext?
Struts
1 How to do validation in Struts
2 New features in Struts 1.3
3 Struts flow
4 Types of Action in Struts

Spring
1 What are the bean scopes (5)
2 When do you use @Qualifier annotation (3)
3 Explain Spring MVC flow (4)
4 What is @RequestMapping and why it is used (1)
5 What is dependency Injection (3)
6 What is autowiring and how many types (4)
7 What are the annotations you have used
8 Explain DAO layer in Spring project
9 What is IOC (3)
10 What is the return type of requestMapping
11 Diff between setter and constructor injection (2)
12 What is AOP , jointpoint, pointcut, advise , aspect
13 Explain Spring transactions
14 What are the Spring 3 and Spring 4 Features
15 What is the diff between MVC 1 and MVC 2
16 what is the difference between httpsession and session in spring.
17 Spring Bean Life cycle (2)
18 From controller I am passing two parameters to backend, explain process of how will get
response ?
19 How to create Session ?
20 how to get session object in Spring Controller
21 difference between byType and ByName. (2)
22 How do you manage transaction and security in spring?
23 If PDF report not generating then how do you debug/analyze
24 Bean A contains B. Bean B contains A. Which bean will be initialized
25 What diff between request , prototype
Hibernate
1 Can we have two DB in single hibernate application and how do you configure it
2 What are the properties/tags in the hibernate configuration file
3 How did you used password in the configuration file
4 What is criteria , where have you used it (5)
5 What is projection , where have you used it (3)
6 Explain session factory , session and transaction (2)
7 Why do you need transaction in project
8 What are the drawbacks of the JDBC and why do you choose Hibernate
9 What are the hibernate object states
10 Diff between merge and update method
11 What is diff between get and load (2)
12 What is second level cache and how to enable it
13 How to print query on console in Hibernate
14 What are the mapping in hibernate and write onetomany
15 how to configure spring with hibernate
16 Why Hibernate ? why it came into picture if already we have JDBC
17 Hibernate second level cache? List out them
18 What is lazy initialization? what is the default and how to enable it?
19 Advantage of hibernate 4.0
20 What is difference between hibernate inverse and cascade
21 In which scenario Restrictions will you use
22 Diff between 1st level cache and 2nd level cache ?
23 Hibernate configuration (2)
24 JDBC what are the advantages of Hibernate over

JDBC and SQL


1 Is Resultset interface ? who implements it (2)
2 Write a query for inner join and what is the use (3)
3 What is index (2)
4 Write a single query to implement two joins
5 Display current date in sql query
6 Query to get total salary of an employee till date
7 Can you use + operator in queries
8 What is the diff between sum and +
9 What is ACID properties in SQL
10 What are the TCL , DDL and DML commands
11 How do you do commit and rollback
12 Diff between union vs unionall
13 Two Table employee and address, one employee can have multiple address. Write query to get
employee with addresses in one row.
Two tables employee:(empID,Ename) and empAddress:(empID,add1,add2,addType(res,ofc)).
same employee having resAddress and Ofcaddress.
i wat both records in sinle row like (r/o) ?
14 What are the joins and uses (2)
15 Write query to add variable component and Fixed Salary to find total Salary
16 Simple join query with two table data
17 What is recursive stored procedure
18 How left inner join work?
19 Is mandatory two tables should be in relation(onetomany) for inner join?
20 Scenario: Provided employee and address table.
Want to fetch address of each employee which matches in employee table - Inner join
Want to fecth address of each employee and all the employees in employee table - Left
join
21 Triggers, procedure and function purpose
22 difference between ddl and dml
23 what is selfjoin
24 difference between stored procedure and function ? where you used functions in your project ?
25 query taking too much time to get result from DB,in this situation what you will do ?
26 what type of drivers(JDBC) you used in project and jar names ?
27 What are the different statements
28 Salary for each employee up to date
29 How do you handle performance issue
30 Steps to implement JDBC connection
31 What is Cursor? Why it is needed.
32 How would you store the DB password in such a way that it is secure?
33 How do you establish a DB connection with JDBC 4th driver?
34 what is the difference between Statement and PreparedStatement
35 How to use joins, and what are the different joins
36 What is aggreagate function in sql?
37 What is Group By and Having? Tell me one query Using Group By?
MQ
1 Application has to interact with other system without using soap services. Provide the option :
We can use MQ
How MQ works

Design Pattern
1 How do you write Singleton class , where have you used in you project (2)
2 What are the design patterns you know
3 What is Design Pattern
4 What is Façade Design Pattern
5 How DO you implement Factory Design pattern in your project
6 Explain Adapter pattern
7 Explain Strategy pattern
8 Difference between factory and command design pattern
9 singleton usage and purpose ?
10 how to make connection as singleton ?write code ?
11 Explain factory pattern and MVC
12 Why Design pattern is required ?

Web Services
1 Which protocol your service is using
2 What is WSDL full form and explain about it
3 How do you differentiate between web service un available and timeout
4 How soap services works
5 How to make synchronous and asynchronous call using web service
6 JMX purpose
7 SOAP and REST diff ?
8 Why SOAP used in your project?
9 How you know the request sent from consumer to provider application or not ?
10 what are the tools you used ?
11 data type of data(how it will be) in soap ws ?
12 how to check soap and rest services ?
13 What is resource
14 why we prefer SOAP over REST for Banking domain
15 Which method you can use in update operation in Rest?
16 Which method can we use Retrieval operation In rest?
17 How we can give the path using get operation in rest?
18 What is Jax-b? What is Jax-p?

Project / Process
1 Explain your project - Project flow - From requirement gathering to deployment (4)
2 Explain architectural flow
3 Technical flow and Functional flow of project (3)
4 Explain the technical flow of the latest project you have worked on. In depth explanation is
needed.
5 If you have crore of records which one do you prefer to use collections or DB and why?
6 Query using GroupBy clause.
7 How your application communicates with DB?
8 Which collection classes you have used in your application? When do you go for Hashmap and
when to prefer arraylist?
9 Technology Stack for your project ?
10 Handling deployment / Deployment plan
11 About scrum master ?
12 Difference between daily meetings and weekly meetings ?
13 What is SDLC(based on your project) ?
14 How you test your code? After your testing where you passed your code?

15 what is agile methodology –Sprint(estimate allocation),daily standup call(how to tell


yesterday,today,tomorrow’s work )
16 How to deploy the application in server.
17 How to checking the code in SVN
18 Do you have any idea about Banking domain? entity

19 What are the methodologies you worked


20 what is the team size the agile
21 what is the process to fix one defect, how you will work
22 suppose that defect not yet solve with in time period, how you will handle

23 what is the team structure in agile

24 How we can security in WebSphere Server?

25 Suppose you can get the errors in WebSphere server how can you can resolve?

26 How to connect Database in WebSphere server?


27 I am giving source code how you will setup the Environment In local without giving Document?

28 What is Retail banking?What is savings account?what is Current account?

General /Others/Testing
1 What is the technical challenge faced in your project and how did you solve it (2)
2 what is Mockito in unit testing.
3 project scenario based procedure and function program ?
4 Asked to create a new layer in the existing flow for a new requirement
5 testing methods, what are the types of testing you did in your project before code moving ?
6 how you handle transaction related things ? about transaction management ?
7 How you maintain security in your project ?
8 How to protect password from exposing to developer and deployed
9 About your company ?
10 Banking Domain knowledge and SWIFT rules ?

Note :

• Please do mention where you have used the concept in your project

• Please have perfection in Interface and Abstract class with real time scnerio and which one you
will prefer and why?

You might also like