Sunday, 5 August 2018

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
    • 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?
      • 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
  4. Data Structures and Algorithms
    • (all programming questions will be asked from here, must read for any interview)
    • Write Java code for Permutations
    • Write Java code for Combinations
    • Coin change problem (Total number of ways to get the denominations of coins) 
  5. System Design
  6. Multithreading
    • Explain about Volatile and its behavior with an example.
    • Difference between a Volatile variable and normal variable.
    • How JVM handles synchronization internally?

  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
This page will be updated regularly


Post a Comment

Note: only a member of this blog may post a comment.