Microservices Interview Question
- What is microservices? Decoupling of the
application into small small services. e.g. Amazon Seller, buyer,
Orders, shipping, catalog etc
- Difference between micro-services and web services?
A microservice is a software architecture, which can be implemented
with webservices. A webservice is just a technology (one of many) for
providing services over "web" or HTTP. Build the service for usablity
and we don't have idea who is going to use. e.g. IP-Locator ulity.
Web-service are mostly kind of utility.
Microservices is the application you know that where to use and
can potentaillity can use it.
- Difference between monolith/Service orient and micro
service application? - single deployable unit Vs collection of
loosely coupled services
- Big appln conatin all Vs collection of small autonomous
services (business domain)
- What are the tools to managing a microservice
- Elasticsearch - Full-text search engine
- Kafka - for messaging
- Jenkins - CI and CD
- Docker - deployment container
- MongoDB - Open source, JSON format,
- Kubernets - Kubernetes is an open-source container-orchestration
system for automating application deployment, scaling, and
- Cloud - Any cloud AWS, pivotal, Azure
- Services in Service Oriented architecture deal only
with data not UI. How about the micorservices? UI is also one
of the microservice.
- What is fault Tolerance and Resilience? If there
is fault in micor-service then what is the impace of the application.
e.g. One micro service go down, it will be complete micro service or
part/portion of functionlity of application go down. Resilience - How
many fault can system Tolerance and bounce back itself. Is there any
mechanism system can correct itself and bounce back itself.
- What is the advantage of microservice?
- Increased maintainability
- Flexibility / Possibility to write code in different languages
- Ease of Deployment/ independently
- Physical Isolation.
- Application Complexity / Code seperatly / Preserve Modularity
- Design for Failure
- Observability - Application health status
- Unlimited Application size
- What is the Dis-advantage of microservice?
- Testing Complexity
- Implementation Effort
- Network related issues
- User Authorization
- Automation Requirement
- Increased Dependence
- Development Complexity
- What is current Trends to microservices? -
Microservices move us towards continuous development and delivery
- DevOps is the integration of Development and Operations
- If MS1 talking to MS2 and then it talk to MS3, in
case if MS2 down then how we will debug? We can generate
co-relation id and pass through header and through splunk.
- What Is a Feign Client? Netflix provides Feign
as an abstraction over REST calls through which microservices can
communicate with each other but developers don't have to bother about
REST internal details.
- What are best practices of microservices? - Use
different DB for each service
- How we will restrick some microservices from
accessing by other microservices?
- How do you trace microservices? We can use
Spring Cloud Sleuth for tracing logs using Zipkin Distributed Tracing
- What is the difference between Microservices and SOA?
- SOA link Enterprise Service Bus(Websphere ESB, Oracle ESB, TIBCO
- SOA tried to XML and it's formalities and complexities ||| no
- SOA has centralized governance whereas Microservice
architecture recommands a decentralized governance
- SOA did not focus on the independent deployability of the
components ||| no such restriction
- What is the use of Kafka in Microservices? Kafka
is used for the communication between the microservices. Kafka needs
Zookeeper to coordinate instances.
- Is Kafka a Microservice?
- When to go for messaging queue(Kafka)
- Give event driven architecture example for
- What are the advantage of event driven architecture
programming? - Performance
- What are the challenges of microservices? -
Define the right boundries for the service
- Configuration management
- Dynamic scale up and scale down
- Why should you build an Archetype? Archetype
helps in automating the basic setup of a microservices. This helps in
standandizing project setup across an organization. Piece of code,
having all basic bunch of setup of all common things.
- Multiple Layers and Dependencies
- Unit Testing
- Integration Testing
- Integration with Nexus, SONAR etc
- What is Portability? Cost of migrating one
plateform to a new plateform. What is involve in moving to new
language, framework, Database etc. Not to have specific dependency on
plateform features e.g. specific features from oracle, linux etc.
- What is Maintainability? Have great low level
design i.e. Test driven development. Module level design. Should be
automatication i.e. CI and CD.
- What is API Gateway? It is the centeralize place
where implement shared logic like authentication, logging, audit etc
i.e. cross cutting concerns
- What is Eventual Consistency?
- What is JWT authorization? JSON Web tokens(JWT)
is a very popular way to do user authorization in web apps. JWT very
popular in micro services and web applications.
- How to run Spring boot application to custom port?
Specify the port in application.properties i.e. server.port=8090
- What is YAML? YAML is a human-readable data
serialization language. It is commonly used for configuration files.
YAML file is much more structured and less confusing in case. As
can be seen YAML has hierarchical configuration data. Also suppose we
want to fetch the properties from the YAML file this can be easily
done using an Iterator.
description: Application for javarefresh data.
Can get the value like
private List String> infoConfigurations;
How you will configure the Configuration file without
info.app.description=Application for javarefresh data.
What is Domain Driven Design?
Design is an architectural style based on Object-Oriented Analysis
Design concepts and principles. It helps in developing a complex
system by connecting the related components of the software
What are the different strategies of Microservices
- Focus on the core domain and domain logic.
- Base complex designs on models of the domain.
- Regularly collaborate with the domain experts to improve the
application model and resolve any emerging domain-related issues.
What are Reactive Extensions in Microservices?
- Multiple Service Instance per Host(physical/virtual hosts)
- Service instance per Host
- Service Instance per Container
- Serverless Deployment(Package the service as a ZIP file and
upload it to the Lambda function)
Reactive Extensions is a design approach through which results are
collected by calling multiple services in order to compile a combined
response. Also known as Rx, these calls can be synchronous or
What is the role of RESTful APIs in Microservices?
A microservice require to interact with one another to complete the
business functionality. This requires each microservice to have an
interface. RESTful APIs provide a logical model for building these
interfaces. It is based on the open networking principles of the Web.
How does Docker help in Microservices?
Microservices are self-contained, individual units that perform only
one business function. Each micro-service can be considered an single
application. Docker is containerization tool and provides a static
background for the application to run which avoiding deployment
issues. It reduces overhead and deploys of microservices on the same
server. Docker ensures that microservices will run on their own
environments and are entirely separate from their operating system.
What is Canary Releasing?
Canary Release is the
technique that we use to "softly" deploy a new version of an
application into Production. It consists of letting only a part of
the audience get access to the new version of the app, while the rest
still access the "old" version one.
When will you see fit to use the Netflix Hystrix?
Hystrix is an error tolerance and latency library. Hystrix mainly
isolates the access points. It also makes sure that all 3rd Party
libraries and services are restricted. Hystrix to ensure that an
application runs efficiently and avoids the kind of failures that
occur in distributed systems.
Give examples of microservices implementation.
Amazon, Netflix, Paypal, Twitter and many other large-scale websites.
How Exception Handling in Microservices?
How Microservices communicate with each other?
HTTP (request and response), Websockets (for streaming), brokers or
Server Programs running Advanced Routing Algorithms.
Message brokers like RabbitMQ, Kafka, Nats, etc can be used,
each built for a particular message semantic. Another way is to use
Backend as A Service like Space Cloud which automates the entire
Why there is a need for Domain Driven Design (DDD)?
What is the use of Container in Microservices?
- Mapping to domain.
- Reduce the complexity.
- Knowledge rich design
- Bring the business and service together
- Context Focussed
Manage deploy microservices individually, image with microservice +
dependencies. Easily roll on-demand instances of microservice without
any additional efforts required.