InterviewSolution
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. |
What do you mean by observer pattern? |
|
Answer» If several OBJECTS are TIED together in one-to-many relationships, the observer pattern is used. Every time one object is modified, then all of its dependent objects are automatically notified and updated. It falls under the behavioural pattern category. It describes the COUPLING between the objects and the observer and provides support for broadcast-type COMMUNICATION. The object that observes the state of ANOTHER object is known as the observer, and the object that is being observed is known as the subject as shown below: |
|
| 2. |
Explain dependency injection. |
|
Answer» The Dependency INJECTION (DI) pattern is a design pattern for implementing the INVERSION of Control (IOC). DEPENDENT objects can be created outside of classes and made available to classes in different ways. Three types of classes are involved in Dependency Injection as follows:
|
|
| 3. |
Is there a way to decrease the load time of a web application? |
|
Answer» Here are some ways to reduce load times for web applications:
|
|
| 4. |
Explain event loop in Node.js. |
|
Answer» The event loop in JavaScript enables asynchronous programming. With JS, every OPERATION takes place on a single thread, but through smart data STRUCTURES, we can create the illusion of multi-threading. With the Event Loop, any async WORK is handled by a queue and listener. Consider the diagram below: Therefore, when an async function (or an I/O) needs to be executed, the main thread relays it to another thread, allowing V8 (Javascript engine) to continue processing or running its code. In the event loop, there are different phases, like pending callbacks, closing callbacks, timers, idle or preparing, polling, and checking, with different FIFO (First-In-First-Out) queues. |
|
| 5. |
What are some of the uses of Docker? |
|
Answer» One of the thorniest problems in software development is dealing with the different environments across different machines and platforms. USING Docker, you can isolate your applications from your infrastructure, which is crucial to delivering software quickly. DEVELOPERS can package and run their applications into containers, executable components that have all the OS (Operating SYSTEM) libraries and dependencies needed to run the application in any environment. It does not matter what is installed on the host—containers are lightweight and include everything needed to run applications.
|
|
| 6. |
Explain the benefits and drawbacks of using "use strict". |
|
Answer» In ECMAScript5, a new feature known as strict mode allows you to run a program or function within a strict operating context. Certain ACTIONS, therefore, cannot be taken due to this strict context, and more exceptions are THROWN. When the "use strict" statement is used, the browser is instructed to use "strict" mode, which is a more restricted and safer JavaScript feature set. You can specify "use strict" at the top of a function to evaluate the JS in strict mode. In strict mode, more errors are thrown and some features are disabled to make your code more robust, clear, and accurate. Advantages:
Disadvantages:
|
|
| 7. |
Explain the meaning of multithreading. |
|
Answer» The thread is an independent part or unit of a PROCESS (or an application) that is being executed. Whenever multiple threads execute in a process at the same time, we call this "multithreading". You can think of it as a way for an application to multitask. Advantages:
|
|
| 8. |
What is CI (Continuous Integration)? |
|
Answer» CI (Continuous Integration), as its name implies, is the process of automating and integrating code changes into a single software project, often several times a day. The purpose of this DevOps practice is to enable DEVELOPERS to merge their code changes into a central repository where automated tests and builds can run. Automated tools are used to assert the new code’s correctness before integration. A source code version control system is the crux of the CI process. The version control system is also SUPPLEMENTED with other checks like automated code quality tests, syntax style review tools, and more. Advantages:
|
|
| 9. |
State difference between GraphQL and REST (Representational State Transfer). |
||||||||||||||
|
Answer» For decades, REST (Representational State Transfer) has been a POPULAR architectural way to design APIs (Application Programming Interfaces), but the popularity of GraphQL over the past few years threatens to topple REST. In general, REST and GraphQL both aim to transfer data over internet protocols including HTTP. How they do so differs greatly, however.
|
|||||||||||||||
| 10. |
Can you tell me what are the latest trends in Full Stack Development? Also, how do you keep yourself updated about the new trends in the industry? |
|
Answer» Each business needs emerging technology to THRIVE, WHETHER it is mobile or web application development. This is why they hire front-end developers, back-end developers, or full-stack developers depending on their technology needs. According to industry experts, candidates who are passionate about full-stack development should be aware of these trends:
The interviewer MAY ask you how you keep updated with new trends in the industry. You can explain how you gain your knowledge and understanding by learning from friends, colleagues, or online. That's an appropriate way of answering the question. This is a good time to show off any personal projects you have undertaken that apply your skills. Also, you might mention the webinars or forums that you attend regularly. |
|
| 11. |
Explain Long Polling. |
|
Answer» Long polling is defined as a WEB application DEVELOPMENT technique used to push INFORMATION/data from servers to clients as QUICKLY as possible. When a request is made from the client to the server, long-polling MAINTAINS the connection between the two. This connection is maintained until the information is ready to be sent from the server to the client. Once a server receives a request from a client, the connection does not close immediately; the connection is only closed once the server has sent the data back to the client or when a timeout threshold has been reached (connection timeout). |
|
| 12. |
What is Callback Hell? |
|
Answer» Callback Hell, or Pyramid of Doom, is a COMMON anti-pattern seen in asynchronous programming code (MULTIPLE functions running at the same time). This slang term describes a large NUMBER of nested "if" statements or functions. In simple terms, Callback hell is a situation where you have multiple asynchronous functions. Those functions depend on one another, so it could get quite messy with so many callback functions nested in so many layers. The use of callback functions leaves you with code that is difficult to read and maintain, and looks like a pyramid as shown below: This also makes it more difficult to identify the flow of the application, which is the main obstacle to DEBUGGING, which is the reason for the famous NAME of this problem: Callback Hell. |
|
| 13. |
What do you mean by CORS (Cross-Origin Resource Sharing)? |
|
Answer» CORS refers to cross-origin resource sharing. It's a BROWSER mechanism that allows web pages in one DOMAIN to have controlled access to resources in other domains (cross-domain REQUESTS). This allows scripts that are run on a browser client to interact with and access resources from other origins. In doing so, it extends and provides greater flexibility to the SOP (Same-Origin Policy). Same-origin policies restrict the ABILITY of a website to access resources outside of its source domain. For example, a JavaScript app that wants to make a call to an API (Application Programming Interface) that runs on another domain will be blocked due to the SOP. A CORS policy was implemented to circumvent restrictions caused by same-origin policies. In addition, if a website's CORS policy is not configured properly, it may be vulnerable to cross-domain attacks. This MEANS that it cannot stop cross-origin attacks like CSRF (Cross-Site Request Forgery). |
|
| 14. |
Explain Pair Programming. |
|
Answer» In pair programming, two programmers share only one machine and work together. During the development process, one programmer will be the driver who codes and another will ACT as the observer (navigator) who will make sure the code is written correctly, proofread and spell-check it, while also deciding where to go next. ROLES can be swapped at any time: the driver becomes the observer and vice versa. You can also call it "pairing", "paired programming", or "programming in pairs". Advantages:
|
|
| 15. |
Which language is the most preferred by full-stack developers? |
|
Answer» Full Stack Developers UTILIZE SEVERAL PROGRAMMING languages. Ideally, a candidate should be fluent in several languages, preferably some for designing the front end and others for fixing the BACK end. Since Full Stack developers work with a variety of technologies and applications, they must be proficient in at least two to three of the most popular languages such as Java, Python, Ruby, PHP, C++, etc. |
|
| 16. |
To develop a project from scratch, what technologies and languages would you need or what skills a full stack developer should have? |
|
Answer» A full-stack developer must be familiar with the following:
|
|