0% found this document useful (0 votes)
26 views9 pages

Interview Qes

The document outlines various technical interview questions and answers related to Java, JSP, Hibernate, and Spring, covering topics such as ServletConfig vs ServletContext, method overloading, connection pooling, and Java Beans. It also includes specific programming tasks and conceptual questions from interviews at multiple companies. Additionally, it discusses differences between various Java collections and frameworks, as well as design patterns and exception handling.

Uploaded by

madhu
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)
26 views9 pages

Interview Qes

The document outlines various technical interview questions and answers related to Java, JSP, Hibernate, and Spring, covering topics such as ServletConfig vs ServletContext, method overloading, connection pooling, and Java Beans. It also includes specific programming tasks and conceptual questions from interviews at multiple companies. Additionally, it discusses differences between various Java collections and frameworks, as well as design patterns and exception handling.

Uploaded by

madhu
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/ 9

CrimsonLogic()

1. What is the different between ServletConfig and ServletContext?


Ans=

 ServletConfig available in javax.servlet.*; package


 ServletConfig object is one per servlet class
 Object of ServletConfig will be created during initialization process of the servlet
 This Config object is public to a particular servlet only
 Scope: As long as a servlet is executing, ServletConfig object will be available, it will be
destroyed once the servlet execution is completed.
 We should give request explicitly, in order to create ServletConfig object for the first
time
 In web.xml – <init-param> tag will be appear under <servlet-class> tag
Here's how it looks under web.xml : (Source)
<servlet>
<servlet-name>ServletConfigTest</servlet-name>
<servlet-class>com.stackoverflow.ServletConfigTest</servlet-class>
<init-param>
<param-name>topic</param-name>
<param-value>Difference between ServletConfig and ServletContext</param-value>
</init-param>
</servlet>
 ServletContext available in javax.servlet.*; package
 ServletContext object is global to entire web application
 Object of ServletContext will be created at the time of web application deployment
 Scope: As long as web application is executing, ServletContext object will be available,
and it will be destroyed once the application is removed from the server.
 ServletContext object will be available even before giving the first request
In web.xml – <context-param> tag will be appear under <web-app> tag
Here's how it looks under web.xml :

<context-param>
<param-name>globalVariable</param-name>
<param-value>com.stackoverflow</param-value>
</context-param>

2. What is jsp include directive?

The include directive is used to include the contents of any resource it may be jsp file, html file or text file.
The include directive includes the original content of the included resource at page translation time (the
jsp page is translated only once so it will be better to include static resource).

For Code Reusability purpose. <%@ include file="resourceName" %>

3. What is jsp taglib directive?


The JSP taglib directive is used to define a tag library that defines many tags. We use the TLD (Tag
Library Descriptor) file to define the tags. In the custom tag section we will use this tag so it will be
better to learn it in custom tag. <
%@ taglib uri="uriofthetaglibrary" prefix="prefixoftaglibrary" %>
4. What is connection polling?
a connection pool is a cache of database connections maintained so that the connections can be
reused when future requests to the database are required. Connection pools are used to enhance the
performance of executing commands on a database.
5. How to insert query to the data source?
6. What is jsp:useBean?
The jsp:useBean action tag is used to locate or instantiate a bean class. If bean object of the Bean
class is already created, it doesn't create the bean depending on the scope. But if object of bean is
not created, it instantiates the bean.

Java Bean
A Java Bean is a java class that should follow following conventions:

o It should have a no-arg constructor.

o It should be Serializable.

o It should provide methods to set and get the values of the properties, known as getter and setter
methods.

Why use Java Bean?


According to Java white paper, it is a reusable software component. A bean encapsulates many objects
into one object, so we can access this object from multiple places. Moreover, it provides the easy
maintenance.

TechTree IT System(29th July)


 About project.
 What is method overloading ?
It is one of the concept of polymorphisim. It defines more than one method have same name but
different argument . In method overloading method resolution takes care by the compiler based on
reference type.
 If an exception occurred before coming to the try-catch, then what will happen and how to resolve?
Abnormal termination.
 Why String is immutable?
For security, efficiency.
 What is Session Factory and difference between Session factory and Session?
 Difference between merge () and update();
 How many annotation u uses in spring?
 Difference between @Service, @component, @Controller, @Repository.
 @Component | generic stereotype for any Spring-managed component |
 | @Repository| stereotype for persistence layer |
 | @Service | stereotype for service layer |
 | @Controller| stereotype for presentation layer (spring-mvc)

 Is it possible to use @Repository behalf of @Controller? explain.

No.
 Internal working of HashMap.
 Difference between hashmap and hashTable?

WIPRO (30TH JULY)


1. WRITTEN ROUND CLEAR. NO RESPONSE FROM WIPRO YET.

Orient Technology(8th Aug)


 What is finally?
Java finally blockis always executed whether exception is handled or not. Java finally block follows
try or catch block.

 What is configuration in hibernate? program


 If I want to connect two database in hibernate , then how I will connect?
 What is dialect in hibernate ?
 How u will show the result in jsp , fetching data from database? program
 What is collection?
 What is map?
 What will be the output if we access private method? program
 How to resolve the OutOfmemory problem.(heap memeory)
 Is it possible to create object in interface and why?
 Exception program .and what will be output?
 Difference between jdbc and hibernate.
 If there are 5 methods in a interface, Is child class implements 2 method from 5 ?and why? Program…
 Difference between ArrayList and LinkedLIst?

HCL (26TH AUG 2017)

 Design pattern java programming


 Java String programming
 Matrix java programming.

