Shalini's Bank of Java Interview Questions

Core Java

  1. What is an abstract class? Where can it be applied? 
  2. What does the word interface mean in java?
  3. What are inner classes? How many different ways are used to implement inner classes?
  4. What is object cloning?
  5. How is a shallow copy different from a deep copy? Why would you use one over the other?
  6. What advantage does coding to an interface offer?
  7. What happens when the JVM is initialized?
  8. How are exceptions handled in Java?
  9. What is the importance of the finally block?
  10. Why should you avoid the use of printStackTrace()?
  11. What are the only few cases where you should extend Runtime Exception?
  12. What are the three elements of PIE and why are they important?
  13. How is abstraction implemented in Java?
  14. Does Java use call-by-value or call-by-reference?
  15. Where do objects and primitives live in memory?
  16. What is the difference between StringBuilder and StringBuffer?
  17. What are some ways of increasing the efficiency of your system?
  18. What are some applications of Enums?
  19. What are access modifiers?
  20.  
  21. What is JDBC technology? Why is it needed?
  22. What does Class.forName() accomplish?
  23. What are the three objects JDBC uses to objectify SQL statements?
  24. What are the various types of JDBC drivers?
  25. What are the uses of a JDBC DataSource?
  26. What is JDBC connection pooling?
  27. What are the functions of DriverManager?
  28. What does the JDBC driver do? Which is the right type of driver for an application?
  29. What are the different layers that the JDBC architecture defines ?
  30. What are RowSets?
  31. Define the steps to JDBC Connectivity. 
  32. How are arrays represented in Java? 
  33.  
  34.  How does synchronization work in inheritance?
  35. Is there a way to make sure your thread has completed execution?
  36. How do you detect a deadlock in Java?
  37. What is the best way to create a thread?
  38. What are some applications of the single-threaded model?
  39. What is the fork and join model and how is it implemented in Java?
  40. What is the difference between sleep() and wait() methods?
  41. Explain synchronized and volatile keywords.
  42. What is the best way of using guarded blocks?
  43. Where would you use the wait() method? 
  44. When would you use the notify() method as opposed to notifyAll() method?
  45. What are the various stages in the life cycle of a thread?
  46. What are Re-entrant locks? 
  47. How do you implement the Read-Write Lock pattern?
  48. What is the Producer Consumer pattern? How can you implement it in Java?
  49. What are Lock objects? How do they work?
  50. How can you use task scheduling in Java?
  51. What are atomic variables? How are they useful?
  52. How do you use ThreadLocal
  53. How will you define lock scope? In what ways can you implement it in Java?
  54. What is lock fairness? Is it achievable?
  55. How do you nest locks in java?
  56. Give an example of a deadlock. How do resolve a deadlock situation?
  57. What are semaphores?How many different kinds of semaphores are there?
  58. What does mutex mean? How is it different from a monitor?
  59. What is a condition or event variable
  60. How would you describe a synchronization barrier? Is it the same as a critical section?
  61. What is a countdown latch? How is it different from an exchanger?
  62. How do you detect deadlocks?
  63. Does the JVM handle deadlocks? How can you prevent your application from going into a deadlock?
  64. What is an automatic lock release? How does it work?
  65. How do timeouts work in deadlock resolution?
  66. What is lock starvation? How is different from CPU starvation?
  67. How does synchronization work for a recursive function? 
  68.  Can you call non-synchronized methods on an object under lock?
  69. How does synchronization work on a static level?
  70. Describe the new thread pooling feature added in Java 5.
  71. How do you define a data structure?
  72. What algorithms have been provided by Java for iterating through a data structure?
  73. What is the difference between implementing the Comparable vs the Comparator interfaces?
  74. What is key collision and how can it be resolved?
  75. What is an unbounded queue?
  76. What advantages does a CopyOnWrite data structure offer?
  77. Which data structures are represented in Java? (Map, List, Set, Queue, Stack, Tree, Trie)
  78. How is a HashMap different from a Hashtable
  79. Why would you use a Linked data structure?
  80. What advantages does a Concurrent data structure offer?
  81. What are thread-aware classes?
  82. How does an iterator solve the concurrent modification problem?
  83. What advantage does a thread-safe collection offer over a non-thread-safe one?
  84. How has thread-notification been implemented in the Java Collections framework?
  85. What is an Enumeration? How is it used? How is it different from an Iterator?
  86. Can you remove elements from the middle of a Queue?
  87. What is the advantage of using the volatile keyword?
  88. How is the transient keyword applied?
  89. Which implementation of FIFO is available in Java?
  90. How about LIFO? What are the advantages of the various implementations?