Frontend track

JavaScript interview questions and answers

Panel-ready Frontend Master questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.

21 Moderate JavaScript Frontend

What is optional chaining?

Short take Full answer on next page

Simple meaning

The question mark dot stops the lookup and returns undefined if the left side is null or undefined.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
23 Moderate JavaScript Frontend

What memory leak might you cause with addEventListener?

Short take Full answer on next page

Simple meaning

If I add a window resize listener in useEffect and forget the cleanup, the handler keeps the component closure alive after unmount.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
24 Moderate TypeScript Frontend

What is a generic in TypeScript at a practical level?

Short take Full answer on next page

Simple meaning

A generic is a type parameter so a function or component works with many shapes while keeping the relationship.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
25 Moderate JavaScript Frontend

What is the difference between slice and splice?

Short take Full answer on next page

Simple meaning

Slice returns a shallow copy of a portion and does not change the original, which is what I want in React.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
26 Moderate JavaScript Frontend

What is the event loop in JavaScript?

Short take Full answer on next page

Simple meaning

JavaScript runs on one call stack.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
27 Moderate JavaScript Frontend

What is destructuring in JavaScript?

Short take Full answer on next page

Simple meaning

Destructuring pulls values from arrays or objects into named variables in one line.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
28 Moderate JavaScript Frontend

What is the spread operator used for?

Short take Full answer on next page

Simple meaning

Spread copies array or object properties into a new literal.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
29 Moderate Browser Frontend

What is the Critical Rendering Path?

Short take Full answer on next page

Simple meaning

It is the browser steps from HTML and CSS to first painted pixels: parse DOM, parse CSSOM, render tree, layout, paint.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
30 Moderate JavaScript Frontend

What is a microtask versus a macrotask?

Short take Full answer on next page

Simple meaning

Promise callbacks are microtasks and run before the next macrotask like setTimeout.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
Prev Page 2 of 2
Chat with us