4.65 out of 5
4.65
143 reviews on Udemy

JavaScript – Marathon Interview Questions Series 2021

The Quintessential Guide For Cracking JavaScript Interviews For Developers World-wide
Instructor:
Nirmal Joshi
1,142 students enrolled
English [Auto]
Real-world JavaScript interviews questions asked in IT companies.
Q&As that you’ll need to become a JavaScript expert.
Apply for JavaScript jobs anywhere in the world.
Core concepts and features you need to know in JavaScript development.
JS Language, Arrays, OOJS, DOM & Web, Asynchronous JS, Map, Set, WeakMap & WeakSet (ES6 Data structure), Automated Testing
Lectures & topics focused on real-world coding problems.
Fast and friendly Q&A support

JavaScript will be the hot thing and isn’t going anywhere for the next 5 years!

For several years now, we’ve seen a huge demand for JavaScript developers world-wide. If you want to get a programming job quickly, this is the language to learn. Not only that, there’s always something new coming up every now and then, so you need to be updated about the latest changes and industry trends.

Others say that cracking JavaScript interviews is complicated. I say it is NOT! If you have the right resources and up-to date information – learning JavaScript is easy and fun. I have built this course for individuals who are facing difficulties in cracking JavaScript interviews – keeping one thing in mind – answering each and every question in the simplest of ways!

Why JavaScript only?

I am sure you want to learn Angular, Node.js, React, Vue JS, Typescript, Svelte, or any other framework to be the best in the business, but at the end of the day, JavaScript fundamentals are the key because understanding and learning JavaScript is an investment that will certainly pay off for you in the future.

With my 23+ years of experience in the programming industry – I’ve put all my JavaScript knowledge and teaching experience in building this comprehensive course. I’ve made sure there’s everything required for freshers as well as experienced individuals. With that being said – I am working on a progressive course update plan where I’ll add new lectures from time to time because JavaScript is an ocean and I need to dive deep to bring out the best and the most precious questions/concepts pearls for you!

The course is based on my experience as a teacher with thousands of students across platforms like Udemy as well as my YouTube channel “Nirmal Joshi”. It’s packed with all sorts of real-world interview and assessment questions which are asked in IT development companies – all with the goal of giving you the best possible way of learning JavaScript in the simplest ways.

What’s in the course?

Because this course has sections packed with beginner to advanced level content – I strongly recommend that you check out the full course curriculum to get a clear idea of all the topics. To summarise, here’s what you’ll find in the course:

  1. Language fundamentals

  2. Arrays

  3. String

  4. OOJS

  5. DOM & Web

  6. Asynchronous JS

  7. Map, Set, WeakMap & WeakSet (ES6 Data structure)

  8. Automated Testing

  9. Practical real-world examples and so on…

Who is this course for?

  • Developers who want to crack JavaScript interviews.

  • New/junior/expert developers who want to learn modern JavaScript

  • Expert developers who want to upgrade their existing JavaScript skills.

  • Programmers who want to learn front-end web development.

Sounds good? Then start today and hit the “Take this course” button.

Enroll now for the only JavaScript course that you will ever need!

Language Fundamentals

1
Difference Between Null & Undefined ?

Related Questions :-

  1. What is undefined in JavaScript?

  2. What will be the output of undefined==null and undefined===null? Why?

  3. Can you explicitly assign ‘undefined’ to a variable?

    let i=undefined; [show example]

2
Function Scope Vs. Block Scope

Related Questions :-

  1. What is hoisting in JavaScript?

  2. How does block scope work?

  3. What is the scope of a variable?

3
What is Automatic Semicolon Insertion (ASI) ?

Related Questions :-

  1. Should you terminate all lines by a “;”?

  2. function test(){

    return

    {

    a:5

    }

    }

    const obj=test();

    console.log(obj);

    Why this code is returning undefined in spite of function returning a valid object literal?

  3. Can ‘use strict’ statement or the strict mode change the behavior of ASI?

4
Difference between Rest and Spread operator?

