Back-End Development Microservices and Cloud Back-End Architecture 1 — Questions and Answers
Question 1: What is a microservices architecture?
- A single large application with many features
- An architectural style where an application is composed of small, independently deployable services each responsible for a specific business capability (Correct answer)
- A framework for building mobile applications
- A database design pattern for large tables
Correct answer: An architectural style where an application is composed of small, independently deployable services each responsible for a specific business capability
Microservices decompose an application into loosely-coupled, independently deployable services that communicate via APIs, enabling teams to develop, deploy, and scale each service separately.
Question 2: What is a message queue and how does it benefit microservices?
- A database for storing user messages
- An asynchronous communication mechanism that decouples services by buffering messages between producers and consumers (Correct answer)
- A logging system for tracking API calls
- A synchronous request-response pattern between services
Correct answer: An asynchronous communication mechanism that decouples services by buffering messages between producers and consumers
Message queues like RabbitMQ or Kafka allow services to communicate asynchronously, absorbing traffic spikes and preventing failures in one service from cascading to others.
Question 3: What is a Docker container and how does it differ from a virtual machine?
- A container shares the host OS kernel and is lighter; a VM includes a full OS and is heavier (Correct answer)
- A container runs on bare metal; a VM runs in a cloud environment
- They are identical in resource usage but containers are faster to download
- A VM is more secure than a container in all scenarios
Correct answer: A container shares the host OS kernel and is lighter; a VM includes a full OS and is heavier
Containers share the host OS kernel and package only the application and its dependencies, making them lightweight and fast to start, unlike VMs which include a full guest OS.
Question 4: What is Kubernetes used for in back-end infrastructure?
- Writing server-side JavaScript applications
- Orchestrating, scaling, and managing containerized applications across clusters of machines (Correct answer)
- Managing relational databases in the cloud
- Monitoring application logs and metrics
Correct answer: Orchestrating, scaling, and managing containerized applications across clusters of machines
Kubernetes automates the deployment, scaling, load balancing, and self-healing of containerized applications across a cluster of servers.
Question 5: What is the CAP theorem in distributed systems?
- A theorem stating that distributed systems need Caching, APIs, and Performance
- A principle stating that a distributed system can guarantee at most two of: Consistency, Availability, and Partition Tolerance simultaneously (Correct answer)
- A cloud cost optimization framework
- A network protocol for consistent data replication
Correct answer: A principle stating that a distributed system can guarantee at most two of: Consistency, Availability, and Partition Tolerance simultaneously
The CAP theorem proves that when a network partition occurs, a distributed system must choose between remaining consistent (all nodes see the same data) or remaining available (all requests receive a response).
Question 6: What is a load balancer and what role does it play in back-end architecture?
- A tool that measures CPU load on servers
- A component that distributes incoming network traffic across multiple servers to ensure no single server is overwhelmed (Correct answer)
- A database optimization tool for balancing read and write operations
- A caching layer that balances memory usage
Correct answer: A component that distributes incoming network traffic across multiple servers to ensure no single server is overwhelmed
A load balancer sits in front of a pool of servers and routes each incoming request to an available server using algorithms like round-robin or least-connections, improving throughput and fault tolerance.
What is a microservices architecture?