JavaScript Prototype & Inheritance Interview Questions
Prototypes are how JavaScript shares behaviour — and a favourite for separating people who memorised classes from those who understand the model.
What is prototypal inheritance?
Every object has a hidden link to another object (its prototype). Missing properties are looked up along the chain until found or null. Shared methods live once on a prototype; instances delegate to it.
What's the difference between __proto__ and prototype?
Fn.prototype is the object that becomes the prototype of instances created with new Fn(). obj.__proto__ (or Object.getPrototypeOf) is the actual link on an instance. So new Fn().__proto__ === Fn.prototype.
What does the `new` keyword do?
Four things: creates an empty object, links it to the constructor's prototype, runs the constructor with this bound to it, and returns it.
Are ES6 classes just syntax sugar?
Mostly yes — methods land on Class.prototype, extends wires the prototype chain, super calls the parent. Differences: classes aren't hoisted, run in strict mode, and must be called with new.
What does instanceof check?
Whether a constructor's prototype appears anywhere in an object's prototype chain.
Understand the model, not just syntax
Prototypes, the chain, classes and how they connect — explained from first principles in the JavaScript Interview Kit.
⚡ Get the JavaScript Interview Kit → ₹299Frequently asked questions
- How do I explain the prototype chain in an interview?
- 'Property lookups walk from the object up its prototype chain until found or null. Shared methods live on the prototype so instances delegate to them.'
- Is class better than prototype?
- class is cleaner syntax over the same prototypal model. Understanding the chain underneath is what interviewers probe.