Related Questions :-

  1. Can we use arguments object in arrow function?

  2. Which is the best way to create new arrays with assignment?

  3. How can you handle the “n” number of parameters passed to a function ? or create a function which can take any number of parameters and returns sum or max or any other such calculative values.

  4. Can the rest operator be placed anywhere in the function parameter list? Or

    function test(...a,b){

    //statements

    }

    Is this piece of code valid? Give the reason.


5
When do you get Infinity or -Infinity as output?

Related Questions :-

  1. How will you put a validation for positive or negative Infinity?

  2. What will be the output of this code?

    Code:

    console.log(1/0);

6
When do you get NaN as output?

Related Questions :-

  1. What will be the output of the below statement?

    console.log(NaN==NaN);

  2. What is the difference between isNaN() and isFinite() method?

7
Explain must know points of arrow function.

Related Questions :-

  1. Explain the syntactical features of arrow function.

  2. Why “this” does not work in arrow function?

  3. Explain output of following code with reason.

    const obj={

    method:()=>{

    console.log(this);

    }

    }

  4. How can you handle arguments object like functionality in arrow function?

  5. Can you write IIFE with arrow function syntax?

8
How does a "closure" work in JavaScript ?

Related Questions :-

  1. How can you access private variable or function outside the scope?

  2. Explain the advantage of closure?

9
How can sum(5)(6) return 11?

Related Questions :-

  1. What is function currying?

  2. const multiplication=a=>b=>c=>return a*b*c

    What will this statement do? Explain in detail.

  3. Explain practical usage of function currying.

10
Iterables and Iterators

Relative Questions :

1) What is the purpose of the iterator ?

2) How do you create an iterator ?

3) Explain a practical use of an iterator ?

11
Generators

Related Questions :-

  1. What are generator functions? Explain the syntax.

  2. Which is the right syntax function* (){} or function *(){}?

  3. Explain all methods of generator objects.

  4. Explain the use of “yield*”.

  5. Can you prevent return() from terminating the generator?

12
Memory Management & Garbage Collection

Related Questions :-

  1. How does Garbage Collection work in JavaScript?

  2. Explain “Mark-and-Sweep” algorithm’s pattern.

  3. Which situation can create a memory leak?

13
How do you handle errors in JavaScript code ?

Related Questions :-

  1. When do you need try...catch?

  2. How can you generate an error?

  3. Can you generate SyntaxError or ReferenceError kind of errors?

  4. What is the purpose of the finally block?

  5. How can you refer to the name or description of error?

  6. Can we have finally without a catch block as well?

Arrays

1
Explain array & traversal in array.

Related Questions :-

  1. What is the difference between for...in and for...of?

  2. What will be the output of the below code?

    =>

    let arr = ["ES5","ES6","ES7","ES8"];

    arr.forEach(function(element,index){

    console.log(element,index);

    if (index==2){

    break;

    }

    })

  3. What will be the output of below statements?

    =>

    let arr=[7,9,0];

    console.log(arr[arr.length]);

2
Add, Remove, Insert, Replace Elements in Array

Related Questions :-

  1. What is the difference between push() and unshift() method?

  2. What is the difference between pop() and shift()?

  3. How can you insert an element at a given position?

  4. How can you remove a specific element?

  5. What does splice() return?

  6. If there is no element removed then what will splice() method return?

3
How do you perform search in an array ?

Related Questions :-

  1. What is the difference between find() and filter() method?

  2. If there is no value to return, what will findIndex() return?

  3. What is the difference between indexOf() and includes() method?

  4. How will you search multiple values in an array?

  5. What will be the output of this code?

    let arr=["One","Two","Three","Four","Five"];

    console.log(arr.lastIndexOf("Abcd"));

4
What is the use of map() method ?

Related Questions :-

  1. Find the length of each element in a new array.

  2. Find the square root of every element and store it in a new array.

  3. There is an array called products as shown here

    let products=[

    {pCode:1,pName:"Apple"},

    {pCode:2,pName:"Banana"},

    {pCode:3,pName:"Grapes"},

    {pCode:4,pName:"Oranges"}

    ]

    Get all product names (i.e pNames) in a new array

