Q371. When would you use a sealed class instead of an enum?
An `enum class` defines a fixed set of constants, each a single instance. It can have properties and methods, but every constant shares the same shape. A `sealed class` o...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (2,728 available).
An `enum class` defines a fixed set of constants, each a single instance. It can have properties and methods, but every constant shares the same shape. A `sealed class` o...
Generics let you write type-safe, reusable code without boxing or casts. The type parameter is resolved at compile time, and the JIT specialises for value types while sha...
A `virtual` function enables runtime polymorphism. Each polymorphic class gets a vtable of function pointers and each object stores a hidden vptr. A call through a base p...
A trait defines shared behaviour: a set of method signatures a type can implement. Implementations can be written for types you did not define, as long as you own the tra...
An interface is a set of method signatures. Any type that implements all of them satisfies the interface implicitly, with no `implements` keyword. Internally an interface...
Two weighings. Weighing 1: split into 3, 3 and 2. Weigh the two groups of 3. - If one side is heavier, the heavy ball is in that group of 3. - If they balance, the heavy ...
Show a learning system, not just a story. Example: "We inherited a Go service with no tests and I had never written Go. I gave myself three days: I read the standard libr...
Own it fully and show the learning. Use STAR but with the emphasis on accountability and change. Example: "I shipped a database migration without a rollback plan and a mi...
Options and trade-offs: 1. Sort then slice: O(n log n) time, simplest, fine for small n. 2. Min-heap of size k: O(n log k) time, O(k) space. Preferred when k is small rel...
Dependency injection means a component receives its collaborators from outside rather than creating them itself. The Spring container builds and wires the object graph fr...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.