⚙️25 questions
JVM
Memory areas, garbage collection, JIT, class loading, tuning.
Memory AreasGarbage CollectionGC TuningJITClass LoadingTroubleshooting
Sample Questions (25 live)
Memory AreasEasy
JVM vs JRE vs JDK — what's the difference, and which do you ship in a Docker image?
InfosysTCSCognizantRead →
Memory AreasEasy
How does Java achieve 'write once, run anywhere' via bytecode?
TCSInfosysWiproRead →
Memory AreasEasy
What are the main JVM memory areas, and which are shared vs per-thread?
InfosysCognizantAccentureRead →
Memory AreasEasy
Stack vs Heap — where do primitives, references and objects actually live?
TCSInfosysDeloitteRead →
Garbage CollectionMedium
Why is the heap split into young and old generations, and what's a minor vs major GC?
AmazonMicrosoftDeloitteRead →
Garbage CollectionMedium
How does garbage collection decide what to free — and what are GC roots?
AmazonGoogleMicrosoftRead →
Memory AreasMedium
What replaced PermGen with Metaspace, and how can you still get a Metaspace OOM?
AmazonDeloitteCognizantRead →
GC TuningMedium
How do you size the heap (-Xms/-Xmx), and what's special about JVMs in containers?
AmazonMicrosoftDeloitteRead →
GC TuningMedium
How do you choose a garbage collector — Serial, Parallel, G1, ZGC or Shenandoah?
AmazonGoogleMicrosoftRead →
GC TuningMedium
What is a stop-the-world pause, and how do you reduce GC pause times?
AmazonMicrosoftGoogleRead →
TroubleshootingMedium
What are the different OutOfMemoryError types, and what does each tell you?
AmazonMicrosoftDeloitteRead →
TroubleshootingMedium
How do you enable and read GC logs to diagnose a memory problem?
AmazonDeloitteGoogleRead →
Garbage CollectionMedium
Strong, weak, soft and phantom references — when do you use each?
AmazonGoogleMicrosoftRead →
JITMedium
How does JIT compilation work (C1/C2, tiered), and why is JVM warm-up a thing?
AmazonGoogleMicrosoftRead →
Garbage CollectionHard
How does G1 GC work internally — regions, mixed collections and humongous objects?
AmazonGoogleMicrosoftRead →
Garbage CollectionHard
How do ZGC and Shenandoah achieve sub-millisecond pauses on huge heaps?
GoogleAmazonMicrosoftRead →
JITHard
What is escape analysis, and how does it let the JVM allocate objects on the stack?
GoogleAmazonMicrosoftRead →
TroubleshootingHard
Walk me through diagnosing long GC pauses / high GC CPU in production.
AmazonGoogleMicrosoftRead →
TroubleshootingHard
What is off-heap / direct memory, and how do you track and bound it?
AmazonGoogleMicrosoftRead →
Class LoadingHard
How does the class loading delegation model work, and why do enterprise apps customize it?
AmazonMicrosoftDeloitteRead →
TroubleshootingMedium
How does Class-Data Sharing (CDS/AppCDS) cut JVM startup time, and why does it matter for containers and serverless?
AmazonGoogleRead →
JITHard
GraalVM Native Image vs a jlink'd JVM runtime — what do you actually give up for instant startup?
AmazonGoogleOracleRead →
JITHard
Why does timing a loop with System.currentTimeMillis() lie to you, and how does JMH avoid those traps?
AmazonGoogleOracleRead →
TroubleshootingHard
A Java service is pegging CPU with no errors logged — how do you find out why?
AmazonMicrosoftGoogleRead →
TroubleshootingMedium
How can a Stream or lambda closure quietly leak memory in a long-lived cache?
AmazonMicrosoftRead →
Advertisement
Google AdSense slot