5
How to flatten 2D array ?

Related Questions :-

  1. How will you flatten an array i.e e.g converting a 2 dimensional array into single dimension?

  2. Get sum of a key field of an object literal & Then find total salary of employees

    const employees=[

    {eNo:1001,salary:3000},

    {eNo:1002,salary:2200},

    {eNo:1003,salary:3400},

    {eNo:1004,salary:6000}

    ]

  3. Find avg value of all elements of an array?

  4. Find the sum or product of all elements?

  5. What is the difference between reduce() and reduceRight()?

6
How can you sort an array ?

Related Questions :-

  1. What will be the output in case an array has “undefined” while sorting the values?

  2. How will sort an object literal?

  3. How will you sort a numeric array?

  4. Sort all values of the array in descending order.

7
Explain Array Destructuring ?

Related Questions :

1. What is the destructuring assignment?

2. Swap values using destructuring.

3. What will be the output of this code?

   => let [a,b,c] = [5,,7];

        console.log(a,b,c);

4. How will you set a default value while destructuring an array?


String

1
String Basics - [UTF -16] - u - Unicode

Related Questions :-

  1. Explain various ways to declare a string variable.

  2. How will you deal with unicode characters?

  3. Show the syntax to display long unicode characters.

2
ES6 Template Literal (String)

Related Questions :-

  1. What is a template literal?

  2. How will you display a value or an expression inside template string?

  3. What is the advantage of using template string?

3
“.length” Property and Search Methods

Related Questions :-

  1. Explain the indexOf() and lastIndexOf() method with syntax.

  2. What is the difference between search() and indexOf() method?

  3. What will be the output of the below given code? Explain with reason.

    let str="This is a test";

    console.log(str.indexOf("is",5));

    console.log(str.lastIndexOf("is",1));

4
Extraction Methods
5
Case Conversion & replace() Method

Related Questions :-

1. Create a program which check whether a character is vowel or consonant

Date & Time

1
Date & Time Basics

Related Questions :-

  1. Explain different ways of creating date/time object

  2. What will be the output of the below code

    => const dt = new Date(2020,08,23);

          console.log(dt);

  3. Explain various formats of ISO standard followed by JavaScript ?


2
Date Methods

Related Questions :-

1. Get Character month.

2. Find the date before 50 days of the given date.

3. What will be the output if you add 35 as date in Date() constructor.

3
Time Methods

Related Questions :-

1. Calculate the date difference in days.

2. How can you change hours or minutes in time ?

OOJS

1
What is object literal?

Related Questions :-

  1. Can you have dynamic keys with object literal?

  2. How can you add read-only properties to an object?

  3. What is property value short hand with object literal?

  4. What will be the output of this code

    let obj={a:'First'};

    let obj1 = obj;

    obj1.a="Second";

    console.log(obj.a);

    Explain the reason why?

  5. How can we create a clone or separate copy of an object literal?

2
What is “this” object?

Related Questions :-

  1. What will be the output of this code if you run in the browser and why?
    function test(){

    console.log(this);

    }

    test();

  2. What is the context of “this” inside arrow function? Or what will be the output of this code
    let obj={


    test:()=>{

    console.log(this);

    }

    }

    obj.test();

3
What is the purpose of call(), apply() and bind()?

Related Questions :-

  1. What is the difference between call, apply and bind()?

  2. What will be the output of this code? Or can you assign value to “this” object with assignment operator i.e. “=”?

    const obj={

    a:6

    }

    function test(){

    this=obj;

    }

    test();

4
Class, Class expression & Static members

Related Questions :-

  1. How can you create a class?

  2. When does constructor() called?

  3. Can we have dynamic property or method names in a class?

  4. What is a class expression?

  5. What are static members in a class? What is the purpose of defining them as static?

  6. How can you call another static method from a class?

5
Inheritance, Subclassing and Extending built-in class

