Bird
Raised Fist0
Microservicessystem_design~20 mins

Service mesh concept in Microservices - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Service Mesh Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary role of a service mesh in microservices?

Imagine you have many small services talking to each other in an app. What main job does a service mesh do?

AIt stores all the data used by the microservices in a central database.
BIt compiles the code of all microservices into a single executable.
CIt replaces the need for containers by running services directly on hardware.
DIt manages communication between services, handling security, routing, and monitoring.
Attempts:
2 left
💡 Hint

Think about how services talk and stay safe and visible.

💻 Command Output
intermediate
1:30remaining
What output does this Istio command produce?

Run the command istioctl proxy-status in a Kubernetes cluster with Istio installed. What does it show?

Microservices
istioctl proxy-status
AA list of all Envoy proxies connected to the Istio control plane with their sync status.
BThe current CPU and memory usage of the Istio control plane pods.
CA list of all Kubernetes nodes and their IP addresses.
DThe version of Istio installed on the cluster.
Attempts:
2 left
💡 Hint

Think about what 'proxy-status' might mean in Istio.

🔀 Workflow
advanced
2:00remaining
Order the steps to enable mutual TLS (mTLS) in a service mesh

Put these steps in the correct order to enable mutual TLS between services in a service mesh.

A1,3,2,4
B1,2,3,4
C3,1,2,4
D2,1,3,4
Attempts:
2 left
💡 Hint

Think about preparing the namespace, deploying services, then enforcing policies.

Troubleshoot
advanced
1:30remaining
Why might a service mesh cause increased latency between microservices?

You notice that calls between microservices are slower after adding a service mesh. What is a likely cause?

AThe service mesh merges all services into one, causing bottlenecks.
BThe sidecar proxies add extra network hops and encryption overhead.
CThe service mesh disables caching in the microservices.
DThe microservices are running on slower hardware than before.
Attempts:
2 left
💡 Hint

Think about what sidecars do to network traffic.

Best Practice
expert
2:00remaining
Which practice best improves observability in a service mesh?

To understand how your microservices behave in a service mesh, which practice is best?

AOnly monitor the main application containers, ignoring sidecars.
BDisable all logging to reduce noise and improve performance.
CEnable distributed tracing and collect metrics from sidecar proxies.
DUse manual log parsing instead of automated tools.
Attempts:
2 left
💡 Hint

Think about how to get detailed info from all parts of the mesh.

Practice

(1/5)
1. What is the main purpose of a service mesh in microservices architecture?
easy
A. To write application business logic
B. To store data for microservices
C. To replace microservices with monolithic applications
D. To manage communication between microservices securely and reliably

Solution

  1. Step 1: Understand the role of service mesh

    A service mesh handles how microservices talk to each other, focusing on communication.
  2. Step 2: Identify what service mesh does not do

    It does not store data, replace microservices, or write business logic.
  3. Final Answer:

    To manage communication between microservices securely and reliably -> Option D
  4. Quick Check:

    Service mesh = communication management [OK]
Hint: Service mesh controls microservice communication, not data or logic [OK]
Common Mistakes:
  • Confusing service mesh with data storage
  • Thinking service mesh replaces microservices
  • Assuming service mesh writes app code
2. Which of the following is a common tool used to implement a service mesh?
easy
A. Docker
B. Istio
C. Kubernetes
D. Git

Solution

  1. Step 1: Recall popular service mesh tools

    Istio, Linkerd, and Consul are well-known service mesh tools.
  2. Step 2: Differentiate from other tools

    Docker is for containers, Kubernetes for orchestration, Git for version control, not service mesh.
  3. Final Answer:

    Istio -> Option B
  4. Quick Check:

    Istio = service mesh tool [OK]
Hint: Istio is a popular service mesh tool, not Docker or Git [OK]
Common Mistakes:
  • Choosing Docker or Kubernetes as service mesh
  • Confusing version control tools with service mesh
  • Mixing container tools with service mesh tools
3. Given a microservices setup with Istio service mesh, what happens when a service-to-service call fails due to network issues?
medium
A. Istio retries the call automatically based on configured policies
B. The call fails immediately without retries
C. Istio shuts down the service permanently
D. The service mesh ignores the failure and logs no information

Solution

  1. Step 1: Understand Istio's retry feature

    Istio can automatically retry failed calls to improve reliability.
  2. Step 2: Eliminate incorrect behaviors

    Istio does not shut down services or ignore failures silently; it logs and manages retries.
  3. Final Answer:

    Istio retries the call automatically based on configured policies -> Option A
  4. Quick Check:

    Istio retries failed calls = true [OK]
Hint: Istio retries failed calls automatically if configured [OK]
Common Mistakes:
  • Assuming no retries happen on failure
  • Thinking Istio shuts down services on failure
  • Believing failures are ignored silently
4. You deployed a service mesh but notice that traffic between microservices is not encrypted. What is the most likely cause?
medium
A. The network cables are unplugged
B. The microservices are not running
C. Mutual TLS (mTLS) is not enabled in the service mesh configuration
D. The service mesh is not installed

Solution

  1. Step 1: Check encryption settings in service mesh

    Service mesh uses mutual TLS (mTLS) to encrypt traffic between services.
  2. Step 2: Identify why encryption might fail

    If mTLS is not enabled, traffic remains unencrypted despite service mesh presence.
  3. Final Answer:

    Mutual TLS (mTLS) is not enabled in the service mesh configuration -> Option C
  4. Quick Check:

    mTLS disabled = no encryption [OK]
Hint: Enable mTLS to encrypt service mesh traffic [OK]
Common Mistakes:
  • Assuming services not running causes no encryption
  • Thinking service mesh absence causes partial encryption
  • Ignoring mTLS setting importance
5. You want to add observability to your microservices without changing their code. How does a service mesh help achieve this?
hard
A. By injecting sidecar proxies that monitor and report traffic metrics transparently
B. By rewriting the microservices code to add logging
C. By replacing microservices with a single monolithic app
D. By disabling network communication between services

Solution

  1. Step 1: Understand sidecar proxy role in service mesh

    Service mesh injects sidecar proxies alongside microservices to handle communication and monitoring without code changes.
  2. Step 2: Eliminate incorrect options

    Service mesh does not rewrite code, replace microservices, or disable communication.
  3. Final Answer:

    By injecting sidecar proxies that monitor and report traffic metrics transparently -> Option A
  4. Quick Check:

    Sidecar proxies add observability without code change [OK]
Hint: Sidecar proxies add monitoring without changing app code [OK]
Common Mistakes:
  • Thinking code must be rewritten for observability
  • Confusing service mesh with app replacement
  • Assuming communication is disabled for observability