Labs ICT
Pro Login

Junior Developer Interview Questions You Should Know

General Career 8 min read

Common interview questions for entry-level developer positions, with plain-English answers and tips.

Junior Developer Interview Questions You Should Know

Technical interviews for junior roles focus on fundamentals. Here are the most common questions asked and clear answers you can practice.

1. What Is the Difference Between null and undefined?

Undefined means a variable has been declared but not assigned a value. Null is an intentional assignment of an empty value. JavaScript uses undefined by default and null when you want to explicitly say there is nothing.

let a
console.log(a) // undefined

let b = null
console.log(b) // null

2. What Does === Do vs ==?

The === operator checks both value and type. The == operator only checks value and attempts type coercion. Always use === to avoid unexpected behavior.

5 == "5"   // true (type coercion)
5 === "5"  // false (different types)

3. What Is a Closure?

A closure is a function that remembers the variables from its outer scope even after the outer function has finished executing. Closures are used for data privacy and function factories.

function counter() {
  let count = 0
  return function () {
    count++
    return count
  }
}

const increment = counter()
increment() // 1
increment() // 2

4. What Is the DOM?

The DOM is the Document Object Model. It is a tree-like representation of your HTML that JavaScript can interact with. You use the DOM to dynamically change content, styles, and structure of a page.

5. What Is an API?

An API is an Application Programming Interface. It is a set of rules that lets one piece of software talk to another. REST APIs use HTTP requests to send and receive JSON data.

6. What Is Version Control?

Version control tracks changes to your code over time. Git is the most popular version control system. It lets you create branches, revert changes, and collaborate with other developers without overwriting each other's work.

7. What Are let, const, and var?

Var is function-scoped and can be redeclared. Let is block-scoped and can be reassigned but not redeclared. Const is block-scoped and cannot be reassigned or redeclared. Use const by default, let when you need to reassign, and avoid var.

var x = 1   // function scoped, reassignable, redeclarable
let y = 2   // block scoped, reassignable, not redeclarable
const z = 3 // block scoped, not reassignable, not redeclarable

8. What Are Arrays and Objects?

Arrays are ordered lists indexed by numbers. Objects are collections of key-value pairs. Both are used to store and organize data in JavaScript.

const colors = ["red", "green", "blue"]
const user = { name: "Alice", age: 25 }

9. How Does Event Delegation Work?

Event delegation uses a single event listener on a parent element to handle events from its children. Instead of adding a listener to every button, you add one listener to the container and check which button was clicked.

document.querySelector("#list").addEventListener("click", (e) => {
  if (e.target.tagName === "LI") {
    console.log("Clicked:", e.target.textContent)
  }
})

Note: Practice these answers out loud. Reading them is not enough. Say them as if you are explaining to a friend. Interviewers want to see that you understand concepts, not just memorized definitions.