Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Name the major HTTP requests

Answer»
HTTP RequestsDescription
GETIt is sent when we wish to recover data from the server. GET request is the most typically used HTTP request.
HEADThe HEAD is a reaction that is the same as the GET request but doesn’t possess a message-body in the response. The HEAD request method is beneficial in retrieving meta-data that is documented as per the headers, without transferring the entire content. The method is commonly utilised when testing HYPERTEXT links for recent change, accessibility, and validity.
TRACETRACE requests are implemented to invoke a remote, application loop-back test along the path to the target resource. The TRACE method lets users to witness whatever message is being received at the other end of the request chain so that they can utilise the data for testing or diagnostic functions.
POSTThis request is utilized to transmit data from the user to the server. By submitting web forms, these requests can be made. The POST request is GENERALLY utilized to build data in the database.
For instance, when we build a new account on any webpage, we make use of the POST request.
PUTIt is IDENTICAL to POST, but it is utilized to revise the existing data on the server. For instance, when we wish to revamp our complete account on a web page, we utilize the PUT request.
PATCHIt is identical to PUT and is utilized when we wish to revise a certain field of our data. For instance, when we just wish to update our name or any additional information about our account, we can make use of the PATCH request.
HTTP Status codesDescription
HTTP Status Code 301 - Permanent RedirectAny time one URL needs to be redirected to another permanently, a 301 redirect should be used. A 301 redirect implies that bots and visitors that come on that page will be taken to the new URL. Link equity is also passed to the new URL via a 301 redirect. 
HTTP Status Code 302 - Temporary Redirect 302 redirect is just like a 30, where it passes visitors and bots to the new page, but it MAY not pass along link equity. It is not recommended using 302 redirects for permanent changes.
HTTP Status Code 404 - Not FoundThis implies the server did not find the file or page that the browser is requesting. 404s don’t show whether the missing resource or pages are missing temporarily or permanently. You can check what this appears to be on your site by writing in a URL that doesn’t exist. Every site will have some pages that display the 404 status codes.
HTTP Status Code 200 - OKThis is the ideal status code for a properly functioning page. 
HTTP Status Code 410 - GoneA 410 implies the page is no longer available from the server and they have set no forwarding address. Any links you present on your site that are directed to a 410 page are sending visitors and bots to a dead resource.
HTTP Status Code 500 - Internal Server ErrorThis status code shows a problem with the server and will affect access to your site. Bots and human visitors alike will get lost, and your link equity will go nowhere fast. 
HTTP Status Code 503 - Service Unavailable503 response, shows that the server is unavailable. This could be because of temporarily overloading the server or maintenance of the server.
Additional Useful Resources
  • Front End DEVELOPER Salary in India – For Freshers & Experienced
  • Front-End Developer Resume Sample (PDF): Full Guide and Example
  • Best Front End Frameworks
  • Difference Between Frontend and Backend – Frontend Vs Backend
2.

Why do we utilize the “use strict”; statement?

Answer»

TheUSE strict’ statement sets a few restrictions in the SCRIPT. Typically, it is utilized to facilitate the strict mode of the script, making sure there could be no loose coupling LIKE UNDECLARED variables.

3.

State the difference between == and ===?

Answer»

 == denotes abstract EQUALITY operator, and it inspects if TWO values are equal or not apart from their data TYPES. Automatically, it transforms the type of both the operands and COMPARES them.

Example: 

1=='1'; //true1==1; // true

=== denotes identity equality operator, and it inspects the values of both the operands and their data type. The outcome of the operation will be true considering both the operands are equal and have the same data type, or ELSE it returns false.

Example: 

1===1 //true1==='1' // false
4.

What is the difference between attribute and property?

Answer»

Attributes are an element of an HTML document while properties are a part of the Document Object Model (DOM).

Example: <input type="TEXT" value="Tech">

Here, value and type are the attributes of HTML, but when the statement is READ by the browser and parses this code it will make a DOM with DIFFERENT properties, like accept, autofocus, ACCESSKEY, baseURI, checked, childElementCount, align, alt, childNodes, children, classList, className, attributes, and clientHeight.

Example:

