Frontend Interview Questions
Frontend Interview Questions
Questions
1. What is the difference between HTML, CSS, and JavaScript?
Answer:
HTML (HyperText Markup Language): Used for creating the structure of a page.
CSS (Cascading Style Sheets): Used for styling and formatting the appearance of the page.
JavaScript: Used for making the page interactive and adding dynamic functionality.
9. What are Media Queries in CSS, and how are they used for
responsiveness?
Answer:
Media Queries allow for applying different styles based on the device's screen size.
Example:
@media (max-width: 768px) {
body {
background-color: lightblue;
}
}
12. What does the term 'Single Page Application' (SPA) mean?
Answer:
SPA refers to a web application that loads only one page from the server and dynamically
updates content without full page reloads.
18. What happens if you don’t specify the `width` attribute on an `img`
tag in HTML?
Answer:
If the `width` attribute is not set, the image will take up its intrinsic size, potentially affecting
layout.
19. What are the common image file types used on the web, and when
would you use each?
Answer:
JPEG: For high-detail images.
PNG: For images with transparency.
GIF: For animated images.
SVG: For scalable vector graphics.
20. What are some frontend frameworks that are commonly used?
Answer:
React: For building interactive user interfaces.
Angular: For comprehensive, full-featured applications.
Vue.js: For simple, flexible, and progressive frameworks.