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
Recall & Review
beginner
What is a microservice in the context of services and networking?
A microservice is a small, independent service that performs a specific business function and communicates with other services over a network.
Click to reveal answer
beginner
Why do microservices communicate over a network instead of sharing memory?
Because microservices run independently on different machines or containers, they use network communication to stay loosely coupled and scalable.
Click to reveal answer
intermediate
What is an API Gateway in microservices networking?
An API Gateway is a server that acts as a single entry point for clients to access multiple microservices, handling routing, security, and load balancing.
Click to reveal answer
intermediate
Explain service discovery in microservices networking.
Service discovery is the process where microservices find the network locations of other services dynamically, often using a registry to keep track of available services.
Click to reveal answer
intermediate
What role does load balancing play in microservices networking?
Load balancing distributes incoming network traffic evenly across multiple instances of a microservice to improve reliability and performance.
Click to reveal answer
Which component acts as a single entry point for client requests in a microservices architecture?
AAPI Gateway
BService Registry
CDatabase
DLoad Balancer
✗ Incorrect
The API Gateway handles client requests and routes them to the appropriate microservices.
What is the main purpose of service discovery in microservices?
ATo encrypt communication
BTo store user data
CTo find the network location of services dynamically
DTo balance network traffic
✗ Incorrect
Service discovery helps microservices locate each other dynamically on the network.
Why do microservices communicate over a network instead of sharing memory?
ABecause sharing memory is faster
BBecause they run independently and may be on different machines
CBecause network communication is less secure
DBecause they use the same database
✗ Incorrect
Microservices are independent and distributed, so they communicate over the network.
What does load balancing do in a microservices system?
AStores service configurations
BEncrypts data in transit
CMonitors service health
DDistributes traffic evenly across service instances
✗ Incorrect
Load balancing spreads incoming requests to multiple service instances to improve performance.
Which of the following is NOT a typical responsibility of an API Gateway?
AService discovery
BLoad balancing
CRouting requests
DAuthentication
✗ Incorrect
Service discovery is usually handled by a separate registry, not the API Gateway.
Describe how microservices communicate and the role of networking components like API Gateway and service discovery.
Think about how independent services find and talk to each other.
You got /3 concepts.
Explain why load balancing is important in a microservices architecture and how it improves system reliability.
Imagine many people trying to enter a store at once.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of service discovery in a microservices architecture?
easy
A. To manage database transactions
B. To store user data securely
C. To help services find and communicate with each other dynamically
D. To handle user authentication
Solution
Step 1: Understand service discovery role
Service discovery allows services to locate each other without hardcoding addresses.
Step 2: Match purpose with options
Only To help services find and communicate with each other dynamically describes dynamic service location, others relate to different concerns.
Final Answer:
To help services find and communicate with each other dynamically -> Option C
Quick Check:
Service discovery = dynamic service location [OK]
Hint: Service discovery = finding services automatically [OK]
Common Mistakes:
Confusing service discovery with authentication
Thinking it manages databases
Assuming it stores user data
2. Which of the following is the correct way to specify a REST API call in microservices networking?
easy
A. FETCH /users/api HTTP/1.0
B. POST /api/v1/users HTTP/1.1
C. CONNECT users /api/v1 HTTP/2
D. SEND /api/users HTTP/1.1
Solution
Step 1: Identify standard HTTP methods and syntax
REST APIs use standard HTTP methods like GET, POST, PUT, DELETE with URI paths and HTTP version.
Step 2: Match correct syntax
POST /api/v1/users HTTP/1.1 uses POST method, valid URI, and HTTP/1.1 version correctly; others use invalid methods or syntax.
Final Answer:
POST /api/v1/users HTTP/1.1 -> Option B
Quick Check:
REST API call = HTTP method + URI + version [OK]
Hint: REST calls use standard HTTP verbs and URIs [OK]
Common Mistakes:
Using non-standard HTTP methods
Incorrect URI format
Wrong HTTP version syntax
3. Given the following microservice call sequence:
Service A calls Service B via HTTP. Service B calls Service C via gRPC. Service C responds with data.
What is the correct order of communication protocols used in this flow?
medium
A. Only gRPC
B. gRPC then HTTP
C. Only HTTP
D. HTTP then gRPC
Solution
Step 1: Trace the call sequence
Service A calls B using HTTP first, then B calls C using gRPC.
Step 2: Identify protocol order
The communication starts with HTTP and then switches to gRPC.
Final Answer:
HTTP then gRPC -> Option D
Quick Check:
Call sequence protocols = HTTP then gRPC [OK]
Hint: Follow call chain to list protocols in order [OK]
Common Mistakes:
Mixing protocol order
Assuming only one protocol is used
Ignoring protocol differences
4. A microservice is failing to connect to another service using its hardcoded IP address. What is the most likely cause and fix?
medium
A. IP address changed; use service discovery instead of hardcoding
B. Service is down; restart the service
C. Network cable unplugged; check physical connections
D. Firewall blocking traffic; disable firewall
Solution
Step 1: Identify problem with hardcoded IP
Hardcoded IPs break when services move or scale, causing connection failures.
Step 2: Recommend dynamic service discovery
Using service discovery allows services to find current addresses dynamically, fixing the issue.
Final Answer:
IP address changed; use service discovery instead of hardcoding -> Option A
Quick Check:
Hardcoded IP failure = use service discovery [OK]
Hint: Avoid hardcoded IPs; use service discovery [OK]
Common Mistakes:
Restarting services without checking addresses
Ignoring dynamic environment changes
Disabling firewall without cause
5. You are designing a microservices system where services must communicate securely and efficiently. Which combination of networking components is best to ensure service discovery, secure communication, and load balancing?
hard
A. Service registry for discovery, TLS for security, and API gateway for load balancing
B. Static IPs for discovery, HTTP for communication, and DNS for load balancing
C. Manual config files for discovery, plain TCP sockets, and round-robin DNS
D. No discovery needed, use UDP for speed, and client-side load balancing
Solution
Step 1: Identify components for service discovery
A service registry dynamically tracks services, enabling discovery.
Step 2: Choose secure communication and load balancing
TLS encrypts data for security; API gateway can handle load balancing efficiently.
Step 3: Evaluate other options
Static IPs and manual configs lack flexibility; plain TCP and UDP lack security; DNS load balancing is limited.
Final Answer:
Service registry for discovery, TLS for security, and API gateway for load balancing -> Option A
Quick Check:
Discovery + TLS + API gateway = secure scalable system [OK]
Hint: Combine registry, TLS, and gateway for best networking [OK]