var data = document.querySelector(input); // here we created a document object of input tagconsole.log(input.getAttribute('value')); // tech // getting the attribute valueconsole.log(input.value); // tech // getting the property of the input object
5.

Suggest how can we optimize our front-end page.

Answer»
  • The consumption of resources can be reduced by the pages by enhancing the server response.
  • Utilize JAVASCRIPT and EXTERNAL CSS instead of internal or in-line.
  • Utilize the framework to ensure the front-end becomes more RESPONSIVE to different devices.
  • Open-source libraries can be used to manage the browser-specific styling issue.
  • Make use of progressive LOADING like Lazy Loading to enhance the rendering of heavy elements, like videos and images.
  • Connect the style sheet in the header and script at the top of the HTML's body tag.
  • Utilize browser storage to keep user-specific private data.
6.

Mention the pitfalls for using a CSS Preprocessor like Sass?

Answer»
  • An EXTRA tool for the preprocessor is required.
  • Preprocessor files can not be performed DIRECTLY on the browser.
  • Slow re-compilation of the preprocessor.
  • For the preprocessor, you OUGHT to KNOW extra tools, which IMPROVE the learning curve of CSS.
7.

Suggest some ways on how to fix the browser-specific styling issue?

Answer»
  • We can make a distinctive stylesheet for various browsers making use of server-side rendering.
  • Another method is utilizing a library such as BOOTSTRAP, which already has the code to manage the browser-specific styling issue.
  • Reset or Normalize CSS can ALSO be utilized. MULTIPLE 3rd PARTY plugins equip libraries for browser styling issues.
8.

What do you know about the CSS image sprites and why it is utilized?

Answer»

CSS IMAGE sprites assist to render numerous images in a single line image. In a nutshell, the CSS sprites merge numerous PHOTOS into a single large image. If a web page comprises DIFFERENT images, then it would RAISE its loading TIME as for every image the browser has to send a distinct HTTP request, but with the help of sprites, we have a single image to request.

9.

Define the Anonymous function in JS?

Answer»

GENERALLY, the function NAME is defined when we define the function itself, in normal user-defined functions, but in the case of an ANONYMOUS function, the function name is not defined. Here we make use of an ASSIGNMENT operator and variable to stow the function as an object, then utilizing that variable, we will be capable to INVOKE the function itself.

Example:

10.

Mention the difference between MySQL and MongoDB?

Answer»
  • MySQL: It is a RELATIONAL DATABASE Management System (RDBMS), which makes use of SQL as a standard language to handle its database. Like different relational database management systems, MySQL makes use of a table-like structure to stow data.
  • MONGODB: MongoDB is a NoSQL database that utilizes the JSON-like structure to stow data elements. To MODIFY and access data in MongoDB, the programmer ought to make use of the MongoDB Query Language (MQL).
11.

In an image tag, what is the benefit of the srcset attribute?

Answer»

srcset is utilized when we wish to GENERATE several RESOLUTIONS of the exact IMAGE on several devices. This improves the UI. The browser will display low resolution on low-end devices, and high resolution of an image on high-end devices.

Example:

<img srcset="picture_low.jpg 480w, picture_high.jpg 800w" sizes="(max-width: 600px) 480px, 800px" src="picture_high.jpg" alt="Elva dressed as a fairy">
12.

What is Progressive Rendering?

Answer»

Progressive rendering is a process that is utilized generally to boost the web page's rendering CONTENT process. Now the rendering process is utilized in MODERN web development to enhance the mobile data uses of the USER, async HTML FRAGMENTS, prioritizing visible content, and LAZY loading of images.

13.

State all the elements of the CSS Box Model.

Answer»

In its BOX model, CSS comprises 4 ELEMENTS:

  • Content – Displays the main content and the text of the WEB page.
  • Padding – This area encircles the content.
  • Border – The border is the padding's OUTER layer.
  • Margin – Margin is the area outside the border.
14.

What is stringify?

Answer»

IN a JSON METHOD, STRINGIFY is used to transform a JavaScript object into a string. JSON is a common structure to RECEIVE and send data between the web SERVER and the client, and when we wish to send data to the webserver, the object ought to be a string.

Example: