Java script Interview questions

Nimish Goel
2 min readJun 4, 2023

Java script Interview questions

3.1 Closures — Closures can also access the variables of its outer function even after the function has returned. This allows the returned function to maintain access to all the resources of the outer function.

3.2 ES6/7

3.2.1 Classes and inheritance with coding example

3.3 Coding exercise (format Date ) — was not able to write- but did a good try

3.4 Functional scoping

access to block

3.5 Classes creating and using

3.6 Troubleshooting using chrome inspect/firebug

3.7 Network tab

3.8 Event handling (with code)

3.9 Timing events Debounce, Throttle and setInterval and setTimeout

3.10 Event capturing and event bubbling.

3.11 Apply, bind and call

3.12 debooucning and throtlling

3.13 call — allowing to call a function which is defined somewhere else. But in the same context,

3.14 apply is similar to call, but have list of argument in form of array instead of all parameters.

3.15 bind

3.15 Prototyping in javascript: The JavaScript prototype property allows you to add new properties to object constructors:

Coding Questions asked in calls:

1. Difference between ‘==’ and ‘===’

2. Difference b/n null and undefined

3. childObj.prototype = new ParentClass();

4. Different types of data types in JS

const arr = [20,12,23]

for(var i=0; i < arr.length; i++) {

setTimeout(function(){ console.log(i+” Hello “+ arr[i]); }, 0);

}

4. HTML

4.1 HTML 5

1. Usage of DOCTYPE in an html page (Standards and quirks mode): tell browser about version

2. New elements in HTML5 :

footer header nav

3. New semantic elements in HTML5

4. Form Attributes in HTML5 (GET and POST)

5. Any multimedia elements in HTML5

video audio

6. HTML5 API(Application Programming Interfaces) -> Geolocation : no

7. Can we use 2 submit buttons in an HTML form

8. Self closing tags

9. Difference between cookies, sessionStorage, and localStorage

cookies : server communication

SessionStorage :windows/tab/Browser closed

localStorage: client side

10. Write down a simple html page that contains a form and form should have 2 text fields to accept user name and password and a submit button

5. CSS

5.1 Responsive design

5.2 Bootstrap

5.3 Best practices to create fluid/adaptive layouts

1. Different ways to include CSS in a page

2. pseudo classes in CSS

3. ‘+’, ‘~’, ‘>’, ‘ ‘

4. Default value given by browser to position, float, display

5. What is CSS box model

6. What is z-index ?

7. Difference between padding and margin

8. Margin collapsing

9. Difference between visibility and display

10. rem, em, ox

React

1. React 15

1.1 Custom components

JSX

conversion

→ function

virtual DOM:

copy of realDOM.

inmemory

Advantage:

render method

What are the different phases of React component’s lifecycle?

mounting

updating

unmounting

1.2 Event handling

handle event in react

jsx

handler

1.3 State management

1.4 Communication of (data/events) between

1.4.1 Parent to child — prop

1.4.2 Child to parent — using call back — after hints

1.4.3 Siblings

Coding on passing data : wrote prototype but was hesitant in writing full code

1.5 Routing mechanism

2. Redux

store

action

reducer

6. Unit testing

--

--

Nimish Goel

UI Developer, Business enthusiastic, coder, angular developer,