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 some famous companies that use Microservice architecture.

Answer»

Microservices ARCHITECTURE has REPLACED MONOLITHIC architecture for most large-scale websites like: 

  • Twitter 
  • Netflix 
  • Amazon, ETC
2.

Explain CDC.

Answer»

As the name implies, CDC (Consumer-Driven Contract) basically ensures service COMMUNICATION COMPATIBILITY by establishing an agreement between consumers and service providers REGARDING the format of the data exchanged between them. An agreement like this is CALLED a contract. Basically, it is a pattern used to develop Microservices so that they can be efficiently used by EXTERNAL systems.

3.

What do you mean by client certificates?

Answer»

The client certificate is a type of digital certificate that GENERALLY allows client systems to AUTHENTICATE their requests to remote servers. In MANY mutual authentication DESIGNS, it plays a key ROLE in providing strong assurance of the requestor's identity.

4.

Explain how independent microservices communicate with each other.

Answer»

Communication between microservices can take place through: 

  • HTTP/REST with JSON or binary protocol for request-response 
  • Websockets for streaming.  
  • A broker or server program that USES advanced routing algorithms.  

RABBITMQ, Nats, Kafka, etc., can be used as message brokers; each is built to handle a PARTICULAR message semantic. You can also USE Backend as a SERVICE like Space Cloud to automate your entire backend. 

5.

Explain PACT in microservices.

Answer»

PACT is defined as an open-source tool that allows service providers and consumers to test interactions in isolation against contracts that have been MADE to increase the reliability of MICROSERVICE integration. It also offers support for numerous languages, such as RUBY, Java, Scala, .NET, JavaScript, Swift/Objective-C. 

6.

What are the challenges that one has to face while using Microservices?

Answer»

The challenges that one has to face while using microservices can be both functional and technical as GIVEN below: 

Functional Challenges:

  • Require heavy infrastructure setup. 
  • NEED Heavy INVESTMENT
  • Require excessive planning to handle or manage operations overhead.

Technical Challenges:

  • Microservices are always interdependent. Therefore, they must communicate with each other.   
  • It is a heavily involved model because it is a distributed SYSTEM.   
  • You need to be prepared for operations overhead if you are using Microservice architecture.   
  • To support heterogeneously distributed microservices, you need skilled professionals.    
  • It is difficult to automate because of the number of smaller components. For that reason, each component must be built, deployed, and monitored separately.   
  • It is difficult to manage CONFIGURATIONS across different environments for all components. 
  • Challenges associated with deployment, debugging, and testing. 
7.

Write the fundamental characteristics of Microservice Design.

Answer»
  • Based on Business Capabilities: Services are DIVIDED and organized around business capabilities. 
  • Products not projects: A product should belong to the TEAM that handles it.  
  • Essential messaging frameworks: Rely on functional messaging frameworks: Eliminate centralized service buses by embracing the concept of decentralization.  
  • DECENTRALIZED Governance: The development teams are accountable for all aspects of the software they produce.  
  • Decentralized DATA management: Microservices ALLOW each service to manage its data separately.  
  • Automated infrastructure: These systems are complete and can be deployed independently.   
  • Design for failure: Increase the tolerance for failure of services by focusing on continuous monitoring of the applications. 
8.

What do you mean by Bounded Context?

Answer»

A Bounded Context is a central pattern in DDD (Domain-Driven DESIGN), which deals with collaboration across large models and teams. DDD breaks large models down into multiple contexts to make them more MANAGEABLE. Additionally, it EXPLAINS their relationship explicitly. The concept promotes an object-oriented approach to developing services bound to a data model and is also responsible for ensuring the integrity and mutability of SAID data model. 

9.

What do you mean by Cohesion and Coupling?

Answer»

Coupling: It is DEFINED as a RELATIONSHIP between software modules A and B, and how much one module depends or interacts with another one. Couplings fall into three major categories. Modules can be highly coupled (highly dependent), loosely coupled, and uncoupled from each other. The best kind of coupling is loose coupling, which is achieved through interfaces. 

Cohesion: It is defined as a relationship between TWO or more parts/elements of a module that serves the same purpose. Generally, a module with high cohesion can PERFORM a specific function efficiently without NEEDING communication with any other modules. High cohesion enhances the functionality of the module.

10.

What issues are generally solved by spring clouds?

Answer»

The following problems can be SOLVED with spring cloud:   

  • Complicated issues caused by distributed systems: This includes network issues, latency problems, bandwidth problems, and security issues. 
  • SERVICE Discovery issues: Service discovery ALLOWS processes and services to communicate and locate each other within a cluster. 
  • Redundancy issues: Distributed systems can often have redundancy issues. 
  • Load balancing issues: Optimize the distribution of workloads among multiple computing RESOURCES, including computer clusters, central processing units, and network links. 
  • Reduces PERFORMANCE issues: Reduces performance issues caused by various operational overheads. 
