Full stack Developer Interview Questions and Answers


Q11: What is the difference between a blue/green deployment and a rolling deployment?

Ans:

  • You have TWO full ecosystems in Blue/Green Deployment. The Blue environment is the one that is currently operational, and the Green environment is the one to which you wish to upgrade. When you change the environment from blue to green, all traffic is sent to your new green environment. You can delete or save your old blue environment until the green environment is established as a backup.
  • There is only ONE full environment in Rolling Deployment. The code is deployed in a subset of the same environment's instances and then moved to another subset after completion.

Q12: How can you share code between files?

Ans: This is determined by the JavaScript environment. All scripts on the client (browser environment) can refer to variables/functions declared in the global scope (window). For a more modular approach, use Asynchronous Module Definition (AMD) through RequireJS. .
.
The most popular approach on the server (Node.js) has been to utilize CommonJS. Each file is considered a module, and by adding variables and functions to the module, it may export them. The object is exported. ES2015 specifies a module syntax that is intended to replace both AMD and CommonJS. This will be supported in both browser and Node environments in the future.

Q13: What are the disadvantages of GraphQL?

Ans: Disadvantages of GraphQL are:

  • You must first learn how to set up GraphQL. Because the ecosystem is still quickly developing, you must stay up.
  • You must transmit the queries from the client; you may send strings, but if you want more comfort and caching, you will need a client library -> additional code in your client.
  • It would be best if you first established the schema, which means more effort before you can get results.
  • It would help if you had a GraphQL endpoint on your server => new libraries that you are unfamiliar with.
  • Graphql queries consume more data than just visiting a REST API.
  • The server must do further processing to parse the query and validate the parameters.

Q14: What is CORS in MVC, and how it works?

Ans: CORS is an acronym that stands for Cross-Origin Resource Sharing. It is a W3C standard and a method based on HTTP headers. It allows a server to indicate any additional sources (such as domains, ports, and so on) instead of the requested one. In other words, it allows one website to use JavaScript to access the resources of another website. .
.
It allows for safe cross-origin requests and data transmission between servers and browsers. CORS is used in APIs by advanced browsers. In comparison to JSONP, it is more adaptable and secure (JSON with Padding). It improves web service integration. .
.
The same CORS service may be utilized when using MVC to enable CORS; however, we cannot use the same CORS middleware. We may utilize a certain CORS for a specific action, a specific controller, or globally for all controllers. The browser sends a pre-flight check (or request) to the server (hosting the cross-origin resource) to determine if the server will allow the real request or not.

Q15: What is double brace initialization in Java, and where is it used?

Ans: Double brace initialization in Java is a mixture of two distinct operations. It involves two consecutive curly brackets. The initial curly brace symbolizes the formation of an unnamed inner class. Keep in mind that the second curly brace will not be evaluated in this situation. It's the same as establishing an anonymous inner class. The second curly brace represents an initialization block, which we've already seen as a class for initialization. When we use the initialization block for an anonymous inner class, it transforms into Java double brace initialization. The inner class refers to the outer class it is enclosed by. Using this pointer, we may access the reference. It is used to initialize collections because double brace initialization makes it easier to initialize a constant collection.