Friday, March 26, 2010

Developer Interview Questions

1. How is Polymorphism implemented in Java ?
Through interface and abstract class.
2. How do interface help implement polymorphism

3. What component in Axis webservices actually turns XML into objects?

4. How do you convert XML to java in REST
Manually process the XML, there is also the Jersey's framework (JAX-RS)

5. You have 3 tables Company (id, name), Employee(id, title), Person (id, firstName, lastName).
a) Write a query to output title, firstName, lastName of all employees in a given company_id
b) Write names of all companies where there are no employees.

6. What are three major collections in Java?
Map, List, and Set
7. What are the implementations of each, Map, Set and List

8. What's the difference between TreeMap and HashMap?

9. What two methods the class needs to implement for Collections and Why
equals() and hashCode()

10. A class has a synchronized static methodA and synchronize methodB. When two separate threads X, and Y calls these two methods at the same time what happens.
Thread X will get the Class lock on the class and Y will get the instance Lock and both will execute.

12. When you have a synchronized method that calls external methods what can go wrong?
The external method may make a call to the original synchronize method, creating a deadlock.

13. How do you deal with developers that don't want to do certain things, due to philosophical issues like "enter time"?

14. Given a binary tree, print out all the nodes at a given level n. For example at level 0, there is the root node, at level one there may be two, so print value of both. Note that this may be a unbalanced binary tree.

15. What tool do you use for code coverage, and for continuous integration.

16. Are you familiar with TDD?

17. What are some of the best practices for code review.

18. What was the most challenging problem you solved that you are proud of? What was your role.

19. What's the difference between abstract class and interface? When would you use one vs. the other?

20. What's the importance of equals() and hashCode() method?

21. Which type EJB do not have a home interface.

22. What interface must all classes needed persistence via Hibernate implement?

23. In Struts: What object containing request params gets passed to the Action.

24. In Spring: name the file that contains the bean wiring.

25. Is Servlet spec part of J2SE or J2EE?

26. Which Java 1.5 feature allows one to make type-safe collections?

27.

Sunday, March 07, 2010

Questions A Programmer Interviewee Should Ask

1. What is your development cycle/process?
2. What type of computers are developers given, are they free to choose MacOS?, Linux?
3. What do you use for source code control system?
4. Do you have build engineer?