Java Inter Q

Prateek
2 min readMar 3, 2022

--

Core Java:

  1. What are the SOLID design patterns
  2. Singleton Design Patterns — it should not breakable by any ways. How to unit test it?
  3. Why we use volatile while using Singleton design patterns.
  4. What are the types of lock?
  5. Assume Employee as a key storing into HashMap, I am inserting 5 elements into HashMap say e1 to e5. I’ve implemented Equals and HashCode, hashcode always returns 1. What will be the size of HashMap? Any performance issues?
  6. Array of 10 elements, using Java 8 — multiply each element by 5.
  7. How to calculate the occurrence of “I” in India is my Country.
  8. What is Aggregation and Composition.
  9. Java program to say “123” is consecutive
  10. Performance Tuning.
  11. How to handle security in your project.
  12. Data Structure maintain uniqueness and insertion order.
  13. What is Immutable in Java and its advantages. Scenario where you want to use Immutable class.
  14. What is Executor Service. Thread Pool Executor.
  15. What is the parent of Exception? Where Error stands?
  16. What is concurrentHashMap? How its working internally?
  17. Difference between Java Singleton vs Spring Singleton?
  18. What is the basic difference between Abstraction and Inheritance?
  19. What is the basic difference Abstract class and Interfaces?
  20. What is the difference between Public, Private, protected and default?

Spring Core:

  1. What is Dependency Injection (DI)?
  2. Types of Autowiring? Which one is by default.
  3. Types or implementations of ApplicationContext?
  4. What is the use of @Primary annotation?
  5. What are stereotype annotations?
  6. Explain Bean lifecycle
  7. What is the difference between Bean Factory and Application Context?
  8. What to avoid Circular dependency issue?
  9. Injecting prototype bean into Singleton bean?
  10. What is the difference between DI and IOC?

Spring Boot

  1. How to disable @AutoConfigurations?
  2. What is Actuator in Spring Boot ?
  3. How can we override tomcat?
  4. How to exclude the package?

Spring REST:

  1. Why to use Rest Over SOAP?
  2. What is difference between HTTP PUT vs POST?
  3. What are different HTTP status code?
  4. What is the difference between JaxRs and JaxWs?

Microservices:

  1. What is Consumer Driven Contract (CDC)?
  2. Reactive Instance?
  3. How can we do monitoring in Microservices?
  4. What is APIGW?
  5. What is Saga? What are the types of Saga? How to implement the distributed transaction?

--

--

Prateek
Prateek

Written by Prateek

Java Developer and enthusiast

No responses yet