All fields

“JVM” in Information Technology

33 questions across 2 technologies.

Information Technology

33 questions in 2 technologies

#QuestionTechnologyTopicLevel
1What is the role of the ClassLoader in the JVM, and what are the three built-in bootstrap/platform/application class loaders? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationBeginner
2What is garbage collection in the JVM, and what fundamental problem does it solve compared to manual memory management (like in C/C++)? Java › Garbage CollectionJavaGarbage CollectionBeginner
3How does the generational hypothesis (most objects die young) inform the JVM's generational heap structure (young generation, old generation), and how does a minor GC differ from a major/full GC? Java › Garbage CollectionJavaGarbage CollectionIntermediate
4What is bytecode verification, and what specific categories of invalid or unsafe bytecode does the JVM's verifier reject before allowing a class to run? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
5How does the same class name loaded by two different ClassLoaders create two genuinely distinct types in the JVM, and what problems does this cause (such as with singletons or ClassCastException)? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
6How does Class Data Sharing (CDS) and Application Class Data Sharing (AppCDS) improve JVM startup time, and how does it relate to class loading and verification? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
7What is the purpose of the -Xverify:none (or newer -noverify) JVM flag, and why is disabling bytecode verification generally discouraged? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
8What is hot class reloading/redefinition (via Instrumentation.redefineClasses() or a JVM agent), and what are its practical limitations compared to a full class unload/reload? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
9What is the purpose of the addSuppressed() mechanism and getSuppressed() method on Throwable, and in what specific scenario does the JVM automatically populate suppressed exceptions? Java › ExceptionsJavaExceptionsIntermediate
10How would you use JVM flags to tune heap size (-Xms, -Xmx) and understand the trade-offs of setting them equal versus allowing dynamic heap resizing? Java › Garbage CollectionJavaGarbage CollectionIntermediate
11How would you use jstat to monitor GC activity and heap generation sizes for a running JVM process in real time, without needing a full profiling tool? Java › Garbage CollectionJavaGarbage CollectionIntermediate
12How does the JVM lay out array objects in memory, including the array header overhead, and how does this affect memory efficiency for very large arrays of primitives versus boxed wrapper types? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
13How would you diagnose a suspected thread deadlock in a running production JVM using a thread dump, and what specific information in the dump reveals the deadlock? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
14How does the JVM's tri-color marking algorithm (used by concurrent garbage collectors like G1) work to identify reachable objects while application threads continue running concurrently, and what problem does a write barrier solve in this context? Java › Garbage CollectionJavaGarbage CollectionAdvanced
15How would you determine whether an application is spending an excessive amount of time in garbage collection (GC overhead) relative to actual application work, and what JVM flags or tools help measure and diagnose this? Java › Garbage CollectionJavaGarbage CollectionAdvanced
16How would you correctly handle character encoding when reading a text file whose encoding isn't known in advance (or might not be UTF-8), and what pitfalls exist with relying on the JVM's platform default charset? Java › I/O & NIOJavaI/O & NIOAdvanced
17How does JPMS's strong encapsulation interact with reflection-heavy frameworks and libraries that predate the module system, and what specific JVM flags (like --add-opens) exist as an escape hatch for cases where proper module declarations aren't feasible? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Advanced
18What does it mean for an object to be 'eligible for garbage collection' in terms of reachability from GC roots? Java › Garbage CollectionJavaGarbage CollectionBeginner
19What is the parent delegation model in Java class loading, and why is it important for security and consistency? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
20What are the phases of class loading (loading, linking, initialization), and what specifically happens during each? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
21What are the atomic classes in java.util.concurrent.atomic (AtomicInteger, AtomicLong, AtomicReference), and how do they achieve thread-safe operations without traditional locking? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
22What is the difference between Error and Exception in Java's Throwable hierarchy, and why should application code generally avoid catching Error subclasses like OutOfMemoryError or StackOverflowError? Java › ExceptionsJavaExceptionsIntermediate
23What are the four types of references in java.lang.ref (strong, soft, weak, phantom), and how does each affect an object's eligibility for garbage collection? Java › Garbage CollectionJavaGarbage CollectionIntermediate
24How does an inner class's implicit reference to its outer instance create a potential memory leak risk, and in what specific scenario does this become a genuine practical concern? Java › Inner Classes & Anonymous ClassesJavaInner Classes & Anonymous ClassesIntermediate
25What is the difference between LocalDate, LocalTime, LocalDateTime, and ZonedDateTime, and when would you use each? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Intermediate
26How would you implement a custom ClassLoader to load classes from a non-standard source, such as loading plugin JARs dynamically at runtime, and what challenges arise with class unloading? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
27How does the Java Memory Model's happens-before relationship formally define when changes made by one thread are guaranteed to be visible to another thread, and what role does the volatile keyword play? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
28How do lambda expressions get compiled at the bytecode level using invokedynamic, and how does this differ from how an anonymous inner class implementing the same functional interface would be compiled? Java › Functional Interfaces & Method ReferencesJavaFunctional Interfaces & Method ReferencesAdvanced
29How do the different modern garbage collectors (G1, ZGC, Shenandoah) differ in their approach to minimizing GC pause times, and when would you choose one over the default? Java › Garbage CollectionJavaGarbage CollectionAdvanced
30What is escape analysis, and how does it enable the JIT compiler to perform stack allocation or scalar replacement for objects that don't actually need heap allocation, reducing GC pressure? Java › Garbage CollectionJavaGarbage CollectionAdvanced
31How does Metaspace (replacing PermGen since Java 8) store class metadata, and what specific configuration and failure modes differ from the old PermGen model? Java › Garbage CollectionJavaGarbage CollectionAdvanced
32How would you implement memory-mapped file I/O using MappedByteBuffer, and what performance advantage does this provide for very large files compared to traditional stream-based reading? Java › I/O & NIOJavaI/O & NIOAdvanced
33What is the role of Span<T> and Memory<T> in .NET, and why can't Span<T> be used inside an async method? C# › Arrays, Span<T> & Memory<T>C#Arrays, Span<T> & Memory<T>Advanced