DevOps And Deployment Flashcards

(10 cards)

1
Q

What is CI/CD, and why is it used in software development?

A

CI/CD stands for Continuous Integration/Continuous Deployment. CI automates testing on code changes; CD automates deployment. Example: GitHub Actions runs tests on push, deploys to AWS on merge. Reduces bugs, speeds releases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you configure a basic CI pipeline with GitHub Actions?

A

```yaml
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: { node-version: ‘16’ }
- run: npm install
- run: npm test

Explanation: Tests Node.js app on every push, ensuring code quality (O(1) setup).”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Kubernetes, and what problem does it solve?

A

Kubernetes orchestrates containers for scalability and reliability. Example: kubectl apply -f deployment.yaml deploys a Node.js app across clusters. Solves: Load balancing, auto-scaling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does a load balancer work in deployment?

A

A load balancer distributes traffic across servers. Example: AWS ELB routes requests to multiple EC2 instances running a Node.js API, improving availability and throughput.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is blue-green deployment, and its benefits?

A

Blue-green deployment runs two environments (blue, green); traffic switches to the new version (green) after testing. Example: Swap ECS services in AWS. Benefits: Zero downtime, easy rollback.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you manage environment variables in a Node.js app?

A

”```javascript
require(‘dotenv’).config();
const dbUrl = process.env.DB_URL;

Explanation: Loads variables from .env (e.g., DB_URL=postgres://…) for secure configuration.” “

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you write a Dockerfile for a Node.js application?

A

”,”```dockerfile FROM node:16 WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 3000 CMD [‘node’, ‘index.js’]

Explanation: Builds a containerized Node.js app, exposes port 3000.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Docker, and how does it simplify deployment?

A

Docker packages apps with dependencies into containers for consistent environments. Example: docker run -p 3000:3000 my-app runs a Node.js app identically in dev and prod.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a CDN, and how does it improve full-stack apps?

A

A CDN (Content Delivery Network) caches static assets (e.g., React JS/CSS) on edge servers. Example: Cloudflare serves frontend assets, reducing latency for users.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you monitor a production backend application?

A

Use Prometheus for metrics (e.g., API latency) and Grafana for visualization. Example: Log errors with Winston in Node.js, alert on high error rates.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly