Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, June 6, 2026. Learn more…

Leanpub Header

Skip to main content

The Java and Spring Boot Interview Compendium

Interview Questions and Answers for Java and Spring Boot Developers

A practical backend interview reference covering modern Java and Spring Boot development (1363 manuscript pages).

Minimum price

$14.99

$24.99

You pay

Author earns

$
PDF
About

About

About the Book

The Java and Spring Boot Interview Compendium is a structured technical interview reference for developers working with modern Java and Spring-based applications.

The content is organized around the core language, runtime, concurrency, persistence, API, architecture, and framework topics that experienced engineers are commonly expected to explain in interviews. Each section combines concise explanations with practical examples so readers can review both foundational concepts and real implementation tradeoffs.

The book is designed to help developers revisit important Java and Spring Boot concepts in a practical way, with a strong focus on modern language features, framework usage, and production-oriented design decisions.

Author

About the Author

Yohan Rodriguez

Yohan is a Senior Full-Stack Software Engineer with extensive experience delivering scalable, end-to-end software solutions across web, enterprise, and cloud-based environments. He specializes in architecting robust platforms, modernizing legacy systems, driving cloud transformation efforts, and building integration-heavy applications that support critical business workflows. He is recognized for translating complex requirements into reliable, maintainable, and high-value solutions across industries such as insurance, cybersecurity, and professional services.

Known for combining strong technical execution with a practical business mindset, he has contributed to projects from concept and design through production delivery and long-term support. His experience includes collaborating with cross-functional teams, improving development workflows, solving complex technical challenges, and helping organizations deliver dependable software products that adapt to changing business needs. He brings a balanced approach to engineering that values quality, efficiency, and continuous improvement.

Contents

