🧬28 questions
Advanced Java
Concurrency, JVM tuning, memory model, virtual threads.
ConcurrencyVirtual ThreadsMemory ModelGC TuningReflectionClass Loading
Sample Questions (28 live)
ConcurrencyMedium
What is synchronization and why do we need it?
AmazonDeloitteMicrosoftRead →
ConcurrencyMedium
What is a thread and how is it different from a process?
AmazonMicrosoftDeloitteRead →
Virtual ThreadsHard
What are Virtual Threads (Project Loom) in Java 21?
AmazonMicrosoftGoogleRead →
JVM InternalsMedium
Beyond the definitions, what actually happens between javac and native execution across the JDK, JRE and JVM?
AmazonOracleMicrosoftRead →
Class LoadingHard
Explain the ClassLoader hierarchy (Bootstrap, Platform, Application) and how you'd write a custom class loader.
OracleAmazonMicrosoftRead →
Class LoadingHard
When and how do you deliberately break the parent-delegation model?
OracleAmazonRed HatRead →
Memory ModelHard
How do you reason about safe publication and reordering with the Java Memory Model in lock-free code?
GoogleAmazonMicrosoftRead →
MemoryMedium
How do JVM thread stacks work, and what's the difference between StackOverflowError and OutOfMemoryError?
AmazonMicrosoftDeloitteRead →
Garbage CollectionHard
How do the modern collectors (Parallel, G1, ZGC, Shenandoah) trade off throughput vs latency, and how do you choose?
AmazonNetflixGoogleRead →
ReferencesHard
How do you build a leak-free cache or cleanup mechanism with soft, weak and phantom references?
AmazonGoogleOracleRead →
SerializationMedium
What is the difference between Serializable and Externalizable, and when would you implement Externalizable?
OracleAmazonDeloitteRead →
SerializationMedium
What does the transient keyword do, and what are its gotchas?
InfosysTCSAccentureRead →
ReflectionMedium
What is the Reflection API, and what are its costs and risks?
AmazonOracleMicrosoftRead →
Dynamic ProxyHard
How do Java dynamic proxies work, and how do frameworks use them for AOP?
AmazonMicrosoftOracleRead →
AnnotationsMedium
How do Java annotations work — retention policies, targets, and how are they processed?
AmazonOracleInfosysRead →
OrderingHard
How do you compose Comparators safely, and why must ordering be consistent with equals?
AmazonMicrosoftDeloitteRead →
Object ContractHard
How does the equals()/hashCode() contract break under inheritance, and with ORM proxies?
AmazonOracleMicrosoftRead →
ImmutabilityMedium
Beyond final fields, how do you guarantee deep immutability with defensive copies and immutable collections?
AmazonMicrosoftOracleRead →
GenericsHard
How do bounded wildcards and the PECS rule let you design flexible generic APIs?
GoogleAmazonMicrosoftRead →
GenericsHard
What is heap pollution with generic varargs, and when is @SafeVarargs appropriate?
GoogleOracleAmazonRead →
CollectionsMedium
How do you safely modify a collection while iterating it, and what causes ConcurrentModificationException?
InfosysAmazonTCSRead →
ExecutorsHard
How do you shut down an ExecutorService cleanly and handle rejected tasks?
AmazonMicrosoftNetflixRead →
ExecutorsMedium
Where do exceptions go when a task fails in an executor, and why does submit() swallow them?
AmazonMicrosoftDeloitteRead →
CompletableFutureHard
How do you handle errors, timeouts, and combine multiple CompletableFutures without blocking?
AmazonNetflixMicrosoftRead →
ForkJoinHard
How do you write a correct ForkJoin task, and why is the common pool a shared resource to respect?
GoogleAmazonMicrosoftRead →
ThreadLocalHard
What are ThreadLocals legitimately good for, and how do ScopedValues improve on them?
AmazonMicrosoftNetflixRead →
Modern JavaMedium
What are Records and Sealed Classes, and how do they enable data-oriented programming?
AmazonOracleMicrosoftRead →
Virtual ThreadsHard
In production, how do virtual threads pin, why shouldn't you pool them, and how does structured concurrency help?
AmazonNetflixGoogleRead →
Advertisement
Google AdSense slot