Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Frontend Developer Interview Questions and Answers

Ques 16. What is responsive web design?

Responsive web design is an approach that makes web pages render well on a variety of devices and window or screen sizes. It uses flexible grids and layouts, along with media queries.

Example:

```css
@media only screen and (max-width: 600px) {
  body {
    font-size: 14px;
  }
}```

Is it helpful? Add Comment View Comments
 

Ques 17. Explain the difference between `==` and `===` in JavaScript.

`==` is the equality operator that performs type coercion, while `===` is the strict equality operator that checks both value and type without coercion.

Example:

```javascript
console.log(5 == '5'); // true
console.log(5 === '5'); // false
```

Is it helpful? Add Comment View Comments
 

Ques 18. What is the purpose of the 'defer' attribute in a script tag?

The 'defer' attribute in a script tag tells the browser to execute the script after the HTML is completely parsed, but before firing the DOMContentLoaded event.

Example:

```html

```

Is it helpful? Add Comment View Comments
 

Ques 19. How does CSS specificity work?

Specificity is a set of rules that determines which style declarations are applied to an element. It is based on the importance, specificity, and source order of CSS rules.

Example:

```css
#id-selector {
  color: red; /* higher specificity */
}

.class-selector {
  color: blue;
}
```

Is it helpful? Add Comment View Comments
 

Ques 20. What is the purpose of the 'async' and 'defer' attributes in a script tag?

'async' loads the script asynchronously, allowing it to execute while the page continues parsing. 'defer' loads the script asynchronously but ensures it executes in order after HTML parsing.

Example:

```html


```

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2025 WithoutBook