Google

Feb 23, 2014

Top 20 Java technical interview questions and answers for experienced Java developers -- Part 4

Java Interview Questions and Answers

1-5 for experienced developers 6-10 for experienced developers 11-16 for experienced developers 17-20 for experienced developers

Q17. Can you explain singleton and prototype bean scopes in Spring framework? Which one is the default? Which one is thread-safe?
A17. Understanding Spring bean scopes - Singleton Vs Protype

After Spring, the most popular third-party framework is Hibernate.

Q18. Can you explain hibernate object states? Also, explain hibernate objects life cycle?
A18. 

Persistent objects and collections are short lived single threaded objects, which store the persistent state. These objects  synchronize their state with the database depending on your flush strategy (i.e. auto-flush where as soon as setXXX() method is called or an item is removed from a Set, List  etc or define your own synchronization points with session.flush(), transaction.commit() calls). If you remove an item  from a persistent collection like a Set, it will be removed from the database either immediately or when flush() or commit() is called depending on your flush strategy. They are Plain Old Java Objects (POJOs) and are currently associated with a session. As soon as the associated session is closed, persistent objects become detached objects and are free to use directly as data transfer objects in any application layers like business layer, presentation layer etc.  

Detached objects and collections are instances of persistent objects that were associated with a session but currently not associated with a session. These objects can be freely used as Data Transfer Objects without having any impact on your database. Detached objects can be later on attached to another session by calling methods like session.update(), session.saveOrUpdate() etc. and become persistent objects.

Transient objects and collections are instances of persistent objects that were never associated with a session. These objects can be freely used as Data Transfer Objects without having any impact on your database. Transient objects become persistent objects when associated to a session by calling methods like session.save( ), session.persist( )  etc.



Q19. Why use JAXB in your Java project?
A19. JAXB interview questions and answers.

If the organization you are being interviewed for is using an agile methodology, then you will be probed on agile development practices.

Q20a. What are the pros and cons of agile development methodology
A20a.  Pros and cons of agile development methodology.

Q20b. What is the difference between agile theme, epic and story?
A20b. Understanding theme, epic, and story



Java Interview Questions and Answers

1-5 for experienced developers 6-10 for experienced developers 11-16 for experienced developers 17-20 for experienced developers

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home