Sai Kiran
2 min readJun 20, 2022

--

Interview questions 2022 basic javascript

I have attended many interviews when transitioning from one company to other company. There are set of common questions that are asked in the interviews as L1/base/beginner/foundation level JavaScript questions, you are expected to answer them in the initial stage of screening.

Following are the questions that I was asked during my interviews but going through these or mugging up these question and answers DOESN’T make you a “developer”. So, I haven’t posted any sort of answer down here.

Go through them understand the concepts, play with the code, become a developer and crack the interviews.

JavaScript

  1. Higher Order Functions
  2. Event bubbling
  3. Closures
  4. Function currying
  5. Event Loop
  6. Promises, async and await differences
  7. De-bouncing technique
  8. call, apply, bind methods and their use cases
  9. Advantages and disadvantages of SSR over CSR
  10. Given an array find the second largest and second smallest number
  11. How to create custom elements
  12. Ways to stop redirection
  13. Difference between DOM, V-DOM and Shadow DOM
  14. ES6 concepts — Scope, Destructuring, spread and rest operators, WeakSet
  15. Difference between the regular functions and arrow functions with examples and use case
  16. What is Webpack and babel
  17. Sequence of logs and why?
console.log('start')
let a;
console.log(myFunction)
function myFunction(){
console.log(a)
a = 10
console.log(a)
}
myFunction()
setTimeout(() => {
console.log("timeout")
}, 0)
fetch(/* some url */)
.then(() =>{
console.log(response.json()
})
console.log('end'))

18. Binding — output of the following code and why?

const User = {
name: 'ABC',
};
const User1 = {
name: 'XYZ',
};
function printName(age, city) {
console.log(this.name, age, city);
}
const boundedPrintName = printName.bind(User);const boundedNewPrintName = boundedPrintName.bind(User1);boundedNewPrintName(26, 'Pune');

19. Implement the following

calculate.add(5).multiple(5).substract(3).divide(11).value() //output 2

20. What is the output of the following code

let a ={}
let b = {key: 'b'}
let c = {key: 'c'}
a[b] = 78
a[c] = 34
console.log(a[b])

I will be writing more on the HTML, CSS, javascript, vue, react and laravel.
Let me know if there are any kind of mistakes or any basic questions that I missed in the comments.

--

--

Sai Kiran

Web Developer | javascript | react | vue | blockchain enthusiast | Lunar enthusiast