========================
Web Development Interview Q&A
========================
1. What are some key skills required for a web developer?
A: HTML, CSS, JavaScript, responsive frameworks (Bootstrap), Git, frontend libraries (React, Angular), backend skills
(Node.js, Express.js), and databases (SQL, NoSQL).
2. What are the advantages of HTTP 2.0 over HTTP 1.1?
A: HTTP 2.0 supports multiplexing, header compression, server push, binary protocol, and stream prioritization for better
performance.
3. How do you select elements by class in JavaScript?
A: Use document.querySelectorAll(".classname"), which returns a NodeList of matching elements.
4. What is the difference between an ID and a class?
A: ID is unique to one element; class can be reused on multiple elements.
5. What is the purpose of namespaces in web development?
A: Namespaces help avoid naming conflicts by grouping code or styles under a unique identifier.
6. What is Webpack?
A: Webpack is a module bundler that packages JS, CSS, and assets into optimized output for deployment.
7. Explain the CSS box model.
A: It consists of content, padding, border, and margin that define the size and spacing of an element.
8. What is CORS?
A: Cross-Origin Resource Sharing restricts requests across different domains unless permitted.
9. What is HTML5 web storage?
A: localStorage and sessionStorage allow storing key-value pairs in the browser.
10. What are CSS selectors?
A: Patterns to target elements, like element, class, ID, attributes, and pseudo-classes.
11. Difference between inline and block elements?
A: Inline stays in the flow; block starts on a new line and spans full width.
12. What is the difference between <span> and <div>?
A: <span> is inline for small bits of content; <div> is block for larger content groups.
13. Difference between Canvas and SVG?
A: SVG is XML-based and scalable; Canvas is pixel-based for bitmap drawing.
14. What is the role of the W3C?
A: The World Wide Web Consortium develops web standards for interoperability and accessibility.
15. What are pseudo-classes in CSS?
A: They style elements based on state (e.g. :hover, :focus).
16. Difference between SQL and NoSQL?
A: SQL is relational and structured; NoSQL is non-relational with flexible data.
17. What is pair programming?
A: Two people share one computer: driver writes code, observer reviews it.
18. Explain scopes in JavaScript.
A: Global (everywhere), function (within function), block (within { } if let/const).
19. Cookies vs localStorage?
A: Cookies (small, sent with every request); localStorage (larger, client-only).
20. What are implicit and explicit type conversions in JS?
A: Implicit is automatic; explicit is using Number(), String(), etc.
21. What are CSS transitions?
A: Smooth style changes using transition-property, duration, timing-function, delay.
22. What is a closure in JS?
A: A function that retains access to its outer scope even after the outer function returns.
23. What is long polling?
A: Client holds request until new data arrives for real-time updates.
24. What are new input types in HTML5?
A: email, url, number, date, time, datalist, progress, meter.
25. What is CSS grouping?
A: Applying one style to multiple selectors with comma-separated selectors.
========================