MERN Stack Interview Questions & Answer Series Part 4

Posted on July 2, 2023 By

MERN stands for MongoDB, Express, React, Node, after the four key technologies that make up the stack. MERN Stack Interview Part 4.

Q31. What is the use of WebSocket API?

The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user’s browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.

// Create WebSocket connection const socket = new WebSocket('ws://localhost:8080/");
// Connection opened
socket.addEventListener('open', function(event) { socket.send('Hello Server!');})

// Listen for messages
socket.addEventListener('message', function(event) { console.log('Message from server', event.data);)}

Q32. Explain Drag and Drop in HTML5?

HTML5 drag-and-drop uses the DOM event model and drag events inherited from mouse events.
A typical drag operation begins when a user selects a draggable element, drags the element to a droppable element, and then releases the dragged element.

Q33. Explain Microdata in HTML5?

  • Microdata is a standardized way to provide additional semantic in web pages. Microdata lets you define your own customized elements and start embedding custom properties in your web pages. At a high level, microdata consists of a group of name-value pairs.
  • At a high level, microdata consists of a group of name-value pairs.
  • itemscope: To create an item
  • itemprop: To add a property to an item

Q34. What are the HTML tags which deprecated in HTML5?

The following elements are not available in HTML5 anymore and their function is better handled by CSS.

  • <acronym>
  • <applet>
  • <basefont>
  • <dir>
  • <isindex>
  • <frameset>
  • <frame>
  • <noframes>
  • <big>
  • <strike>
  • <center>
  • <font>
  • <tt>
  • <u>
  • <s>

Q35. How you can use Modernizr in HTML5?

  • Modernizr is a JavaScript library that detects which HTML5 and CSS3 features visitor’s browser supports.
  • In detecting feature support, it allows developers to test for some of the new technologies and then provide fallbacks for browsers that do not support them.
  • This is called feature detection and is much more efficient than browser sniffing.

Q36. What is progressive rendering?

Progressive Rendering is the technique of sequentially rendering portions of a webpage in the server and streaming it to the client in parts without waiting for the whole page to rendered.

Q37. What is an iframe and how it works?

An inline frame is used to embed another document within the current HTML document.

<iframe src="https://www.webdeveloperguide.in/" width="500" height="500" title="Bitfumes"></iframe>

Q38. How can you highlight text in HTML?

  • The <mark> tag defines text that should be marked or highlighted.
  • <p>Follow <mark>WebDeveloperGuide</mark> For More Useful Content. MERN Stack Interview Part 4.</p>

Q39. Why you would use a srcset attribute in an image tag? Explain the process the browser used when evaluating the content of this attribute?

The srcset attribute allows to define a list of different image resources along with size information so that browser can pick the most appropriate image based on the actual device’s resolution.

Q40. How do you serve a page with content in multiple languages?

The lang attribute specifies the language of the element’s content.

<body>
  <h2>English</h2>
  <p lang="en">This is demo text</p>
  <h2>French</h2>
  <p lang="fr">Ceci est un texte de démonstration</p>
</body>

MERN Stack Interview Part 4. MERN Stack Interview MongoDB Express React Node Javascript.

Leave a Reply

Your email address will not be published. Required fields are marked *