Table of Contents

  • Preface i
  • 1 Java Version History and Evolution 1
    • 1.1 Key Java Versions 1
    • 1.2 Migration and Compatibility 10
    • 1.3 Important Feature Deep Dives 14
    • 1.4 Advanced Version Topics 23
    • 1.5 Interview Scenarios and Comparisons 49
    • 1.6 Practical Java Evolution 72
  • 2 Java Fundamentals 84
    • 2.1 Java Basics 84
    • 2.2 Type System and Conversions 92
    • 2.3 Strings and Immutability 95
    • 2.4 Enums and Constants 98
    • 2.5 Object Class Methods 102
    • 2.6 Advanced Fundamentals 105
    • 2.7 Memory and Performance Fundamentals 117
    • 2.8 Interview Scenario Questions 129
    • 2.9 Debugging and Scenario Questions 142
    • 2.10 Coding Challenge Questions 160
  • 3 Object-Oriented Programming in Java 170
    • 3.1 Core OOP Concepts 170
    • 3.2 Object Class and Contracts 178
    • 3.3 Interfaces and Abstract Design 182
    • 3.4 Inheritance and Polymorphism 188
    • 3.5 Inner and Nested Classes 196
    • 3.6 Advanced OOP 203
    • 3.7 Design Decision Questions 230
    • 3.8 OOP Coding Challenges 253
  • 4 Collections and Data Structures 266
    • 4.1 Core Collections 266
    • 4.2 Advanced Collections 273
    • 4.3 Concurrent Collections 276
    • 4.4 Immutable and Utility Collections 282
    • 4.5 Choosing the Right Collection 288
    • 4.6 Performance and Internals 297
    • 4.7 Scenario-Based Questions 303
    • 4.8 Data Structure Implementation Questions 314
    • 4.9 Collections Coding Challenges 334
  • 5 Generics, Streams, and Lambdas 345
    • 5.1 Generics 345
    • 5.2 Lambda Expressions and Functional Interfaces 350
    • 5.3 Streams 354
    • 5.4 Advanced Generics 359
    • 5.5 Advanced Stream Operations 364
    • 5.6 Optional 374
    • 5.7 Functional Programming Patterns 379
    • 5.8 Stream Performance and Pitfalls 382
    • 5.9 Advanced Generics Scenarios 392
    • 5.10 Interview Coding Challenges 402
    • 5.11 Stream Coding Challenges 416
  • 6 Exception Handling and Annotations 425
    • 6.1 Exception Handling 425
    • 6.2 Annotations 434
    • 6.3 Advanced Exception Handling 440
    • 6.4 Advanced Annotations 448
    • 6.5 Exception Design Patterns 458
    • 6.6 Annotation Internals and Patterns 469
    • 6.7 Exception Scenarios 483
    • 6.8 Exception Coding Challenges 499
  • 7 Concurrency and Multithreading 511
    • 7.1 Thread Basics 511
    • 7.2 Synchronization and Locks 517
    • 7.3 Concurrency Utilities 523
    • 7.4 Thread Safety and Atomic Operations 529
    • 7.5 Concurrent Data Structures 537
    • 7.6 Advanced Concurrency 545
    • 7.7 Concurrency Patterns 553
    • 7.8 Debugging and Diagnostics 562
    • 7.9 Modern Concurrency 572
    • 7.10 Concurrency Interview Scenarios 581
    • 7.11 Concurrency Coding Challenges 600
  • 8 JVM, Memory Management, and Performance 612
    • 8.1 JVM Architecture 612
    • 8.2 Memory and Performance 618
    • 8.3 Advanced JVM Internals 627
    • 8.4 Diagnostics and Monitoring 639
    • 8.5 Advanced JVM Topics 651
    • 8.6 Performance Scenarios 671
    • 8.7 JVM Coding Challenges 692
  • 9 Design Patterns 705
    • 9.1 Creational Patterns 705
    • 9.2 Structural Patterns 711
    • 9.3 Behavioral Patterns 714
    • 9.4 Additional Patterns 720
    • 9.5 Enterprise and Spring Patterns 741
    • 9.6 Pattern Application Scenarios 764
    • 9.7 Pattern Coding Challenges 781
  • 10 OOP Design and Best Practices 794
    • 10.1 SOLID Principles 794
    • 10.2 Clean Code and Refactoring 801
    • 10.3 Advanced Design 806
    • 10.4 Design Principles in Practice 819
    • 10.5 Real-World Design Scenarios 843
    • 10.6 Design Coding Challenges 869
  • 11 Spring Fundamentals and Dependency Injection 882
    • 11.1 Inversion of Control and Dependency Injection 882
    • 11.2 Bean Configuration and Lifecycle 887
    • 11.3 Configuration and Profiles 894
    • 11.4 Advanced Spring Concepts 896
    • 11.5 Spring Context and Environment 906
    • 11.6 Spring Internals 917
    • 11.7 Spring Configuration Patterns 926
    • 11.8 Spring Debugging and Scenarios 936
    • 11.9 Spring Coding Challenges 953
  • 12 Spring Boot and REST APIs 966
    • 12.1 Spring Boot Fundamentals 966
    • 12.2 Building REST APIs 971
    • 12.3 API Best Practices 979
    • 12.4 Advanced REST API Topics 982
    • 12.5 Spring Boot Internals 991
    • 12.6 Advanced REST Patterns 1001
    • 12.7 Production Readiness 1011
    • 12.8 REST API Scenario Questions 1022
    • 12.9 REST Coding Challenges 1040
  • 13 JPA, Hibernate, and Persistence 1054
    • 13.1 JPA Fundamentals 1054
    • 13.2 Queries and Transactions 1064
    • 13.3 Spring Data JPA 1071
    • 13.4 Advanced Persistence 1074
    • 13.5 Performance Optimization 1096
    • 13.6 Advanced JPA 1107
    • 13.7 Persistence Scenarios 1119
    • 13.8 Persistence Coding Challenges 1139
  • 14 Testing and Quality 1154
    • 14.1 Unit Testing with JUnit 5 1154
    • 14.2 Mocking with Mockito 1163
    • 14.3 Spring Boot Testing 1174
    • 14.4 Advanced Testing 1183
    • 14.5 Testing Strategies 1193
    • 14.6 Advanced Testing Techniques 1204
    • 14.7 Testing Scenarios 1215
    • 14.8 Testing Coding Challenges 1236
  • 15 Security, Architecture, and Deployment 1252
    • 15.1 Spring Security Fundamentals 1252
    • 15.2 JWT and Token-Based Security 1261
    • 15.3 Security Best Practices 1269
    • 15.4 Application Architecture 1274
    • 15.5 Deployment and DevOps 1287
    • 15.6 Advanced Security 1295
    • 15.7 System Design and Scalability 1305
    • 15.8 Architecture Decision Questions 1316
    • 15.9 Architecture Coding Challenges 1338

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub