Java Senior Developer Questions
Java Senior Developer Questions
3. What is Read-Write Lock? Does Concurrent HashMap in Java Uses the Read Write Lock?
8. How do you share an object between threads? or How to pass an object from one thread to
another?
10. How do you avoid deadlock while coding? By changing the lock
11. What is Hibernate?
12. What are the advantages of Hibernate over JDBC?
13. What is the requirement for a Java object to become a Hibernate entity object?
14. What are different types of caches available in Hibernate?
15. Does Hibernate Session interface thread-safe in Java?
16. What are other ORM frameworks? Any alternative of Hibernate?
17. What is Tomcat and why did it come into the picture?
18. Why do we require Apache Tomcat?
19. What is the default port for Apache Tomcat?
20. What are the types of batch file with the help of which we can Start and Stop Apache Tomcat
Server?
21. Which is the vital configuration file that is used in Apache Tomcat?
22. Which is the vital configuration file that is used in Apache Tomcat?
23. Where are the logs of Apache Tomcat stored?
24. Which version of Apache have you worked on?
25. Is it possible to capture the MAC address of the clients who are using your server?
26. What are Spring beans?
27. What does a Spring Bean definition contain?
28. How do you provide configuration metadata to the Spring Container?
29. How do you define the scope of a bean?
30. Are Singleton beans thread safe in Spring Framework?
31. Are there limitations with auto wiring?
32. What is Spring Java-Based Configuration? Give some annotation example.
33. How can JDBC be used more efficiently in the Spring framework?
34. What are the ways to access Hibernate by using Spring?
35. ORM’s Spring support
36. What are the different types of Auto Proxying?
37. What is Spring MVC framework?
38. What is blocking and how would you troubleshoot it?
39. Could you please some items which you may see in an execution plan indicating the query is not
optimized?
40. What structure can you implement for the database to speed up table reads?
1>Singleton Pattern is one of the design pattern in java.It is describe as a creational design pattern .
Singleton is a class which has only one instance in whole application and provides a get
Instance() method to access the singleton instance. Thread safe Singleton usually refers to write
thread safe code which creates one and only one instance of Singleton if called by multiple thread at
same time. Yes we can write thread safe singleton in java. Double checked locking is sued to write
thread safe code.
return _INSTANCE; }
The Template Method pattern is used when two or more implementations of a similar algorithm exist.
In the real world templates are used all the time: for architectural plans, and throughout the
engineering domain. A template plan may be defined which is then built on with further variations.
Template is the behavourial pattern created in java
3. What is Read-Write Lock? Does Concurrent HashMap in Java Uses the Read Write
Lock?
ReadWrite Lock is an implementation of lock stripping technique, where two separate locks
are used for read and write operation. Since read operation doesn't modify the state of the
object, it's safe to allow multiple thread access to a shared object for reading without locking
8. How do you share an object between threads? or How to pass an object from one
thread to another?
If method1() and method2() both will be called by two or many threads , there is a
good chance of deadlock because if thread 1 acquires lock on Sting object while
executing method1() and thread 2 acquires lock on Integer object while
executing method2() both will be waiting for each other to release lock on
Integer and String to proceed further which will never happen.
kill -3
10. How do you avoid deadlock while coding?
It is an ORM framework which is known as a persistent framework which i s used to map Plain
Old Java Object s into a table.
17. What is Tomcat and why did it come into the picture?
20. What are the types of batch file with the help of which we can Start and Stop Apache Tomcat
Server?
Startup.bat
Stop.bat
24.Is it possible to capture the MAC address of the clients who are using your server?
25.What are Spring beans?
The objects that form the backbone of your application and that are managed by
the Spring IoC container are called beans. A bean is an object that is instantiated,
assembled, and otherwise managed by a Spring IoC container. These beans are
created with the configuration metadata that you supply to the container. For
example, in the form of XML <bean/> definitions
26..What does a Spring Bean definition contain?
Spring beans definoition with id and class name and autowiring with beans scopes
They are XML based configuration file 1.Annotation based Configuration 2.Java-based
configuration
32. How can JDBC be used more efficiently in the Spring framework?
Spring Data
JDBC TEMPLATE
33. What are the ways to access Hibernate by using Spring?A- Inversion of Control with
a Hibernate Template and Callback. B - Extending HibernateDAOSupport and Applying an
AOP Interceptor node.
34. ORM’s Spring support
Hibernate, JDO, TopLink, iBATIS, and JPA.
35. What are the different types of Auto Proxying?
Model View Controller .It is one of the J2ee design pattern in java
37. What is blocking and how would you troubleshoot it?
38. Could you please some items which you may see in an execution plan indicating the query is not
optimized?
39. What structure can you implement for the database to speed up table reads?
indexing