11.

Explain how you can override the default properties of Spring boot projects.

Answer»

By specifying properties in the application.properties FILE, it is possible to override the default properties of a spring boot PROJECT.  

EXAMPLE
In Spring MVC applications, you need to SPECIFY a suffix and prefix. You can do this by adding the properties LISTED below in the application.properties file. 

  • For suffix – spring.mvc.view.suffix: .jsp 
  • For prefix – spring.mvc.view.prefix: /WEB-INF/ 
12.

What is the role of actuator in spring boot?

Answer»

A spring BOOT ACTUATOR is a PROJECT that provides restful WEB services to access the current state of an application that is running in production. In addition, you can monitor and manage application usage in a production environment without having to code or configure any of the applications.

13.

Explain spring cloud and spring boot.

Answer»

Spring Cloud: In Microservices, the Spring cloud is a system that integrates with external SYSTEMS. This is a short-lived framework designed to build applications quickly. It CONTRIBUTES significantly to microservice ARCHITECTURE due to its association with finite amounts of data processing. Some of the features of spring cloud are shown below:

Spring Boot: Spring Boot is an open-sourced, Java-based framework that provides its developers with a platform on which they can create stand-alone, production-grade Spring applications. In addition to reducing development time and increasing productivity, it is easily UNDERSTOOD.  

14.

Write difference between Monolithic, SOA and Microservices Architecture.

Answer»
  • Monolithic Architecture: It is "like a big container" where all the software components of an application are bundled together tightly.  It is usually built as one large system and is one code-base. 
  • SOA (Service-Oriented Architecture): It is a group of services interacting or communicating with each other. Depending on the nature of the COMMUNICATION, it can be SIMPLE data exchange or it could involve several services coordinating some activity.   
  • Microservice Architecture: It involves structuring an application in the form of a cluster of SMALL, autonomous services modeled AROUND a business domain. The functional modules can be deployed independently, are scalable, are aimed at achieving specific business goals, and communicate with each other over standard protocols. 
15.

Explain the working of Microservice Architecture.

Answer»

Microservice architectures consist of the following components: 

  • CLIENTS: Different users send requests from various devices. 
  • Identity Provider: Validate a user's or client's identity and issue security tokens. 
  • API Gateway: Handles the requests from clients. 
  • Static Content: Contains all of the system's content. 
  • Management: Services are balanced on NODES and failures are identified. 
  • Service Discovery: A GUIDE to discovering the routes of communication between microservices. 
  • Content Delivery Network: Includes distributed network of proxy servers and their data centers. 
  • Remote Service: Provides remote ACCESS to data or information that resides on NETWORKED computers and devices. 
16.

Name three common tools mostly used for microservices.

Answer»

THREE COMMON TOOLS used for microservices INCLUDE

17.

What are the benefits and drawbacks of Microservices?

Answer»

Benefits: 

  • Self-contained, and independent deployment module. 
  • Independently managed services.   
  • In order to improve performance, the demand service can be deployed on multiple servers.   
  • It is easier to test and has fewer dependencies.  
  • A greater degree of scalability and AGILITY.   
  • Simplicity in debugging & MAINTENANCE.  
  • Better communication between DEVELOPERS and business users.   
  • Development teams of a smaller size.

Drawbacks: 

  • Due to the complexity of the architecture, testing and monitoring are more difficult.  
  • Lacks the proper corporate culture for it to work.   
  • Pre-planning is essential.  
  • Complex development.  
  • REQUIRES a cultural shift.  
  • Expensive COMPARED to monoliths.   
  • Security implications. 
  • Maintaining the network is more difficult.  
18.

Write main components of Microservices.

Answer»

Some of the main components of MICROSERVICES include: 

  • Containers, Clustering, and ORCHESTRATION 
  • IaC [Infrastructure as CODE CONCEPTION
  • Cloud Infrastructure 
  • API Gateway 
  • Enterprise Service Bus 
  • Service Delivery 
19.

Write main features of Microservices.

Answer»

Some of the main features of Microservices include:

  • Decoupling: Within a system, services are largely decoupled. The application as a whole can therefore be easily constructed, altered, and scalable
  • Componentization: Microservices are viewed as independent COMPONENTS that can easily be exchanged or upgraded
  • Business Capabilities: Microservices are relatively simple and only focus on one service
  • Team autonomy: Each developer works independently of each other, allowing for a faster project timeline
  • Continuous Delivery: ENABLES frequent software RELEASES through systematic automation of software development, testing, and approval
  • Responsibility: Microservices are not focused on applications as projects. Rather, they see applications as products they are responsible for
  • Decentralized Governance: Choosing the right tool according to the job is the goal. Developers can choose the best tools to solve their problems
  • Agility: Microservices facilitate AGILE development. It is possible to create new features QUICKLY and discard them again at any time.