Back-End Development Microservices and Cloud Back-End Architecture 2 — Questions and Answers
Question 1: What is serverless computing in the context of back-end development?
- Running servers without an operating system
- A cloud execution model where the provider manages server infrastructure and runs code in response to events, billing only for actual execution time (Correct answer)
- A development model where all logic runs in the browser
- Deploying applications without a web server
Correct answer: A cloud execution model where the provider manages server infrastructure and runs code in response to events, billing only for actual execution time
Serverless (like AWS Lambda or Vercel Functions) lets developers write functions that the cloud provider executes on demand, auto-scaling automatically with no server provisioning required.
Question 2: What is service discovery in a microservices architecture?
- Automatically generating API documentation for services
- The mechanism by which services dynamically find and communicate with each other without hard-coded addresses (Correct answer)
- Monitoring which services are healthy or unhealthy
- The process of registering services with a central database
Correct answer: The mechanism by which services dynamically find and communicate with each other without hard-coded addresses
Service discovery allows microservices to locate each other dynamically using a registry (like Consul or Kubernetes DNS), adapting to instances starting, stopping, or moving.
Question 3: What is a circuit breaker pattern in microservices?
- A security pattern that cuts off unauthenticated requests
- A resilience pattern that stops sending requests to a failing service temporarily to allow it to recover (Correct answer)
- A deployment pattern for zero-downtime releases
- A database pattern for handling transaction failures
Correct answer: A resilience pattern that stops sending requests to a failing service temporarily to allow it to recover
The circuit breaker monitors calls to a service and, after a threshold of failures, opens the circuit to stop sending requests, returning fallback responses and retrying after a timeout period.
Question 4: What is the difference between horizontal and vertical scaling?
- Horizontal scaling upgrades hardware; vertical scaling adds more servers
- Horizontal scaling adds more servers (scale out); vertical scaling increases resources on existing servers (scale up) (Correct answer)
- Horizontal scaling is for databases; vertical scaling is for web servers
- They are the same scaling strategy with different names
Correct answer: Horizontal scaling adds more servers (scale out); vertical scaling increases resources on existing servers (scale up)
Vertical scaling (scale up) means adding more CPU/RAM to an existing server, while horizontal scaling (scale out) means adding more server instances and distributing load across them.
Question 5: What is Infrastructure as Code (IaC)?
- Writing application logic inside infrastructure configuration files
- Managing and provisioning infrastructure through machine-readable configuration files rather than manual processes (Correct answer)
- Generating code automatically from infrastructure diagrams
- Using code to monitor infrastructure performance
Correct answer: Managing and provisioning infrastructure through machine-readable configuration files rather than manual processes
IaC tools like Terraform and AWS CloudFormation let teams define infrastructure (servers, networks, databases) in version-controlled code files, enabling reproducible and auditable environments.
Question 6: What is the role of an environment variable in cloud-deployed back-end applications?
- To define the geographic cloud region for deployment
- To pass configuration values like secrets, database URLs, and feature flags to the application at runtime without hardcoding them (Correct answer)
- To set the programming language version at compile time
- To configure network routing rules for the cloud provider
Correct answer: To pass configuration values like secrets, database URLs, and feature flags to the application at runtime without hardcoding them
Environment variables externalize configuration from code, allowing the same application image to behave differently across development, staging, and production environments.
What is serverless computing in the context of back-end development?