Showing posts with label Interview. Show all posts
Showing posts with label Interview. Show all posts

Monday, June 2, 2014

Question Series - Common Questions


Question 1: How would you improve performance of a Java application
Answer:
1. Pool valuable system resources
2. Optimize IO Operation
3. Minimize Network overhead
4. Check if you have memory problem and manage object efficiently.

Question 2: What is the performance tips?
1. ArrayList/Hashmap over Vector/Hashtable
2. Set proper initial size for collections
3. Don't use exception to control flow
4. Minimize casting
5. Avoid using system.out, use log4j

Question 3: How would you detect and minimise memory leaks in java ?
Detect memory leaks
1. Use tool like JProbe
2. Use OS Process Monitor
3. use totalMemory and freeMemory
Minimize memory leaks:
1. Use object's lifecycle
2. Unreachable collection objects cause memory problem
3. Use WeakHashMap
4. Free native resources

Question 4: Why out of memory error happens?
1. Increase heap size. Java -Xms1024M -Xmx1024M
2. Increase perm size. Java -XX:PermSize=256M -XX:MaxPermSize=256M
3. Have memory leak in your app

Question 5: Why does the JVM crash with a core dump or Dr. Watson error?
1. Use JNI Code
2. The OS needs a patch
3. JVM has a bug for translation

Question 6: What design patterns have you used before ?
1. Strategy, Iterator, Decorator, Visitor, Singleton, Factory, Command and MVC.
2. UML, BusinessDelegate, VO

Question 7:




Friday, February 14, 2014

2014 Java Notes

Vision:
1. There is a trend to move from EJB to Spring, from JEE Server to open source server, from cluster app to Cloud application, from statefull application to stateless application.
2.

Popular:
1.  Cloud, Stateless application, REST, Angular,
2.

Face-Out:
1.  EJB is retiring. Not too many companies use EJB any more.
2.  MVC is faced out. The more popular is HTML5/CSS3/Angular/JQuery + Play Framework
3.

New:
1.  Play Framework, Angular, Single Page Application,

Challenges:
1.  Tomcat vs Play Framework
2.  Tomcat vs OSGI

Fundamental:
Java Core,
JEE(JSP, Servlet)
JDBC, JPA, OpenJPA, JMS,
Spring(SpringData, SpringMVC, SpringJDBC, Spring AOP)
Design Patterns(Business Delegate, Factory Pattern, Abstract Factory Pattern, Session Facade, Value Object, Fast Lane Reader, Service Locator, Lazy Loading, )



Phase Out:
EJB, JNDI, RMI