Related Questions :-

  1. How can you inherit a class?

  2. What is subclassing?

  3. What is the purpose of super keyword?

  4. How will you override a method?

  5. How can you extend a built-in class?

6
Destructuring Object Literal

Related Questions :-

  1. Explain a practical scenario of object literal destructuring ?

  2. Explain the output of this code

    const { a=90, b } = { };

    console.log(a,b);


Module - Import/Export

1
What is Module ?

Related Questions :-

1. What is a module ?

2. Can you import any module inside the script tag ?

3. How will you run the import and export statements on a local machine ?

2
Named Export/Import

Related Questions :-

1. What is a named export and import ?

2. Can you avoid {} while importing a named module ?

3. How can you import all named modules from a file ?

4. Is it a good practice to import all modules together ?

5. Do the modules hoist ?

6. Do you need the same name while importing a named module or you can change ?

3
Default Export/Import

Related Questions :-

1. What is default export/import & the difference between named & default export/import ?

2. Explain various ways of implementing default export/import ?

DOM & Web

1
Difference between Document Object & Window Object

Related Questions :-

  1. What is the difference between window and document?

  2. What is DOM [Document Object Model] or DOM API?

  3. What is BOM [Browser Object Model]?

  4. Explain the difference between DOM and BOM?

  5. Which is the global object in browser?

  6. How will we check the width and height of window?

  7. How will you get hostname or value typed in address bar?

2
How to handle timer based events ?

Related Questions :-

  1. Explain the difference between setTimeout() and setInterval()?

  2. Why can’t we write document.setTimeout() or document.setInterval()?

  3. How can you stop a timer ?

  4. How will you create a digital clock ?

3
What is event bubbling & event capturing ?

Related Questions :-

  1. Which is the default propagation path?

  2. How can you stop the event propagation?

  3. How can you change the default propagation path?

  4. How can you get the reference of element on which event is fired?

  5. Practical question :- What will be the output of code & why?

4
What is event delegation ?

Related Questions :-

  1. How event bubbling or capturing is useful in the practical programming world?

  2. Which property can be used to check the element type on which the event is triggered?

  3. How can you get value of the element which raised the event?

5
How to navigate through DOM ?

Related Questions :-

  1. What is a node in DOM tree? Explain different types of nodes?

  2. How can you access next same level element for a given node element?

  3. What is the difference between childeNodes and children property?

  4. How can you check whether an element has child nodes or not?

  5. What is the purpose of DOM navigation?

  6. What will be the output of below given statement? - element.lastChild.nextSibling

6
getElementBy()

Related Questions :-

1. Can you use document.getElementById() & element.getElementById() ?

2. What does the getElementsByTagName() return ?

3. What is the difference between getElementsByClassName() & getElementsByName() ?

7
querySelector() & querySelectorAll()

Related Questions :-

  1. Explain the difference between querySelector() & querySelectorAll().

  2. How can you search elements using pseudo classes?

  3. Between getElementBy methods and querySelector methods which is better to use?

8
Event Basics

Related Questions :-

  1. Explain various ways to configure an event with HTML elements.

  2. Explain syntax of addEventListener() method.

  3. What is an event object ?

9
MouseEvent

Related Questions :-

  1. How will you disable right click on an element?

  2. How can you check whether a special key is pressed or not while an event is generated?

  3. How do you check mouse button value while an event is generated?

  4. For ctrl key and cmd on mac - how will you right the condition to check the key press.

10
ClientX/Y Vs. PageX/Y Vs. ScreenX/Y - Coordinates

Related Questions :-

  1. Explain the difference between clientX/Y and pageX/Y.

  2. Explain the difference between clientX/Y and screenX/Y.

11
Keyboard Events

Related Questions :-

  1. How can you check if control and Z is pressed or not?

  2. What does event.code return ?

  3. Explain the difference between event.code and event.key ?

12
Input Element Events

Related Questions :-

  1. What is the difference between onblur and onchange event?

  2. How will you handle events of checkbox and radio buttons?

  3. Differentiate onkeypress/onkeyup and oninput event.

  4. Which event you prefer with select [i.e. drop down list]?

  5. How will you get the text value of selected item from a select element i.e. a drop down list?

