[go: up one dir, main page]

0% found this document useful (0 votes)
4K views9 pages

Spring Boot Interview Questions Guide

Important spring boot questions

Uploaded by

roo4rohan26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4K views9 pages

Spring Boot Interview Questions Guide

Important spring boot questions

Uploaded by

roo4rohan26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Introduction
  • Java and Spring Boot FAQs
  • Sample Questions
  • Valuable Tips

1 – 4 YOE

Java &
Spring Boot Interview
101 Frequently asked questions
in skill based rounds of Product based companies, Big-4s,
Service based companies and client interviews
Follow me : Aishwarya Suryawanshi on
Disclaimer

Dear Job Aspirants,

As I share this list of 101 frequently asked questions on Java-Spring


boot, I want to emphasize the importance of understanding the
foundational concepts thoroughly. This list serves as a reference
and a tool for revision rather than a comprehensive guide to Java
programming. It's essential to dive deep into each concept and
practice extensively to gain a comprehensive understanding.

Java and Spring boot, with its vast ecosystem and evolving
updates, requires continuous learning and exploration. While these
questions can aid in revisiting key topics and refreshing your
knowledge, they should not replace hands-on practice and in-
depth study.

Wishing you all fruitful learning experiences and success in your


Java journey!
1. Which Java version have you used in your previous project? Tell some
features.
2. Why Java is Platform Independent?
3. JVM Architecture and working. (Question around it like - What is a
ClassLoader, JVM memory model etc)
4. What is String immutability?
5. What is the difference between == and equals()?
6. How is the creation of a String using new() different from that of a literal?
7. What is a String pool? When are Strings not stored in a String pool?
8. How to create an immutable class in Java?
9. StringBuffer vs StringBuilder. When to use what?
[Link] is the difference between public, protected, private, and default
access modifiers in Java?
[Link] does the final keyword work in Java?
[Link] class vs Interfaces
[Link] will happen if a class has a private constructor? Can you instantiate
this class?
[Link] you override a private or static method in Java? Explain.
[Link] you provide an example where method overloading is determined at
compile-time and method overriding at runtime?
[Link] it possible to call the base class method without creating an instance?
Provide an example.
[Link] you explain the difference between hiding and overriding in Java?
[Link] is runtime polymorphism or dynamic method dispatch?
[Link] internal working, what is the use of equals() and hashcode()?
[Link] an ArrayList be made Thread-safe?
[Link] are the differences between ArrayList and LinkedList?
[Link] does a TreeMap differ from a HashMap?
[Link] are some advantages of using a ConcurrentHashMap?
[Link] an ArrayList be made Thread-safe?
[Link] are the differences between ArrayList and LinkedList? [Such
differences can be asked between any Collection]
[Link] does a TreeMap differ from a HashMap?
[Link] are some advantages of using a ConcurrentHashMap?
[Link] modification you will do to make to HashMap a O(N) time complexity?
[Link] vs Comparator interface and when to use which one?
[Link] for producer-consumer problem
[Link] run() be overridden?
[Link] in Java
[Link] is the Executor framework in Java? With Example.
[Link] Odd/Even numbers in multiple threads.
[Link] are the differences between synchronized and volatile keywords?
[Link] of transient keyword?
[Link] the concept of thread safety in Java.
[Link] does the ForkJoinPool work?
[Link] between wait and sleep method.
[Link] is sleep method static?
[Link] it mandatory for a catch block to be followed after a try block?
[Link] is the difference between Error and Exception in Java?
[Link] is the difference between final, finally, and finalize()?
[Link] is the difference between throw and throws in Java?
[Link] are checked and unchecked exceptions?
[Link] does the finally block work?
[Link] inheritance with interfaces.
48. What is the diamond problem in Java? How does Java handle it?
49. Why static and default methods in interface were introduced in Java 8?
50. Given two interfaces which have the same default method, what will
happen in the implemented class with respect to the default method?
51. What are functional interfaces?
52. Which are some of the functional interfaces in Java?
53. Consumer, Supplier, Predicate, and Function Interfaces in Java 8. Examples
of each.
54. What is the Stream API and how is it used?
55. What is the difference between Stream and ParallelStream?
56. Explain the difference between map() and flatMap() in Streams.
57. Interviewer usually asks you to write code for various scenarios using
stream’s operations like filter, map, flatMap, sorted, distinct, limit, skip,
groupingBy etc)
58. What does an Optional class do?
59. What are lambda expressions and how are they useful?
60. What is a daemon thread?
61. Which were some new features added as part of Java 17 & 21?
62. What are Records (Java 17)?
63. Which design patterns have you used in your project?
64. What is the Singleton design pattern?
65. How can you make a Singleton thread-safe?
66. SOLID Principles (IMP) with example for each principle.
67. What is Maven or Gradle, and how does it healp in Java development?
68. What is dependency Injection? Ways of dependency Injection?
69. What are beans?
70. What is Application Context in Spring?
71. Key advantages of Spring boot over Spring.
72. Default scope in Spring boot?
73. What is the role of @SpringBootApplication?
74. How does a typical architecture of Spring boot Application look like?
75. What is Spring Initializer?
76. What is @Autowired?
77. Use of @Qualifier annotation.
78. What is difference between @Component, @Controller and
@RestController?
79. Why were sealed classes introduced? What do they do?
80. Garbage Collection in Java - Internal implementation.
81. What are the different types of garbage collectors in Java?
82. Is exceeding the memory limit possible in a program despite having a
garbage collector?
83. Explain the concept of memory leak in Java.
84. How does the reflection API work in Java?
85. Design Patterns in Java.
86. Explain the use of plugins in Maven and Gradle.
87. Jar vs WAR file
88. How to add custom server instead of built-in server in Spring boot
Application?
89. How to handle exceptions in Spring boot?
90. Difference between PUT and PATCH.
91. Commonly used HTTP status codes and the uses of each.
92. @RequestParam vs @PathVariable
93. What is Spring Boot Actuator? How do you enable and configure Spring
Boot Actuator?
94. What is Spring Data JPA, and how is it used in Spring Boot?
95. How can you create RESTful services using Spring Boot? Explain the use of
@RestController, @RequestMapping, @GetMapping, @PostMapping,
@PutMapping, and @DeleteMapping.
96. How does a typical Spring boot Application look like? What annotations will
you use?
97. How do you implement security in a Spring Boot application? Explain the use
of Spring Security and its features.
98. What are the different testing techniques available in Spring Boot?
99. How do you configure logging in a Spring Boot application?
[Link] are some common performance optimization techniques for Spring
Boot applications?
101. How can you implement caching in a Spring Boot application? Explain the
use of @Cacheable, @CachePut, and @CacheEvict annotations.
Please note that there are chances of the interviewer asking questions on the
advanced Spring boot topics, CI/CD, Version control, build tools, Microservice
architecture, distributed event streaming platforms used in projects and the
databases used.

