Top Web Developer Interview Questions and Answers For 2022

 




Q1) What is a pseudo-class?

It is a CSS technique that sets the style when an element changes its state. E.g. style changes when mouse hover, different styles for visited or unvisited links, etc. There are four different types of pseudo-classes:
  • Links: These pseudo-classes are used to style the link both in its normal state by default and when it has already been visited
  • Dynamic: Dynamic pseudo-classes can be applied to any element to define how they are shown when the cursor is located on them, or by clicking on them or when they are selected
  • Structural: Structural pseudo-classes allow to style elements based on an exact numerical position of the element
  • Others: Some elements can be styled differently based on the language or what type of label they are not.

Q2) What is Namespacing in JavaScript?

It is usually not a good practice to use global variables in programming languages including JavaScript. However, you may have to use global variables sometimes. So, JavaScript introduces the concept of namespacing which ties down a part of the code and registers it with a unique name. The namespace is nothing more than a container name where we hold classes, functions, and variables that can be repeated with the same name in other namespaces or namespace without involving an error.

Q3) What is CORS? Why is it important?

Cross-Origin Resource Sharing (CORS) is a browser mechanism that allows controlled access to resources located outside of a given domain. It enables a web page from one domain to access a resource with a different domain (a cross-domain request). It is a relaxation of the same-origin policy implemented in modern browsers. Due to the same-origin policy followed by XMLHttpRequest and fetch, JavaScript can only make calls to URLs that live on the same origin as the location where the script is running. Without features like CORS, websites are restricted to accessing resources from the same origin through the same-origin policy.

Q4) What are the advantages of HTTP 2.0 over HTTP 1.1?

The major advantages of HTTP 2.0 over HTTP 1.1 include –
  • Higher loading speed
  • Less broadband consumption
  • Immediate presentation
  • Improvement of web positioning
  • Automatic prioritization

Q5) How is HTML different from XHTML?

HTML and XHTML are both known for writing web pages. But, HTML is extended from SGML tagging whereas XHTML is an application of Extensible Markup Language (XML). HTML has three components – element tag pair (start tag and end tag), attributes of the element within the tag, and content in the form of both text and graphics. Whereas XHTML includes only a single root element which includes lower case elements and the value that is assigned should be closed, nested, and must be surrounded by quotation marks. Looking at the difference, XHTML is more expressive when compared to HTML.


More Questions

1)What is difference between Java and JavaScript.
2)What are the data types supported by JavaScript?
3)Is JavaScript a case-sensitive language?
4)What are the advantages of JavaScript?
5)Write a JavaScript code for adding new elements dynamically ?
6)What are global variables? How are these variable declared and what are the problems associated with them ?
7)Explain Hoisting in JavaScript.
8)Difference between "==" and "===" operators.
9)What is npm? [Node.js]
10)What is DOM (Document Object Model)?


More Blogs on Web Development :


Some Interesting Web Development Projects For Beginners :

AJ Blogs

Hello everyone, My name Arth and I like to write about what I learn. Follow My Website - https://sites.google.com/view/aj-blogs/home

Post a Comment

Previous Post Next Post
Best Programming Books

Facebook

AJ Facebook
Checkout Our Facebook Page
AJ Blogs
Checkout Our Instagram Page