13
oncut - oncopy - onpaste Events

Related Questions :-

1. Explain about cut,copy and paste events

2. How can you stop an event of cut, copy or paste for an element ?

Asynchronous JS

1
What is a callback function ?

Related Questions :-

  1. What is an Asynchronous process?

  2. What is the meaning of callback hell or pyramid of doom?

2
What is a Promise ?

Related Questions :-

  1. How will you configure a process which should be executed at the end of promise resolve or reject ?

  2. What is chaining the promise? Explain the syntax.

  3. What will be the output of the given code?

    const pr = new Promise((resolve,reject)=>{

    resolve("Over");

    setTimeout(()=>{

    resolve("Again");

    },2000)

    })


    pr.then((msg)=>{

    console.log(msg);

    return pr;

    }).then((msg)=>{

    console.log(msg);

    })

  4. What is the status of promise by default?

  5. What will be the status of promise when resolved or rejected?

3
Explain Promise.all() Vs. Promise.allSettled() Vs. Promise.race() ?

Related Questions :-

  1. What will be the output if the iterable is not a promise inside all() method arguments,e.g as shown below where “p2” is not a promise?

    const p1 = new Promise((resolve,reject)=>{

    setTimeout(()=>{

    resolve("Promise1");

    },2000)

    })

    const p2 = "Normal string";

    const p3 = new Promise((resolve,reject)=>{

    setTimeout(()=>{

    resolve("Promise3");

    },2000)

    })


    Promise.all([p1, p2,p3]).then((prMsgs) => {

    console.log(prMsgs);

    }).catch((err)=>{

    console.log(err);

    })

  2. How will you handle rejected multiple promises in the most efficient way?

  3. Explain the purpose of Promise.race() method.

  4. What will be the output of empty iterable if given as a parameter inside the race() method as shown in this code?

    const obj = Promise.race([]);

    console.log(obj);


    setTimeout(()=>{

    console.log(obj);

    },2000);

4
Explain functionality of async/await ?

Related Questions :-

  1. Can you write await without async?

  2. Do you need to return a promise from an async function?

  3. Can you have an async IIFE?

  4. Which is the best way to handle errors with await?

  5. Explain the syntax of Promise.all() with async/await?

5
AJAX & XMLHTTPRequest (XHR)

Related Questions :-

  1. What is AJAX?

  2. How will you set a timeout with an XHR request?

  3. How can you set the data format for response?

  4. Explain “readyState” property of XHR.

  5. Explain the “onreadystatechange” event.

  6. How can you force the XHR request to stop the execution?

  7. When is the “load” method called?

  8. How will you set HTTP headers? Explain the sequence.

  9. Explain different ways of getting response header values?

6
The "fetch" API

Related Questions :-

  1. Explain the fetch API functionality.

  2. How will you make a DELETE request with fetch API?

7
Async Iterators & Generators

Related Questions :-

  1. What is Symbol.asyncIterator?

  2. Can we use spread operator with async iterator e.g. [...obj]?

  3. How will you handle the async iterator using generator function syntax?

Map, Set, WeakMap & WeakSet (ES6 Data structure)

1
Map

Related Questions:-

  1. What are the advantages of using Map over objects?

  2. How will you iterate through Map ?

  3. Can you assign key/values with this syntax ? Explain the reason for the answer - map[‘key’]=value

  4. How can you convert simple objects to Map?

  5. How can you convert a Map into simple objects?

  6. How will you remove an item or all items from Map?


2
Set

Related Questions:-

  1. What is the difference between Map and Set ?

  2. How will you remove specific values from Set ?

  3. What will entries() method with Set will return ?

3
WeakMap() and WeakSet()

Related Questions :-

  1. Explain difference Between Map and WeakMap.

  2. Explain difference Between Set and WeakSet.

Coding Exercises

