Jul 30, 2011

Core Java Career Essentials -- Java developer job Interview Questions

The “Core Java Career Essentials” book has been published, and available via  and (PDFs). 250+ technical, open-ended, coding, scenario based, and frequently asked questions are answered with lots of examples and code snippets not only for interview preparation, but also to clarify your fundamentals and progress in your career. Some of the popular questions answered in the “Core Java Career Essentials” are:

  1. Can you list the Java SE features you really love and why?
  2. Can you list the Java SE features you like to be added in the future?
  3. What are your favorite areas of the Java APIs and why?
  4. What are some of the very common runtime (or unchecked) exceptions you have come across in Java? When is a ConcurrentModificationException thrown?
  5. In your experience, what are some of the most common errors Java programmers make?
  6. Can you give some examples of where you used “sed” and “awk” utilities?
  7. What tools do you generally need to get your job done?
  8. What do you expect to see in a high level or detailed technical specification document?
  9. How will you ensure quality of your design and code?
  10. Can you list some of the key aspects you keep in mind while coding to ensure quality & robustness?
  11. What does the following code do? Can you talk us through the code highlighting some of the key language and design features? ….....
  12. Can you explain why the code snippet under (a) gives a compile-time error and code snippet under (b) compiles and runs with an output of 20? ….....
  13. What is wrong with the following code, and how will you fix it?
  14. Can you list some practical applications where the bit-wise operations can be applied?
  15. How would you take advantage of Java being a stack based language? What is a re-entrant method?
  16. Can you explain if the following classes are badly designed?
  17. What do you achieve through good class and interface design?
  18. How will you improve on the following code snippets with appropriate design principles? ….
  19. How would you go about designing a system as described below? ….....
  20. How would you go about designing a car parking station?
  21. Can you talk through the output of the following code snippet?.....
  22. How do you know if your garbage collector is under heavy use? What are the best practices to minimize heavy use of garbage collection?
  23. If you have large if-else or switch-case statements, what would come to your mind?
  24. What are the common data structures, and where would you use them?
  25. What do you know about the big-O notation and can you give some examples with respect to different data structures?
  26. What is the tradeoff between using an unordered array versus an ordered array?
    If Java did not have a HashMap implementation, how would you go about writing your own one?
  27. Can you write an algorithm to.....?
  28. Write a program that allows you to create an integer array of 5 elements with the following values: int numbers[ ]={5,2,4,3,1}. The program computes the sum of first 5 elements and stores them at element 6, computes the average and stores it at element 7 and identifies the smallest value from the array and stores it at element 8.
  29. Can you write a code to evaluate( ) a simple mathematical calculation as shown below using a binary tree?
  30. Can you suggest the most appropriate data structure for each of the following scenarios given below? …......
  31. What do you understand by greedy, reluctant, and possessive quantifiers? What do you understand by the term “backtracking”?
  32. Can your write a function that will replace all tokens delimited by @ with a given String?
           Sample Input = “Hello @name@, where are you @name@?”

Why should you favor composition over inheritance?