MicroService Project Interview Question

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5
At a glance
Powered by AI
Some common topics discussed in the document include microservices architecture, Spring Boot, Spring Cloud, and service discovery patterns like Eureka.

Common microservices interview questions discussed include reasons for hesitating to use microservices, using reports and dashboards to monitor microservices, reasons to opt for microservices architecture, and setting up service discovery.

Spring Boot aims to simplify application development by avoiding boilerplate configuration code. It allows overriding default properties through application.properties files.

Hi Team,

#Microservices #project #interview #qustions #Answers


Q.#What Do You Mean by End-To-End Testing of Microservices?
Ans-End-to-end testing validates all the processes in the workflow to check if
everything is working as expected. It also ensures that the system works in a
unified manner, thereby satisfying the business requirement.
Q.#Why Do People Hesitate to Use Microservices?

I have seen many devs fumble over this question. After all, they're getting asked
this question when interviewing for a microservices architect role, so
acknowledging its cons can be a little tricky. Here are some good answers:

They require heavy investment � Microservices demand a great deal of collaboration.


Since your teams are working independently, they should be able to synchronize well
at all times.

They need heavy architecture set up � The system is distributed, the architecture
is heavily involved.

They need excessive planning for handling operations overhead � You need to be
ready for operations overhead if you are planning to use a microservices
architecture.

They have autonomous staff selection � Skilled professionals are needed who can
support microservices that are distributed heterogeneously

Q.#Why Would You Need Reports and Dashboards in Microservices?

Reports and dashboards are mainly used to monitor and upkeep microservices. There
are multiple tools that help to serve this purpose. Reports and dashboards can be
used to:

Find out which microservices expose what resources.

Find out the services which are impacted whenever changes in a component occur.

Provide an easy point which can be accessed whenever documentation is required.

Versions of the components which are deployed.

To obtain a sense of maturity and compliance from the components.

Q.#Why Would You Opt for Microservices Architecture?

This is a very common microservices interview question which you should be ready
for! There are plenty of pros that are offered by a microservices architecture.
Here are a few of them:

Microservices can adapt easily to other frameworks or technologies.

Failure of a single process does not affect the entire system.

Provides support to big enterprises as well as small teams.

Can be deployed independently and in relatively less time.

Q.#How Can You Set Up Service Discovery?


There are multiple ways to set up service discovery. I�ll choose the one that I
think to be most efficient, Eureka by Netflix. It is a hassle free procedure that
does not weigh much on the application. Plus, it supports numerous types of web
applications.

Eureka configuration involves two steps � client configuration and server


configuration.
Client configuration can be done easily by using the property files. In the clas
spath, Eureka searches for a eureka-client.properties file. It also searches for
overrides caused by the environment in property files which are
environment specific.

For server configuration, you have to configure the client first. Once that is
done, the server fires up a client which is used to find other servers. The Eureka
server, by default, uses the Client configuration to find the peer server.

Q.#Role of Actuator in Spring Boot

It is one of the most important features, which helps you to access the current
state of an application that is running in a production environment. There are
multiple metrics which can be used to check the current state. They also provide
endpoints for RESTful web services which can be simply used to check the different
metrics

REFCARDZ

GUIDES

ZONES

Agile

AI

Big Data

More

Top Microservices Interview Questions for 2019, Part 1

? by

Arnab Roy

Jan. 16, 19 � Microservices Zone � Analysis

Like (16)

Comment (0)

Save
Tweet

A survey by Nginx shows that 36% of enterprises are currently using microservices,
while another 26% are doing research on how to implement them. So now could be a
good time to get into microservice development. Read on for an overview of some of
the most common microservices interview questions.

1. What Is Spring Cloud?

Spring Cloud, in microservices, is a system that provides integration with external


systems. It is a short-lived framework that builds an application, fast. Being
associated with the finite amount of data processing, it plays a very important
role in microservice architectures.

For typical use cases, Spring Cloud provides the out of the box experiences and a
sets of extensive features mentioned below:

Versioned and distributed configuration.

Discovery of service registration.

Service to service calls.

Routing.

Circuit breakers and load balancing.

Cluster state and leadership election.

Global locks and distributed messaging.

2. What Is Spring Boot?

Spring boot is a major topic under the umbrella of microservices interview


questions.
With the new functionalities that have been added, Spring keeps getting more
complex. Whenever you are starting a new project, it is mandatory to add a new
build path or Maven dependencies. In short, you will need to do everything from
scratch. Spring Boot is the solution that will help you to avoid all the code
configurations.

3. How Do You Override a Spring Boot Project�s Default Properties?

This can be done by specifying the properties in the application.properties file.


For example, in Spring MVC applications, you have to specify the suffix and prefix.
This can be done by entering the properties mentioned below in the
application.properties file.

For suffix � spring.mvc.view.suffix: .jsp

For prefix � spring.mvc.view.prefix: /WEB-INF/

4. Role of Actuator in Spring Boot

It is one of the most important features, which helps you to access the current
state of an application that is running in a production environment. There are
multiple metrics which can be used to check the current state. They also provide
endpoints for RESTful web services which can be simply used to check the different
metrics.

Q. #How Is Spring Security Implemented In a Spring Boot Application?

Minimal configuration is needed for implementation. All you need to do is add


thespring-boot-starter-securitystarter in the pom.xml file. You will also need to
create a Spring config class that will override the required method while extending
the WebSecurityConfigurerAdapter to achieve security in the application. Here is
some example code:

package com.gkatzioura.security.securityendpoints.config;

import org.springframework.context.annotation.Configuration;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;

import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigu
rerAdapter;

@Configuration

public class SecurityConfig extends WebSecurityConfigurerAdapter {

@Override

protected void configure(HttpSecurity http) throws Exception {

http.authorizeRequests()

.antMatchers("/welcome").permitAll()

.anyRequest().authenticated()

.and()

.formLogin()

.permitAll()

.and()

.logout()

.permitAll();

Which Embedded Containers Are Supported by Spring Boot?

Whenever you are creating a Java application, deployment can be done via two
methods:

Using an application container that is external.

Embedding the container inside your jar file.


Spring Boot contains Jetty, Tomcat, and Undertow servers, all of which are
embedded.

Jetty � Used in a wide number of projects, Eclipse Jetty can be embedded in


framework, application servers, tools, and clusters.

Tomcat � Apache Tomcat is an open source JavaServer Pages implementation which


works well with embedded systems.

Undertow � A flexible and prominent web server that uses small single handlers to
develop a web server.

Q.#How Does PACT Work?

PACT is an open source tool. It helps in testing the interactions between consumers
and service providers. However, it is not included in the contract, increasing the
reliability of the application. The consumer service developer starts by writing a
test which defines a mode of interaction with the service provider. The test
includes the provider�s state, the request body, and the response that is expected.
Based on this, PACT creates a stub against which the test is executed. The output
is stored in a JSON file

You might also like