Company Name : Cognizant Technology Solutions (CTS)
Sent By : Sai Pavan (Java Developer)
- Tell me about your self?
- Tell me about your current project and your roles ?
- What is synchronization ? View Answer
Synchronization is the ability to control the access of multiple threads to shared resources. Synchronization stops multithreading. With synchronization at a time only one thread will be able to access a shared resource.
- What is the difference between synchronized block and synchronized method ? View Answer
Synchronized blocks place locks for the specified block where as synchronized methods place locks for the entire method.
- What is the difference between yield() and sleep()? View Answer
When a object invokes yield() it returns to ready state. But when an object invokes sleep() method enters to not ready state.
- What must be the order of catch blocks when catching more than one exception? View Answer
The sub classes must come first. Otherwise it will give a compile time error.
- What is Connection pooling ? View Answer
Connection pooling is a technique used for sharing server resources among requesting clients. Connection pooling increases the performance of Web applications by reusing active database connections instead of creating a new connection with every request. Connection pool manager maintains a pool of open database connections.
- How do you handle your own transaction ? View Answer
Connection Object has a method called setAutocommit ( boolean flag) . For handling our own transaction we can set the parameter to false and begin your transaction . Finally commit the transaction by calling the commit method
- What is "application component provider" ?
- What modifiers may be used with an inner class that is a member of an outer class? View Answer
Inner class may be declared as public, protected, private, static, final, or abstract.
- How you will enable front-end validation based on the xml in validation.xml ? View Answer
tag to allow front-end validation based on the xml in validation.xml. For example the code: generates the client side java script for the form \"logonForm\" as defined in the validation.xml file. The when added in the jsp file generates the client site validation script.
- Can we use the constructor, instead of init(), to initialize servlet ? View Answer
Yes. But you will not get the servlet specific things from constructor. The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with arguments, so there was no way to give the constructor a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won’t have access to a ServletConfig or ServletContext.
- What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher() ? View Answer
In request.getRequestDispatcher(path) in order to create it we need to give the relative path of the resource. But in resourcecontext.getRequestDispatcher(path) in order to create it we need to give the absolute path of the resource.
- What’s HQL ? View Answer
HQL is the query language used in Hibernate which is an extension of SQL. HQL is very efficient, simple and flexible query language to do various type of operations on relational database without writing complex database queries.
- How can we see hibernate generated SQL on console ? View Answer
We need to add following in hibernate configuration file to enable viewing SQL on the console for debugging purposes <property name="show_sql" >true</property>
Please share your faced interview questions by firstname.lastname@example.org, which can help job seekers as well as java learners.Thanks Sai Pavan. All the best !!!!!!!
Interviews By Company :
- ADP @ Java Interview Questions
- CapGemini @ Java Interview Questions
- HCL @ Java Interview Questions
- HP @ Java Interview Questions
- IBM @ Java Interview Questions
- Infosis @ Java Interview Questions
- Keane @ Java Interview Questions
- Mindtree @ Java Interview Questions
- Syntel @ Java Interview Questions
- Value Labs @ Java Interview Questions
- Manhattan Associates @ Java Interview Questions
- Sonanta Software @ Java interview Questions