IBM TELEPHONIC ROUND (3TH SEPT 2017)


 Get and load method in hibernate
 Logic behind the number character occurrence in string.
 Sql query logic.
 How to find the 3rd largest salary from employee?
 What is Hash Map?
 Hash map program logic.
 How to find number of key value pairs in a map?
 How to find the corresponding values of key?

ACCENTURE TELEPHONIC ROUND (5TH SEPT 2017)

 Join of two tables


 After joining two salary table and employee table getting 4th highest paid salary of
employee
 Abstraction vs interface
 Spring mvc concept.
 How to change the port no. of server in eclipse.

TH


CBSI INDIA PT. LTD (6 SEPT 2017)
Written round and programming…clear..
WAP occurrence of character in String.
 WAP to Swap two variables without using 3rd variable.
 WAP to for circular linked list.
 WAP for producer consumer relation.
 WAP for String Anagram.

KALS INFORMATION SYSTEMS LTD.(8TH SEPT 2017)


 Different between application object and session object?
 WAP I array to retrieve largest 3 no. from array.

NARAYANA HEALTH DOMAIN (9TH SEPT 2017)

 Matrix anti clock wise 90 degree program in java


 Spring mvc with rest web service insert, update program
 Linked list program(last element of list will come to first and after all are same)
 Mathematical solution of permutation combination question.

DTDC (11TH SEPT 2017)

1. Design current project architecture diagram.


2. Introduction of project.
3. Wap occurrences of character in string.
4. Oops concept.
5. What is abstraction different with interface?
6. What is invert tag in hibernate?
7. Difference between Get and Load method in hibernate?
8. Difference between save and merge method in hibernate?
9. What are new feature in java 1.7?
10. Multiple catch concepts and how it makes convince from previous
version?
11. Difference between ConncurrentHashMap and
SynchronisedHashmap.
12. Checked exception program.
13. Can u handle OutOfMemory error? How u resolved this?
14. Difference between sql date and util date?
15. Difference between sterilization and externalization?

Conduent Business Services (Xerox) (25TH oct 2017)

 Introduction/About project
 What report u use on your project?
 In which format u use jasper report?
 What are the new feature in java 9?
 What are the new feature in java 8 compare with java 7
 What is lambda Expression und uses?
 What is marker interface?
 Where u use marker interface on your project? Example ?
 What is oops and the benefit of oops comparing with other language?
 What is class?
 What is single tone class?
 Single tone class program.
 What is difference between collection and collections?
 What is HashTable?
 Difference between comparable and comparator interface?
 Difference between hashmap and hashtable? Program?
 What type of annotation use in hibernate inheritance?
 Method overloading program.
 What is hashing?
 Singletone design patern?

MindTree (28TH oct 2017)

1. “helloWord” program using spring, json Rest Api(coding).


2. Dao layer program of Spring mvc connection withHibernate.
3. How to connect database using hibernate with spring mvc ?
4. How and where u make transcation management in spring mvc with hibernate?
5. What is @RestController?
6. Internal working of HashMap?
7. Alogorthim behind the linkelist?
8. What is concept behind the two objects store in same bucket?
9. What are the methods in object class?

Aricent Technolopgy:
1st Round: Test:

Written and progrominc test

2st Round: Test:

 Abot project and role responsibity


 Program of overloading
 Difference between hibernate and jdbc
 Can we write query in hibernate?
 What are type of mvc model?
 What are the folder structure of spring mvc?
 Puzzle solve?
 There is table , query for finding all null value of specific coloumn and null of all table?

IWeen
1st Round: Test:

 Find index of first non-repeated character in a string.


 In an array there are lot of floating –ve and +ve value, find the sum of value which is equivalent to zero.
Without using any inbuilt function and collection.
 Forgot the question.
 20 objective.

2st Round:

 about the project..


 about role and responsibility
 difference between throw and throws?
 Customized exception program
 Difference between coucurant hashmap and synchronized hashmap?
 Difference between ArrayList and LinkList?
 Diffence between .equlas nd ==
 T

3st Round:

 How many ways to create Thread with program


 Print 10 tables in child thread class..program
 To sleep all table 5 second ,,program
 Difference between sleep(), wait(), notify()
 Difference between notify(), notifyAll()
 What is Thread Pool
 ThreadPool program havig 10 threads on by one and some criteria
 Input=Iween@Bangalore
Output= Iween
Bangalore write program… without using collection and inbuilt function
 Again add some requirement in above program..
 Difference between soap vs restful
 Difference between get and post?

Altimetric:
1st Round: System Test:

 40 objective from java, c++, data structure , java script, sql


 2 programing:
 One scenario where there are lot of parents having lot of children. Have to find the siblings of particular
parent .
Example: input1 =5; length of the araay.
int[] input2={1, 3, 5, 6,7}
input3= siblings of particular no.
siblings will consider as n+1 and n+2
here siblings of 5 are 6,7

 There are 20 students in a class. Each student having different points for which they can able stand in a
queue according to their points from highest point to lowest point. If any student having less point who
stand ahead of student who has more point, how to track this things.
Int[] input1, input2
Where I<j and P[i]>p[j] then …

2nd round:

Find index of first non-repeated character in a string.

Technical round

1. Abut the project.


2. Return type of web service
3. Given a scenario to get all customer details to write full program in rest controller with configuration and all
classes.
4. What are the jar u use in restful for json response
5. What is enum?
6. Is enum is singletone?
7. What is Thread pool?
8. What is Executor?
9. What is ExcuteService interface?
10. What are the specifier and modifier are use in Java?
11. Class Test{
Int b ;
Employe e;
} make it immutable calss.
12. Internal working flow of HasMap?
13. HashMap related other question..some packge realted.
14. Iterator vs enumeration?
15. Hashmap vs hashTable?
16.

You might also like