7 Microservices Interview Questions

7 Microservices Interview Questions

Microservices are a popular way to structure software systems today. As companies grow bigger and use more cloud computing, microservices help tackle complexity. In this issue, we review some key microservices concepts and common questions that come up in interviews:  ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌
Forwarded this email? Subscribe here for more

Latest articles

If you’re not a subscriber, here’s what you missed this month.

  1. A Crash Course in Docker

  2. A Crash Course in Kubernetes

  3. Redis Can Do More Than Caching

  4. The 6 Most Impactful Ways Redis is Used in Production Systems

  5. The Tech Promotion Algorithm: A Structured Guide to Moving Up

To receive all the full articles and support ByteByteGo, consider subscribing:


Microservices are a popular way to structure software systems today. As companies grow bigger and use more cloud computing, microservices help tackle complexity.

In this issue, we review some key microservices concepts and common questions that come up in interviews: 

  1. What are microservices?

  2. What issues do microservices aim to solve?

  3. What new challenges do microservices introduce?

  4. What are some popular microservices solutions?

  5. How does monitoring and alerting work with microservices?

  6. How are logs collected and analyzed?

  7. What is a Service Registry?


Now let’s start with the definition of microservices.

1. What Are Microservices?

We can quote from Martin Fowler and Adrian Cockcroft on key aspects of microservices.

From Martin Fowler:

“The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.”

From Adrian Cockcroft:

“Microservices are loosely coupled service-oriented architecture with bounded contexts.”

Key Aspects of Microservices

From the insightful definitions by Martin Fowler and Adrian Cockcroft, we can summarize these key aspects of a microservice architecture:

  1. Decompose monolithic application into small, independent services. This allows different product teams to develop, test, and deploy services that align to specific business capabilities. Useful for large organizations to break down monolithic systems and improve productivity. 

  2. Loosely coupled services communicating via APIs. Frontend/backend components communicate via REST, whil inter-service communications use RPC for efficient request/response.

  3. Carefully designed around bounded contexts. Each service has clear module boundaries and encapsulated domain logic to avoid tight coupling between services.

  4. Enables effective DevOps practices. It is an important part of the microservice development methodology. Small, full-stack teams fully own specific services end-to-end. Containerization, automation, and container orchestration are used to effectively deploy microservices.

  5. Horizontally scalable by design, resilient to failures. Services can scale out independently as needed. Built with fault tolerance in mind.

  6. Decentralized governance and flexibility. Teams can choose whatever technology makes sense for their service.

  7. Requires extensive monitoring and instrumentation due to:

    1. Growth in services - As monoliths decompose into many independent services, the number of components to track grows quickly.

    2. Infrastructure abstraction via containers/orchestrators - Runtime platforms like Kubernetes handle infrastructure. So monitoring must happen at the application code level using sidecars to aggregate logs, metrics and traces.

2. What Are the Differences Between SOA and Microservices?

Service-oriented architecture (SOA) and microservices architecture styles are important milestones in software architecture's evolution. The diagram below shows the progression of key architectural styles.

Service-oriented architecture emerged in the late 1990s to help manage enterprise software systems’ growing complexity. In the 2000s, SOA gained more industry attention and adoption by companies. However, SOA faced implementation complexity challenges. 

Then in the 2010s, microservices architecture emerged in response to SOA’s limitations. Many large internet companies started adopting microservices to break down their services into smaller components. Microservices gained momentum with cloud computing’s evolution, as containers and orchestration tools made microservices' development, deployment, and monitoring easier.

Let’s compare their differences in more detail. The diagram below lists some of the differences. 

The SOA architectural style offers coarse-grained services, typically a centralized approach where services are grouped by business functions and shared across multiple applications. The microservice style offers fine-grained service granularity through a decentralized approach where small, independent services perform specific functions within an application context.

The communication methods also evolve over time. SOA emphasizes uniform communication protocols and standardized interfaces for services to interact. Microservices lean towards diverse communication protocols and interfaces, often based on REST or message queues.

Cloud computing has evolved from Infrastructure-as-a-Service (IaaS) to Platform-as-a-Service (PaaS) to container-based PaaS. So microservice-based applications deploy on containers by default.

As the technical architecture changes, the organizational structure mirrors it (Conway’s law). So with microservices, the team structure requires multi-functional product teams. Each team focuses on a specific domain.

Keep reading with a 7-day free trial

Subscribe to ByteByteGo Newsletter to keep reading this post and get 7 days of free access to the full post archives.

A subscription gets you:

An extra deep dive on Thursdays
Full archive
Many expense it with team's learning budget
 
Like
Comment
Restack
 

© 2023 ByteByteGo
548 Market Street PMB 72296, San Francisco, CA 94104
Unsubscribe

Get the appStart writing


by "ByteByteGo" <bytebytego@substack.com> - 11:39 - 14 Dec 2023