Q1. What is the difference between an abstract class and an interface?
An interface declares a contract: a set of method signatures with no state that any type can implement. A class can implement many interfaces, which models capability. An...
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 (12 available).
An interface declares a contract: a set of method signatures with no state that any type can implement. A class can implement many interfaces, which models capability. An...
Polymorphism lets one interface be used by many implementations, so callers depend on a contract rather than a concrete type. Subtype or runtime polymorphism: a base refe...
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...
Depend on an abstraction and let each shape compute its own values. ```java interface Shape { double area(); double perimeter(); } class Circle implements Shape { private...
Both define contracts that other types implement, but they differ in intent and mechanics. - An interface declares a contract with no state (traditionally) and supports m...
`const` is a compile-time contract. A `const` object cannot be modified, and a `const` member function promises not to modify the object, so it can be called on const obj...
The Dependency Inversion Principle has two parts: high-level policy should not depend on low-level detail, and abstractions should not depend on details; details should d...
In TypeScript, custom types can be defined using interfaces or type aliases. Interfaces define the structure of an object and can be implemented by classes, while type al...
Interfaces in TypeScript define how an object should look or what a class should implement. They can be extended or implemented by other interfaces and classes. Type alia...
In TypeScript, you can define optional properties in an interface by appending a question mark (?) to the property name. This indicates that the property is optional and ...
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.