Topics to Prepare for Java Interview

Companies looking for Java developers who have experience in following topics

1. Core Java
2. Java 8
3. Multithreading (must)
4. Spring
5. Spring Boot (Micro Services)
6. Hibernate
7. XML
8. Concurrency
9. Algorithms


10. Data structures
11. Design patterns
12. Object-Oriented Design
13. Architecture patterns
14. MVC Design
15. RESTful web services
16. Maven
17. MongoDB
18. Git
19. JUnit & Mockito
20. System Design

Links to refer:
  1. Design patterns
    • https://www.youtube.com/watch?v=EYOKqb2Mf7k&list=PLmCsXDGbJHdjZiLC2HjXrgw8-E4O3MXdN
    • Singleton
      • Implement Singleton using Eager Initialisation
      • Implement Singleton using Lazy Initialisation
      • What is the Double-Checked Locking?
      • When Double-Checked Locking fails?
      • How can you fix Double-Checked Locking fail? Ans: use Volatile
    • Factory 
    • Abstract Factory - Factory of Factories
  2. Spring
    • Spring core
    • Spring transactions
    • Spring JDBC
    • Spring MVC
  3. CoreJava & Java8
    • OOPS concepts
      • What is Encapsulation?
      • What is Polymorphism?
    • Streams
    • Lambda expressions
    • Functional interfaces
    • Method references
    • Constructor references
    • Exceptions
      • Difference between Checked and Runtime Exceptions
      • Create your own Exception
      • How can you create your own Checked Exception?
      • How can you create your own Runtime Exception?
      • When will we get CloneNotSupportedException? Is this checked or runtime exception?
      • When will we get NotSerializableException? Is this checked or runtime exception?
      • Difference between throw and throws keywords?
      • Difference between Error and Exception?
        • Errors (Environment specific, cannot be recovered immediately)
          • VirtualMachineErrors such as OutOfMemoryError, StackOverflowError, InternalError, UnknownError.
          • Environment related errors.
          • Errors are always unchecked. 
        • Exceptions (Application specific, caused by application code) 
          • NullPointerException
          • ClassCastException

    • Access Specifiers
      • difference between public, private, protected, default access specifiers.
    • Difference between final, finalize, finally keywords?
    • How to create an Immutable class?
    • How to create a clone of an Object?
    • Serialization
      • What is Marker interface?
      • what is the use of readResolve() method?
        • https://www.math.uni-hamburg.de/doc/java/jdk1.4.1/docs/guide/serialization/spec/input.doc7.html
      • Difference between Serializable and Externalizable?
    • Enums
      • Can Enum have a constructor? Yes
      • What is the purpose of a constructor in Enums? Ans: Can be used to initialize instance fields. 
      • Enum constructor must be either private or default. you can not declare as public or protected.
      • Can Enum have abstract methods? Yes, in this case, each instance of enum must implement it. 
      • Explain about EnumSet, EnumMap
      • Can Enum extend other class? No, by default extends java.lang.Enum class. 
      • List of enum constants must be separated by commas (,) and terminated by a semi-colon (;).
      • If enum contains fields and methods, these must come after the list of enum constants. 
      • Can a class extend enum? No, Enums are final by default. 
      • Can you instantiate an Enum type? No. Compilation Error - enum types may not be instantiated. 
    • Inheritance
      •  If the superclass method declares an exception, subclass overridden method can declare same, subclass exception or no exception but cannot declare parent exception.
    • Practice Links
      • https://www.geeksforgeeks.org/java-multiple-choice-questions/
      • https://www.geeksforgeeks.org/output-of-java-programs-set-10-garbage-collection/
  4. Data Structures and Algorithms
    • https://www.geeksforgeeks.org/ (all programming questions will be asked from here, must read for any interview)
    • https://www.geeksforgeeks.org/greedy-algorithms-set-1-activity-selection-problem/
    • Write Java code for Permutations
      • https://introcs.cs.princeton.edu/java/23recursion/Permutations.java.html
    • Write Java code for Combinations
    • Coin change problem (Total number of ways to get the denominations of coins) 
      • http://www.techiedelight.com/coin-change-problem-find-total-number-ways-get-denomination-coins/
  5. System Design
    • https://www.slideshare.net/jboner/scalability-availability-stability-patterns/
    • https://www.infoq.com/presentations/Twitter-Timeline-Scalability
    • http://massivetechinterview.blogspot.com/search/label/System%20Design
    • https://www.youtube.com/watch?v=PE4gwstWhmc
    • https://doubleclix.wordpress.com/2010/11/11/google-a-study-in-scalability-and-a-little-systems-horse-sense/
  6. Multithreading
    • Explain about Volatile and its behavior with an example.
    • Difference between a Volatile variable and normal variable.
    • How JVM handles synchronization internally?
      • https://www.artima.com/insidejvm/ed2/threadsynchP.html

  7. Hibernate
    • what is pessimistic locking?
    • what is optimistic locking?
    • What is lock mode? 
    • Explain about Transactions and Acid properties. 
    • How Distibuted TransactionManager and EntityManager work together?
    • How hibernate implements concurrency control? 
      • Hibernate inherit the isolation guarantees provided by the database management system. for example, Hibernate never locks anything in memory. 
    • What is the isolation level JPA assumes by default? ans: Read Committed isolation level. 
  8. Database
    • How database systems provide isolation among transaction?
      Ans: using locking and some modern database engines implement transaction isolation with multiversion concurrency control (MVCC), which vendors generally consider more scalable. 
  9. JTA
    • https://www.codeproject.com/Articles/143432/An-Introduction-to-Bitronix-JTA-Transaction-Manage
This page will be updated regularly

Comments