SAMPLE QUESTIONS
[This is just a sample, questions will be asked based on your projects only]
• If you used Maven in projects. What is Parent POM and why we use it usually
in our projects?
• Explain the use of WebFlux, Mono, and Flux in Spring Boot applications.
• What is CI/CD?
• Different between Microservices and Monolithic Architecture. When to use
which one?
• How do you handle merge conflicts in Git?
• Explain the differences between synchronous and asynchronous
communication in microservices.
• How can you deploy and manage microservices at scale?
• How do you ensure fault tolerance and resilience in microservices?
• How do you implement load balancing in a microservices environment?
• Explain the difference between horizontal and vertical database partitioning.
• What is database sharding, and why is it used?
• What is Apache Kafka/RabbitMQ?
• How does Kafka achieve high throughput and low latency?
• What are consumer groups in Kafka, and how do they work?
• Various DB queries.
Along with this, you can also be asked to design any API (Endpoints of API,
appropriate HTTP methods -GET, POST, PUT, DELETE for CRUD operations,
Database, non-functional aspect etc).
Some Valuable Tips!

1. Know Your Projects: Be ready to discuss your past projects,


focusing on your role, technologies used, and challenges
overcome. Interviewers will definitely asked this question.

2. Understand the Job Description: Align your responses with the


skills and experiences the employer seeks.

3. Communicate Clearly with Examples if possible: Explain


technical concepts simply and clearly. Articulate your thought
process well. Give example whenever needed.

4. Be Confident: Speak clearly and assertively. Admit if you don’t


know something but show willingness to learn.

5. Research the Company: Learn about the company’s products,


culture, and recent news. Be ready to explain why you want to
work there.

All The Best!


Follow me : Aishwarya Suryawanshi on

Follow me : Aishwarya Suryawanshi on 
Java  &
1 – 4 YOE
Spring Boot  Interview
101 Frequently asked questions 
in skill based
Disclaimer
Dear Job Aspirants,
As I share this list of 101 frequently asked questions on Java-Spring 
boot, I want to emphasi
1. Which Java version have you used in your previous project? Tell some 
features.
2. Why Java is Platform Independent?
3. JV
22.How does a TreeMap differ from a HashMap?
23.What are some advantages of using a ConcurrentHashMap?
24.Can an ArrayList be
48. What is the diamond problem in Java? How does Java handle it?
49. Why static and default methods in interface were introd
71. Key advantages of Spring boot over Spring.
72. Default scope in Spring boot?
73. What is the role of  @SpringBootApplicat
94. What is Spring Data JPA, and how is it used in Spring Boot?
95. How can you create RESTful services using Spring Boot? Ex
Please note that there are chances of the interviewer asking questions on the 
advanced Spring boot topics, CI/CD, Version co
Some Valuable Tips!
1. Know Your Projects: Be ready to discuss your past projects, 
focusing on your role, technologies used,

You might also like