Most of these questions has been answered in my eBook "Cracking the Core Java Interview" updated on June 2018, that you can buy from this link:
Cracking Spring Microservices Interviews - question bank
Upasana | May 27, 2019 | 5 min read | 1,068 views
Cracking Spring Microservices Architecture Interviews
Topics and questions covered in my ebook "Cracking Spring Microservices Interviews"
IDE and software required for microservices development
-
Gradle
-
Java 8
-
IntelliJ IDEA or Spring Suite
-
Postman
PART 1. Core Concepts in Microservices
-
Cohesion
-
Coupling
-
Immutability in Microservices
-
Open/Close Principle
-
DRY (Don’t Repeat Yourself)
-
SOLID
-
Single Responsibility Principle
-
8 Fallacies of Distributed Computing
-
Continuous Integration (CI)
-
CAP Theorem
-
12 Factor App
-
Typical Git workflow for a real project.
PART 2. Introduction to Microservices.
-
Characteristics of a microservices architecture
-
Benefits of using Microservices Architecture
-
Challenges in Microservices.
-
Difference between Microservices and SOA
PART 3. Microservices Interview Questions .
-
How will you define Microservices Architecture
-
What is Domain Driven Design?
-
What is Bounded Context?
-
What is polyglot persistence? Can this idea be used in monolithic applications as well?
-
Why Microservices are better than Monoliths?
-
Isn’t in process communication in monolithic application faster than tons of remote network calls in microservices architecture?
-
How microservices are different than SOA?
-
What is difference between small-services and microservices?
-
What are benefits of using microservices architecture?
-
How to partition a large application into microservices architecture, correctly?
-
How big a single microservice should be?
-
How do microservices communicate with each other?
-
What shall be preferred communication style in microservices: synchronous or asynchronous?
-
What is difference between Orchestration and Choreography in microservices context?
-
How to maintain ACID in microservice architecture?
-
How frequent a microservice be released into production?
-
How to achieve zero-downtime during the deployments?
-
How to achieve zero downtime deployment(blue/green) when there is a database change?
-
How to slowly move users from older version of application to newer version?
-
How will you monitor fleet of microservices in production?
-
How will you troubleshoot a failed API request that is spread across multiple services?
-
What are different layers of a single microservice?
-
How will you develop microservices using Java?
-
Is it a good practice to deploy multiple microservices in a single tomcat container (servlet container)?
-
What are Cloud Native applications?
-
What is Spring Boot?
-
What is Spring Cloud?
-
What is difference between application.yml and bootstrap.yml?
-
How will you implement service discovery in microservices architecture?
-
How does Eureka Server work?
-
How to externalize configuration in a distributed system?
-
How will you use config-server for your development, stage and production environment?
-
What is difference between config first bootstrap and discovery first bootstrap in context of Spring Cloud Config client?
-
How to halt a Spring Boot based microservice at startup if it can not connect to Config Server during bootstrap?
-
How to refresh configuration changes on the fly in Spring Cloud environment?
-
How to achieve client side load balancing in Spring Microservices using Spring Cloud
-
How to use client side load-balancer Ribbon in your microservices architecture?
-
How to use both LoadBalanced as well as normal RestTemplate object in the single microservice?
-
How will you make use of Eureka for service discovery in Ribbon Load Balancer?
-
Can we use Ribbon without eureka?
-
How will you use ribbon load balancer programmatically?
-
What is difference between @EnableEurekaClient and @EnableDiscoveryClient?
-
How to make microservices zone aware so as to prefer same zone services for inter-service communication using Spring Cloud?
-
How to list all instances of a single microservice in Spring Cloud environment
-
What is API Gateway?
-
How to protect internal endpoints leaking from API Gateway?
-
How to protect Sensitive Security Tokens from leaking into downstream system?
-
How to retry failed requests at some other available instance using Client Side Load Balancer?
-
What is Circuit Breaker Pattern?
-
What are Open, Closed and Half-Open states of Circuit Breaker
-
What are use-cases for Circuit Breaker Pattern?
-
What are benefits of using Circuit Breaker Pattern?
-
Can circuit breaker be used in asynchronous communication?
-
What is Hystrix?
-
What are main features of Hystrix library?
-
How to use Hystrix for fallback execution?
-
When not to use Hystrix fallback on a particular microservice?
-
How will you ignore certain exceptions in Hystrix fallback execution?
-
What is Strangulation Pattern in microservices architecture?
-
What is Circuit Breaker?
-
What is difference between using a Circuit Breaker and a naive approach where we try/catch a remote method call and protect for failures?
-
What is Request Collapsing feature in Hystrix?
-
What is difference between Circuit Breaker and Hystrix?
-
Where exactly should I use Circuit Breaker Pattern?
-
What is bulkhead design pattern?
-
How does Hystrix implements Bulkhead Design Pattern?
-
What is Hystrix approach to Bulkhead Pattern?
-
In microservices architecture, what are smart endpoints and dumb pipes?
-
What is difference between Semaphore and ThreadPool based configuration in Hystrix?
-
How to handle versioning of microservices?
-
What is difference between partitioning microservices based on technical capabilities vs business capabilities? Which one is better?
-
Running Spring boot app at different port on server startup.
-
How will you run certain business logic at the app startup?
-
How to correctly implement a reporting microservice in a distributed system?
-
What is Event Sourcing and CQRS? When should it be used? Should be use it for the entire 84 system?
-
How to send business errors from a RESTful microservice to client application?
-
Is it a good idea to share common database across multiple microservices?
-
How will you make sure that the email is only sent if the database transaction does not fail?
-
How will you atomically update the database and publish an event to message broker from single transaction?
-
How will you propagate security context of user when one microservice calls another microservice on behalf of user?
-
What is Token Relay in Spring Security?
-
How to Enable Token Relay?
-
How to revoke Access and Refresh Tokens on data breach to limit the damage?
-
Shall Authentication and Authorization be one service?
-
What is API Key security?
-
What are best practices for microservices architecture?
-
Shall we share common domain models or DTOs across microservices?
-
How to share common code across multiple microservices?
-
What is continuous delivery?
-
How will you improve the performance of distributed system?
-
How will you implement caching for microservices?
-
Which protocol is generally used for client to service and inter-service communication?.
-
What are advantages of using asynchronous messaging within microservices architecture?
-
What is good tool for documenting Microservices?
-
How will you integrate Swagger into your microservices?
-
What are common properties for a Spring Boot project
PART 4. Security in Microservices.
-
Why Basic Authentication is not suitable in Microservices Context?
-
Why OAuth2?
-
How OAuth2 Works?
-
What are different OAuth2 Roles?
-
What are different OAuth 2.0 grant types (OAuth flows)?
-
When shall I use resource owner credentials
-
When shall I use Authorization Code grant
-
When shall I use client credentials?
-
OAuth2 and Microservice
-
What is JWT?
-
What are usecases for JWT
-
How does JWT looks like
-
What is AccessToken and RefreshToken
-
How to use a RefreshToken to request a new AccessToken?
-
How to call the protected resource using AccessToken?
-
Can a refreshToken be never expiring? How to make refreshToken life long valid?
-
Generate AccessToken for Client Credentials.
-
Why there is no RefreshToken support in Oauth2 Client Credentials workflow?
-
How to implement the Logout functionality using JWT?
-
Security in inter-service communication
-
How to setup multiple authentications in Spring Security?
-
What is purpose of @EnableResourceServer?
-
What is purpose of @EnableOAuth2Sso?
-
What is purpose of @EnableOAuth2Client?
-
How can we add custom claims to JWT AccessToken?
-
Security Best Practice
-
How to enable spring security at service layer?
PART 5. Testing Spring Boot based Microservices
-
Tools and Libraries available for testing
-
What is Mike Cohn’s Test Pyramid?
-
Testing Strategies
-
Mock vs Stub?
-
Unit Testing
-
Integration Tests
-
Contract-Driven Tests
-
End to End Tests
-
Best Practices in Testing
For all these questions, you can buy my ebook:
Top articles in this category:
- 50 microservices interview questions for Java developers
- Is it a good practice to deploy multiple microservices in a single tomcat container
- How will you Partition a typical e-shop into Microservices Architecture
- Why Microservices are better than Monoliths
- Spring Cloud and its advantages
- What is Spring Boot and what are its advantages