Skip to main content
Backend & APIs

Java 21 LTS & Spring Boot Architecture Quiz (2026)

15 Questions15 MinsPass: 80%

Assess your skills in Java 21 LTS: Virtual Threads (Project Loom), Records, Pattern Matching, Spring Boot 3 autoconfiguration, and JVM.

Question 1 of 150% Completed
Single Choice

How do Java 21 Virtual Threads (Project Loom) differ from traditional Platform Threads?

Select an option above

Java: Assessment Scope & Sample Focus Areas

15 questions • 80% pass target

This interactive technical assessment checks your practical understanding of Java (Backend & APIs) across syntax behavior, edge cases, and architectural decisions.

Topic 1 of 15

How do Java 21 Virtual Threads (Project Loom) differ from traditional Platform Threads?

Topic 2 of 15

What is a Java `record` introduced in modern Java?

Topic 3 of 15

What does Pattern Matching for `switch` in Java 21 provide?

Topic 4 of 15

What is the difference between `@Component`, `@Service`, and `@Repository` in Spring Boot?

Topic 5 of 15

How does Spring Boot's `@Transactional` annotation manage database transactions?

Topic 6 of 15

What is the difference between G1GC and ZGC (Z Garbage Collector) in modern Java?

Frequently Asked Questions

Java Assessment: Key Technical Questions & Answers

5 Questions Answered
1How do Java 21 Virtual Threads (Project Loom) revolutionize concurrent server throughput?
Traditional Java platform threads are 1-to-1 wrappers around heavyweight OS kernel threads, consuming ~1MB of memory each and limiting servers to several thousand concurrent connections before thread starvation. Virtual Threads (Project Loom) are lightweight, user-mode threads managed directly by the JVM. When a Virtual Thread blocks on network I/O, the JVM unmounts it from its carrier OS thread, allowing millions of concurrent tasks to execute on a handful of OS cores.
2What is the difference between Java's G1 GC, ZGC, and Parallel Garbage Collectors?
Parallel GC maximizes raw batch throughput at the expense of noticeable Stop-The-World (STW) pauses. G1 GC (Garbage-First) partitions heap into equal regions and prioritizes regions with the most garbage, balancing throughput with bounded pause targets (e.g. 200ms). ZGC (Z Garbage Collector) is an ultra-low latency concurrent collector using colored pointers and load barriers to keep STW pauses under 1 millisecond, even on multi-terabyte heaps.
3What is the contract between `equals()` and `hashCode()` in Java?
If two objects are equal according to `equals(Object)`, they must return the same integer value from `hashCode()`. If `hashCode()` is not overridden alongside `equals()`, hash-based collections (`HashMap`, `HashSet`, `ConcurrentHashMap`) will calculate different bucket indexes for equivalent objects, resulting in failed retrievals (`map.get(key) == null`) and duplicate entries.
4What is the difference between `synchronized` methods, `ReentrantLock`, and `StampedLock` in Java concurrency?
`synchronized` is a JVM-level intrinsic monitor lock that automatically unlocks upon exiting the block, even during exceptions. `ReentrantLock` provides advanced capabilities like timed lock acquisition (`tryLock()`), interruptible locking, and fairness policies. `StampedLock` introduces optimistic reading (`tryOptimisticRead()`), allowing lock-free reads that validate a version stamp, drastically accelerating read-heavy concurrent workflows.
5How does the Java Memory Model (JMM) enforce visibility via the `volatile` keyword and happens-before order?
In multi-core systems, CPU cores cache variables in local L1/L2 caches. Declaring a variable as `volatile` guarantees that writes are immediately flushed to main memory and reads always fetch the freshest value, establishing a 'happens-before' relationship. It prevents the JIT compiler and hardware from reordering memory instructions across the volatile barrier, though it does not provide atomicity for compound operations like `count++`.

Next Steps for Mastery

Reinforce your knowledge with cheatsheets, interactive sandboxes, and interview prep.