| 1 | What is the difference between composition and inheritance as ways to reuse code, and why does the design principle "favor composition over inheritance" generally guide modern Java design (including many design patterns themselves)? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 2 | What is the Strategy pattern, and how do Java 8's functional interfaces and lambdas make implementing it significantly more concise than the traditional interface-plus-implementation-classes approach? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 3 | What is the Adapter pattern, and when would you use it to make an existing class compatible with an interface it wasn't originally designed to implement? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 4 | How would you implement the Visitor pattern in Java to add new operations to an existing class hierarchy without modifying those classes, and how do Java's sealed classes and pattern matching (switch expressions) provide a modern alternative? Java › Design Patterns in Java | Java | Design Patterns in Java | Advanced |
| 5 | What is the Singleton pattern, and how would you implement a thread-safe Singleton in Java? Java › Design Patterns in Java | Java | Design Patterns in Java | Beginner |
| 6 | How would you implement the Observer pattern in Java, and how does it compare to using the built-in PropertyChangeSupport or a reactive streams library? Java › Design Patterns in Java | Java | Design Patterns in Java | Advanced |
| 7 | How would you implement the Decorator pattern in Java, and how does java.io's InputStream/OutputStream class hierarchy exemplify this pattern in the JDK itself? Java › Design Patterns in Java | Java | Design Patterns in Java | Advanced |
| 8 | How would you implement the Proxy pattern to add lazy initialization to an expensive-to-create object, and how does this differ structurally from the Decorator pattern despite both wrapping an object behind a shared interface? Java › Design Patterns in Java | Java | Design Patterns in Java | Advanced |
| 9 | What is the Factory Method pattern's simplest form -- a basic static factory returning different subtype instances based on input -- and why might you prefer it over exposing constructors directly? Java › Design Patterns in Java | Java | Design Patterns in Java | Beginner |
| 10 | What is the Template Method pattern, and how is it used to define the skeleton of an algorithm while letting subclasses customize specific steps? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 11 | How would you implement the Composite pattern to treat individual objects and groups of objects uniformly, such as a file system with files and directories? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 12 | How would you implement the Dependency Injection pattern manually (without a framework like Spring) using constructor injection, and what testability benefits does this provide? Java › Design Patterns in Java | Java | Design Patterns in Java | Advanced |
| 13 | How would you use the Chain of Responsibility pattern to implement a request-processing pipeline (such as middleware-style validation/authentication/logging), and how does this relate conceptually to servlet filters or web framework middleware? Java › Design Patterns in Java | Java | Design Patterns in Java | Advanced |
| 14 | How does the Builder pattern solve the "telescoping constructor" problem, and how would you implement it for a class with many optional parameters? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 15 | When is it a mistake to force a 'classic' design pattern into idiomatic JavaScript? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Advanced |
| 16 | What is the Factory Method pattern, and how does it differ from the simpler Static Factory Method idiom (like List.of() or Optional.of())? Java › Design Patterns in Java | Java | Design Patterns in Java | Intermediate |
| 17 | How is the Decorator pattern typically implemented in JavaScript? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Intermediate |
| 18 | What is the Command pattern and where is it useful in JavaScript apps? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Advanced |
| 19 | What are design patterns, and how are the Singleton, Adapter, and Strategy patterns typically implemented in C#? C# › Design Patterns in C# | C# | Design Patterns in C# | Advanced |
| 20 | What is the Singleton pattern and how is it implemented in JavaScript? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Beginner |
| 21 | How do you implement the Observer pattern in JavaScript? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Intermediate |
| 22 | What is the Strategy pattern and how does it help avoid large if/else chains? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Advanced |
| 23 | How do you implement the Proxy pattern using JavaScript's built-in Proxy object? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Advanced |
| 24 | What is the Factory pattern, and how does it differ from calling a class constructor directly? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Intermediate |
| 25 | What is the Adapter pattern and why is it useful when integrating third-party code? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Advanced |
| 26 | What is the Module pattern and what problem does it solve? JavaScript › Design Patterns in JavaScript | JavaScript | Design Patterns in JavaScript | Beginner |
| 27 | What is Domain-Driven Design (DDD), and how do its concepts of entities, value objects, and aggregates apply to a Node.js codebase? Node.js › Architecture & Design Patterns | Node.js | Architecture & Design Patterns | Advanced |
| 28 | What is a non-static (inner) class in Java, and how does its relationship to an enclosing instance differ from a regular top-level class? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Beginner |
| 29 | What is the fundamental difference between an interface and an abstract class in Java, and when would you choose one over the other? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Beginner |
| 30 | Why was the modern java.time API (introduced in Java 8) created to replace the legacy Date and Calendar classes, and what specific problems did the old classes have? Java › Java Date & Time API (java.time) | Java | Java Date & Time API (java.time) | Beginner |
| 31 | How does the ServiceLoader mechanism (java.util.ServiceLoader) provide a standardized way to discover and load implementations at runtime without hardcoding class names, and how does it relate to class loading? Java › Class Loading & Bytecode Verification | Java | Class Loading & Bytecode Verification | Intermediate |
| 32 | How would you implement a callback or event listener using an anonymous class, and how does this same use case increasingly get replaced by lambda expressions for functional interfaces in modern Java? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Intermediate |
| 33 | How would you implement the 'mixin' pattern in Java using default methods on an interface, letting a class gain reusable behavior without traditional inheritance? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Intermediate |
| 34 | How do the requires and exports directives in a module-info.java file work together to define a module's dependencies and public API surface? Java › Java Platform Module System (JPMS) | Java | Java Platform Module System (JPMS) | Intermediate |
| 35 | How would you design a fluent, chainable validation API using functional interfaces, similar to how Comparator's thenComparing() works, but for validation rules that accumulate error messages rather than short-circuiting on the first failure? Java › Functional Interfaces & Method References | Java | Functional Interfaces & Method References | Advanced |
| 36 | How would you implement the classic Iterator design pattern using a private non-static inner class, letting the inner Iterator implementation access the outer collection's private internal state directly? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Advanced |
| 37 | How would you decide between using a static nested class, a non-static inner class, a local class, an anonymous class, or a lambda expression for a given design scenario, weighing their respective trade-offs? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Advanced |
| 38 | How is the 'diamond problem' (a class implementing two interfaces with conflicting default methods) resolved in Java, and what rule determines which default method 'wins' or whether the compiler requires explicit resolution? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Advanced |
| 39 | How is the Factory pattern commonly applied in Node.js applications, and what problem does it solve? Node.js › Architecture & Design Patterns | Node.js | Architecture & Design Patterns | Intermediate |
| 40 | What is the Singleton pattern, and what are the specific risks of using it in a Node.js application? Node.js › Architecture & Design Patterns | Node.js | Architecture & Design Patterns | Intermediate |
| 41 | What is Dependency Injection, and how is it typically implemented in Node.js given the language has no built-in DI container? Node.js › Architecture & Design Patterns | Node.js | Architecture & Design Patterns | Intermediate |
| 42 | What is the Strategy pattern, and how would you apply it to support multiple payment providers in a Node.js checkout service? Node.js › Architecture & Design Patterns | Node.js | Architecture & Design Patterns | Intermediate |
| 43 | What is a Facade pattern, and how might it be used to simplify a Node.js application's interaction with several third-party SDKs? Node.js › Architecture & Design Patterns | Node.js | Architecture & Design Patterns | Advanced |
| 44 | How does styled components let you write CSS directly inside your JavaScript files? React › Styling in React (CSS Modules, Styled Components & Tailwind) | React | Styling in React (CSS Modules, Styled Components & Tailwind) | Intermediate |
| 45 | What is error propagation, and how does an uncaught error in a nested function behave? JavaScript › Error Handling | JavaScript | Error Handling | Intermediate |
| 46 | What are the five formal properties an equals() implementation must satisfy according to its documented contract (reflexive, symmetric, transitive, consistent, and null-handling)? Java › equals(), hashCode() & toString() Contracts | Java | equals(), hashCode() & toString() Contracts | Intermediate |
| 47 | What is a static nested class, and why is it generally preferred over a non-static inner class when the nested class doesn't actually need access to the enclosing instance? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Intermediate |
| 48 | What are static methods on an interface, and how do they differ from default methods in terms of inheritance and typical use case? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Intermediate |
| 49 | How would you use an abstract class to implement the Template Method pattern, defining a fixed algorithm skeleton with some steps left abstract for subclasses to fill in? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Intermediate |
| 50 | Can an interface extend multiple other interfaces simultaneously, and how does this differ from a class's single-inheritance restriction for abstract/concrete classes? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Intermediate |
| 51 | What is the purpose of declaring an abstract class with a protected constructor, and how does this pattern communicate the class's intended usage to other developers? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Intermediate |
| 52 | How would you calculate a person's age or the number of days until a recurring annual event (like a birthday) using ChronoUnit, and what's a common pitfall with leap-year birthdays (February 29)? Java › Java Date & Time API (java.time) | Java | Java Date & Time API (java.time) | Intermediate |
| 53 | How does the ServiceLoader/Service Provider Interface pattern integrate with JPMS using the 'uses' and 'provides ... with' directives, replacing the older META-INF/services file-based mechanism? Java › Java Platform Module System (JPMS) | Java | Java Platform Module System (JPMS) | Intermediate |
| 54 | What is snapshot testing and what's a common pitfall with it? JavaScript › Debugging, Testing & Tooling | JavaScript | Debugging, Testing & Tooling | Advanced |
| 55 | Why is BigInt generally the wrong tool for representing monetary amounts with decimals, like $19.99? JavaScript › Numbers, Math & BigInt | JavaScript | Numbers, Math & BigInt | Advanced |
| 56 | How 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 Verification | Java | Class Loading & Bytecode Verification | Advanced |
| 57 | How does a thread context ClassLoader (Thread.currentThread().getContextClassLoader()) solve the problem of a core JDK class needing to load an application-provided implementation class, given parent delegation normally prevents this? Java › Class Loading & Bytecode Verification | Java | Class Loading & Bytecode Verification | Advanced |
| 58 | How does the getClass() versus instanceof choice in an equals() implementation affect whether subclasses can be considered equal to their superclass instances, and what's the Liskov Substitution Principle tension involved? Java › equals(), hashCode() & toString() Contracts | Java | equals(), hashCode() & toString() Contracts | Advanced |
| 59 | How would you correctly implement equals() and hashCode() for a class in an inheritance hierarchy where the superclass itself defines meaningful equality-relevant fields, without breaking the contract when subclasses add their own fields? Java › equals(), hashCode() & toString() Contracts | Java | equals(), hashCode() & toString() Contracts | Advanced |
| 60 | How do local classes (defined within a method body) and anonymous classes differ in their capabilities and use cases, particularly regarding capturing local variables and reusability? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Advanced |
| 61 | How would you use a local class defined within a method to implement a fairly complex, stateful callback that needs multiple methods and constructor parameters, where a lambda expression genuinely wouldn't suffice? Java › Inner Classes & Anonymous Classes | Java | Inner Classes & Anonymous Classes | Advanced |
| 62 | How would you use an interface with only static and default methods (no abstract methods at all) to build a fluent, extensible utility API, and what's a real JDK example of this pattern? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Advanced |
| 63 | How would you use an abstract class combined with the Non-Virtual Interface (NVI) idiom to enforce that certain methods are always called in a specific pattern, even when subclasses override customizable parts? Java › Interfaces & Abstract Classes | Java | Interfaces & Abstract Classes | Advanced |
| 64 | How would you implement a custom TemporalAdjuster to calculate business-specific date logic (like 'the next business day, skipping weekends and holidays')? Java › Java Date & Time API (java.time) | Java | Java Date & Time API (java.time) | Advanced |
| 65 | What is the difference between 'requires' and 'requires transitive', and how does transitive dependency propagation work in the module system? Java › Java Platform Module System (JPMS) | Java | Java Platform Module System (JPMS) | Advanced |
| 66 | What are the two primary ways to create a thread in Java (extending Thread versus implementing Runnable), and which is generally preferred? Java › Concurrency & Threads | Java | Concurrency & Threads | Beginner |
| 67 | How do you create a custom annotation in Java, and what role do @Retention and @Target play? Java › Annotations | Java | Annotations | Intermediate |
| 68 | What are the immutable collection factory methods (List.of(), Set.of(), Map.of()) introduced in Java 9, and how do they differ from Collections.unmodifiableList()? Java › Collections Framework | Java | Collections Framework | Intermediate |
| 69 | What is the synchronized keyword, and how does it use Java's intrinsic (monitor) locks to prevent race conditions on shared mutable state? Java › Concurrency & Threads | Java | Concurrency & Threads | Intermediate |
| 70 | What is the difference between wait()/notify()/notifyAll() (Object's intrinsic monitor methods) and the newer java.util.concurrent tools, and why are the older methods considered error-prone? Java › Concurrency & Threads | Java | Concurrency & Threads | Intermediate |
| 71 | How do you add fields, constructors, and methods to a Java enum, and how would you implement an enum representing planets with mass and radius that calculates surface gravity? Java › Enums | Java | Enums | Intermediate |
| 72 | How does method overriding with super work in JavaScript classes? JavaScript › Classes & Class Syntax | JavaScript | Classes & Class Syntax | Advanced |
| 73 | How does Java's annotation processing API (javax.annotation.processing) enable compile-time code generation frameworks like Lombok or Dagger, and what are its key limitations? Java › Annotations | Java | Annotations | Advanced |
| 74 | How would you design a custom annotation-driven caching mechanism (similar to Spring's @Cacheable) using a dynamic proxy combined with reflection? Java › Annotations | Java | Annotations | Advanced |
| 75 | How does Java's virtual threads feature (Project Loom, finalized in Java 21) fundamentally change the thread-per-task model for high-concurrency applications, and how do they differ from traditional platform threads? Java › Concurrency & Threads | Java | Concurrency & Threads | Advanced |
| 76 | How does Java implement enums under the hood at the bytecode level (extending java.lang.Enum), and what makes them inherently thread-safe and serialization-safe as singletons? Java › Enums | Java | Enums | Advanced |
| 77 | How would you build an interactive CLI wizard that prompts the user for multiple pieces of input using a library like Inquirer.js? Node.js › CLI Tools & Scripting with Node.js | Node.js | CLI Tools & Scripting with Node.js | Advanced |
| 78 | What does the node:util.types module provide, and how does it differ from JavaScript's built-in typeof operator? Node.js › Core Node.js Modules | Node.js | Core Node.js Modules | Intermediate |
| 79 | How do you format a date for a specific locale without a library? JavaScript › Date, Time & Internationalization (Intl API) | JavaScript | Date, Time & Internationalization (Intl API) | Intermediate |
| 80 | How would you use TemporalAdjusters to compute dates like 'the next Monday' or 'the last day of the month' relative to a given LocalDate? Java › Java Date & Time API (java.time) | Java | Java Date & Time API (java.time) | Intermediate |
| 81 | How do you handle out-of-range writes to a TypedArray safely? JavaScript › ArrayBuffer, TypedArrays & Binary Data | JavaScript | ArrayBuffer, TypedArrays & Binary Data | Advanced |
| 82 | What is the Temporal API and what problem does it solve? JavaScript › Date, Time & Internationalization (Intl API) | JavaScript | Date, Time & Internationalization (Intl API) | Advanced |
| 83 | What is event bubbling? JavaScript › DOM & Events | JavaScript | DOM & Events | Beginner |
| 84 | What is the difference between calling Thread.start() and Thread.run() directly, and why is calling run() directly a common beginner mistake? Java › Concurrency & Threads | Java | Concurrency & Threads | Beginner |
| 85 | What is IndexedDB and how does it differ from a simple key-value store? JavaScript › Browser Storage & Web APIs | JavaScript | Browser Storage & Web APIs | Intermediate |
| 86 | How do you delegate from one generator to another using yield*? JavaScript › Iterators & Generators | JavaScript | Iterators & Generators | Intermediate |
| 87 | How do annotations with elements (parameters) work, including default values and the special `value` element? Java › Annotations | Java | Annotations | Intermediate |
| 88 | What is the purpose of the Deque interface, and how does it unify both stack (LIFO) and queue (FIFO) behavior in a single interface? Java › Collections Framework | Java | Collections Framework | Intermediate |
| 89 | How does PriorityQueue work internally (as a binary heap), and what ordering does it use by default versus with a custom Comparator? Java › Collections Framework | Java | Collections Framework | Intermediate |
| 90 | How would you implement an enum that also implements an interface, and what's the benefit of having different enum constants provide different behavior through a shared interface contract? Java › Enums | Java | Enums | Intermediate |
| 91 | How would you implement a generic Stack<T> class from scratch, demonstrating how a self-contained generic data structure is typically structured? Java › Generics | Java | Generics | Intermediate |
| 92 | How would you write a generic interface (like a custom Repository<T, ID> pattern common in data-access layers) and implement it for a specific entity type? Java › Generics | Java | Generics | Intermediate |
| 93 | How does sort() compare values by default, and how do you fix numeric sorting? JavaScript › Arrays & Array Methods | JavaScript | Arrays & Array Methods | Advanced |
| 94 | What's the difference between the capturing and bubbling phases of event propagation? JavaScript › DOM & Events | JavaScript | DOM & Events | Advanced |
| 95 | How does mark-and-sweep garbage collection actually determine which objects are reachable? JavaScript › Memory Management & Garbage Collection | JavaScript | Memory Management & Garbage Collection | Advanced |
| 96 | How would you read custom annotations at runtime using reflection to implement annotation-driven behavior, such as a simple dependency injection or validation framework? Java › Annotations | Java | Annotations | Advanced |
| 97 | How do you choose between HashMap, LinkedHashMap, and TreeMap based on their different ordering guarantees and performance characteristics? Java › Collections Framework | Java | Collections Framework | Advanced |
| 98 | How does TreeMap/TreeSet's red-black tree implementation guarantee O(log n) operations, and what role does the Comparable/Comparator interface play in maintaining sorted order? Java › Collections Framework | Java | Collections Framework | Advanced |
| 99 | How would you implement the Strategy pattern using an enum with constant-specific method bodies, and how does this compare to a traditional interface-based Strategy implementation? Java › Enums | Java | Enums | Advanced |
| 100 | How would you use an EnumMap combined with a switch expression to implement a state machine, and what compile-time safety benefits does an exhaustive switch over an enum provide? Java › Enums | Java | Enums | Advanced |
| 101 | How would you handle adding behavior to an enum where the number of constants might grow very large or needs to be data-driven rather than hardcoded at compile time, and why might a class-based registry be more appropriate in that scenario? Java › Enums | Java | Enums | Advanced |
| 102 | How does exception handling interact with performance, particularly regarding the cost of filling in a stack trace, and how would you optimize exception usage in a performance-critical hot path? Java › Exceptions | Java | Exceptions | Advanced |
| 103 | How would you implement a generic builder pattern with a self-referential generic type parameter (the 'curiously recurring generic pattern', <T extends Builder<T>>) to support fluent method chaining that correctly returns the actual subclass type in an inheritance hierarchy? Java › Generics | Java | Generics | Advanced |
| 104 | How would you implement a generic pair/tuple utility method that returns different concrete types depending on the number of elements, and how does target-type inference help the compiler choose the correct generic instantiation from context alone? Java › Generics | Java | Generics | Advanced |
| 105 | What does the node:events module's EventEmitter class provide, and what naming convention do most Node.js core APIs follow when using it? Node.js › Core Node.js Modules | Node.js | Core Node.js Modules | Beginner |
| 106 | How do you create a custom class that emits events by extending Node's built-in EventEmitter? Node.js › Events & EventEmitter | Node.js | Events & EventEmitter | Beginner |
| 107 | How would you implement Attribute-Based Access Control (ABAC) in a Node.js application when RBAC roles aren't expressive enough? Node.js › Authentication & Authorization | Node.js | Authentication & Authorization | Intermediate |
| 108 | How does Sequelize define models and relationships for a relational (SQL) database in Node.js? Node.js › Databases & ORMs (MongoDB/Mongoose, SQL/Sequelize) | Node.js | Databases & ORMs (MongoDB/Mongoose, SQL/Sequelize) | Intermediate |
| 109 | Why can decorators make code harder to statically analyze or tree-shake, and what's a common criticism of overusing them? TypeScript › Decorators | TypeScript | Decorators | Advanced |
| 110 | How would you implement a custom event that carries multiple pieces of data, and what's the convention for structuring the emitted payload? Node.js › Events & EventEmitter | Node.js | Events & EventEmitter | Advanced |
| 111 | What's the difference between a named export and a default export? JavaScript › ES Modules | JavaScript | ES Modules | Beginner |
| 112 | What does the # syntax mean for class members? JavaScript › Classes & Class Syntax | JavaScript | Classes & Class Syntax | Intermediate |
| 113 | What's the difference between event.target and event.currentTarget? JavaScript › DOM & Events | JavaScript | DOM & Events | Intermediate |
| 114 | How do you create and dispatch a custom DOM event? JavaScript › DOM & Events | JavaScript | DOM & Events | Intermediate |
| 115 | How does MutationObserver let you react to DOM changes made by other code? JavaScript › DOM & Events | JavaScript | DOM & Events | Advanced |
| 116 | Why can circular module imports (Module A imports B, which imports A) cause subtle bugs? JavaScript › ES Modules | JavaScript | ES Modules | Advanced |
| 117 | How would you implement a custom Symbol.iterator for a tree data structure to enable depth-first traversal with for...of? JavaScript › Iterators & Generators | JavaScript | Iterators & Generators | Advanced |
| 118 | How would you use a Map to implement an LRU (Least Recently Used) cache? JavaScript › Map, Set, WeakMap & WeakSet | JavaScript | Map, Set, WeakMap & WeakSet | Advanced |
| 119 | How would you implement a generic class with multiple type parameters and bounded type parameters (like <T extends Comparable<T>>), and what does this specific bound enable? Java › Generics | Java | Generics | Advanced |
| 120 | What is optimistic concurrency control, and how would you implement it to prevent lost updates when two users edit the same record simultaneously? Node.js › Databases | Node.js | Databases | Advanced |