1
Is given value an array or not?
2
Remove duplicate values from Array
3
Remove null,undefined,0,NaN and ‘ ’ from array?
4
Finding Factorial
5
Prime Number
6
Vowel & Consonant - Algorithm
7
Array intersection and union - the ES6 way
8
Fibonacci Series
9
Reverse Number

Debugging Techniques

1
Introduction to debugging & Developer Tool

Questions Summary

1
Language Fundamentals
2
Arrays
3
String
4
Date and Time
5
OOJS
6
DOM & Web

Total question count for this section - 63


What is the difference between window & document object ?

What is the difference between window and document ?

What is DOM [Document Object Model] or DOM API ?

What is BOM [Browser Object Model] ?

Explain the difference between DOM and BOM ?

Which is the global object in browser ?

How will we check the width and height of window ?

How will you get hostname or value typed in address bar ?


How will you handle timer based events ?

Explain the difference between setTimeout() and setInterval() ?

Why can’t we write document.setTimeout() or document.setInterval() ?

How can you stop a timer ?

How will you create a digital clock ?


What is event bubbling and event capturing ?

Which is the default propagation path ?

How can you stop the event propagation ?

How can you change the default propagation path ?

How can you get the reference of element on which event is fired ?

Practical question :- What will be the output of code & why ?


What is Event Delegation ?

How event bubbling or capturing is useful in the practical programming world ?

Which property can be used to check the element type on which the event is triggered ?

How can you get value of the element which raised the event ?


How can you navigate through DOM ?

What is a node in DOM tree? Explain different types of nodes?

How can you access next same level element for a given node element?

What is the difference between childeNodes and children property?

How can you check whether an element has child nodes or not?

What is the purpose of DOM navigation?

What will be the output of below given statement - element.lastChild.nextSibling


getElementBy<id,tags,class & name>()

Can you use document.getElementById() & element.getElementById() ?

What does the getElementsByTagName() return ?

What is the difference between getElementsByClassName() & getElementsByName() ?


querySelector() & querySelectorAll()

Explain the difference between querySelector() & querySelectorAll()

How can you search elements using pseudo classes?

Between getElementBy methods and querySelector methods which is better to use?


Event Basics

Explain various ways to configure an event with HTML elements.

Explain syntax of addEventListener() method.

What is an event object?


MouseEvent

How will you disable right click on an element?

How can you check whether a special key is pressed or not while an event is generated?

How do you check mouse button value while an event is generated?

For ctrl key and cmd on mac - how will you right the condition to check the key press.


ClientX/Y Vs. PageX/Y Vs. ScreenX/Y - Coordinates

Explain the difference between clientX/Y and pageX/Y.

Explain the difference between clientX/Y and screenX/Y.


Keyboard Events

How can you check if control and Z is pressed or not?

What does event.code return ?

Explain the difference between event.code and event.key ?


Input Element Events

What is the difference between onblur and onchange event?

How will you handle events of checkbox and radio buttons [onchange/click]?

Differentiate onkeypress/onkeyup and oninput event.

Which event you prefer with select [i.e. drop down list]?

How will you get the text value of selected item from a select element i.e. a drop down list?


oncut,oncopy & onpaste events

Explain about cut,copy and paste events.

How can you stop an event of cut, copy or paste for an element?

7
Asynchronous JS
8
Map, Set, WeakMap & WeakSet (ES6 Data structure)
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.7
4.7 out of 5
143 Ratings

Detailed Rating

Stars 5
104
Stars 4
32
Stars 3
6
Stars 2
1
Stars 1
0
30-Day Money-Back Guarantee

Includes

12 hours on-demand video
8 articles
Full lifetime access
Access on mobile and TV
Certificate of Completion
JavaScript – Marathon Interview Questions Series 2021
Price:
$108.98 $79

Community

For Professionals

For Businesses

We support Sales, Marketing, Account Management and CX professionals. Learn new skills. Share your expertise. Connect with experts. Get inspired.

Community

Partnership Opportunities

Layer 1
samcx.com
Logo
Register New Account
Compare items
  • Total (0)
Compare
0