Skip to content

Linux_Practical_Interview_1751 2000

Linux Practical Interview Questions (1751-2000)

Section titled “Linux Practical Interview Questions (1751-2000)”

Q1751: How do you configure system auditing?

Section titled “Q1751: How do you configure system auditing?”

Answer:

Terminal window
# Install auditd
apt install auditd
# Configure rules
# /etc/audit/audit.rules
# Monitor file changes
-w /etc/passwd -p wa -k passwd_changes
-w /etc/shadow -p wa -k shadow_changes
-w /etc/ssh/sshd_config -p wa -k sshd_config
# Monitor commands
-w /usr/bin/sudo -p x -k sudo_commands
-w /usr/bin/su -p x -k su_commands
# Monitor network
-a always,exit -F arch=b64 -S socket -k network_connections
# View logs
ausearch -k passwd_changes
aureport -f
aureport -u
# Real-time monitoring
auditctl -w /etc/passwd -p wa -k passwd_changes

Q1752: How do you implement system hardening?

Section titled “Q1752: How do you implement system hardening?”

Answer:

Terminal window
# Disable unnecessary services
systemctl mask avahi-daemon
systemctl mask cups
systemctl mask bluetooth
# Secure kernel parameters
# /etc/sysctl.conf
kernel.dmesg_restrict=1
kernel.kptr_restrict=2
kernel.yama.ptrace_scope=2
kernel.sysrq=0
# Disable IPv6 if not needed
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
# Disable USB storage
# /etc/modprobe.d/blacklist.conf
install usb-storage /bin/true
# Set secure umask
# /etc/profile
umask 027
# Password policies
# /etc/login.defs
PASS_MIN_LEN 12
PASS_MAX_DAYS 90

Q1753: How do you configure system logging?

Section titled “Q1753: How do you configure system logging?”

Answer:

/etc/rsyslog.conf
# Configure rsyslog
$ModLoad imtcp
$InputTCPServerRun 514
$ModLoad imudp
$UDPServerRun 514
# Log templates
$template RemoteLogs,"/var/log/%HOSTNAME%/%PROGRAMNAME%.log"
*.* @@remote-server:514
# Configure journald
# /etc/systemd/journald.conf
[Journal]
Storage=persistent
Compress=yes
SystemMaxUse=500M
MaxRetentionSec=30day
# Forward to syslog
ForwardToSyslog=yes
# View logs
journalctl -u service
journalctl --since "1 hour ago"
journalctl -p err
# Log rotation
# /etc/logrotate.conf
daily
rotate 14
compress

Answer:

Terminal window
# Debian/Ubuntu
apt update
apt list --upgradable
apt upgrade
apt full-upgrade
# Unattended upgrades
apt install unattended-upgrades
# /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
};
# RHEL/CentOS
yum update
yum check-update
# Kernel live patching
# Ubuntu
snap install canonical-livepatch
canonical-livepatch enable <token>
# RHEL
yum install kpatch

Q1755: How do you configure system backup?

Section titled “Q1755: How do you configure system backup?”

Answer:

Terminal window
# Full system backup with tar
tar -czpvf /backup/full-backup-$(date +%Y%m%d).tar.gz \
--exclude=/proc \
--exclude=/sys \
--exclude=/dev \
--exclude=/run \
--exclude=/tmp \
--exclude=/backup \
--exclude=/mnt \
/
# Incremental backup
tar -czpvf /backup/inc-backup-$(date +%Y%m%d).tar.gz -g /var/log/backup.snar /
# Database backup
mysqldump -u root -p --all-databases > /backup/mysql-$(date +%Y%m%d).sql
pg_dumpall -U postgres > /backup/postgres-$(date +%Y%m%d).sql
# Configuration backup
tar -czf /backup/configs-$(date +%Y%m%d).tar.gz /etc/
# Restoration
tar -xzpvf /backup/full-backup-20240101.tar.gz -C /

Answer:

Terminal window
# Install DHCP server
apt install isc-dhcp-server
# Configure
# /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 8.8.8.8, 8.8.4.4;
option domain-name "example.com";
}
# Static IP reservation
host printer {
hardware ethernet 00:11:22:33:44:55;
fixed-address 192.168.1.50;
}
# Start service
systemctl start isc-dhcp-server
systemctl enable isc-dhcp-server

Answer:

Terminal window
# Install BIND9
apt install bind9 bind9utils
# Configure named.conf.options
# /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
forwarders {
8.8.8.8;
8.8.4.4;
};
dnssec-validation auto;
listen-on { any; };
};
# Create zone
# /etc/bind/named.conf.local
zone "example.com" {
type master;
file "/etc/bind/db.example.com";
};
# Create zone file
# /etc/bind/db.example.com
$TTL 604800
@ IN SOA ns1.example.com. admin.example.com. (
2024010101 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.example.com.
ns1 IN A 192.168.1.10
www IN A 192.168.1.10

Answer:

Terminal window
# Install Postfix
apt install postfix
# Configure main.cf
# /etc/postfix/main.cf
myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost, localhost.localdomain
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, reject
# Install Dovecot
apt install dovecot-imapd
# Configure /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = yes
auth_mechanisms = plain login
# Configure /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir
# Create mail user
useradd -m -s /bin/bash mailuser
passwd mailuser

Answer:

Terminal window
# Install Squid
apt install squid
# Configure
# /etc/squid/squid.conf
http_port 3128
cache_dir ufs /var/spool/squid 1000 16 256
# Access control
acl localnet src 192.168.0.0/16
http_access allow localnet
http_access deny all
# Authentication
# /etc/squid/squid.conf
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/passwords
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
# Create user
htpasswd -c /etc/squid/passwords username
# Cache rules
refresh_pattern -i \.jpg$ 10080 90% 43200
refresh_pattern -i \.html$ 1440 90% 3600
# Transparent proxy
http_port 3128 transparent

Answer:

Terminal window
# Install vsftpd
apt install vsftpd
# Configure
# /etc/vsftpd.conf
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
# Enable SSL
ssl_enable=YES
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
# Chroot users
chroot_local_user=YES
allow_writeable_chroot=YES
# User list
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
# Start service
systemctl start vsftpd
systemctl enable vsftpd

Q1761: How do you implement intrusion detection?

Section titled “Q1761: How do you implement intrusion detection?”

Answer:

Terminal window
# Install AIDE
apt install aide
# Configure
# /etc/aide/aide.conf
database=file:/var/lib/aide/aide.db
database_out=file:/var/lib/aide/aide.db.new
# Rules
Fip = p+i+n+u+g+s+m+c+md5+sha256
Lnx = p+u+g+i+n+S
# Files to monitor
/etc Fip
/bin Lnx
/sbin Lnx
# Initialize database
aideinit
# Check integrity
aide --check
# Schedule checks
# /etc/cron.d/aide
0 5 * * * root /usr/bin/aide --check | mail -s "AIDE Report" admin@example.com

Answer:

Terminal window
# Install fail2ban
apt install fail2ban
# Configure
# /etc/fail2ban/jail.local
[DEFAULT]
bantime = 3600
findtime = 600
maxretry = 5
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
[nginx-http-auth]
enabled = true
filter = nginx-http-auth
port = http,https
[apache2]
enabled = true
port = http,https
# Custom filter
# /etc/fail2ban/filter.d/custom.conf
[Definition]
failregex = <HOST> - .* "GET /admin
# Start service
systemctl start fail2ban
# Check status
fail2ban-client status
fail2ban-client status sshd

Q1763: How do you implement IPTables firewall?

Section titled “Q1763: How do you implement IPTables firewall?”

Answer:

Terminal window
# Flush existing rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t mangle -F
# Default policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# Loopback
iptables -A INPUT -i lo -j ACCEPT
# Established connections
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# SSH
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
# HTTP/HTTPS
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Rate limiting
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP
# Save rules
iptables-save > /etc/iptables/rules.v4

Answer:

Terminal window
# Install AppArmor
apt install apparmor apparmor-utils
# Check status
aa-status
# Create profile
aa-genprof /usr/bin/myapp
# Profile example
# /etc/apparmor.d/usr.bin.myapp
#include <tunables/global>
/usr/bin/myapp {
#include <abstractions/base>
/etc/myapp/** r,
/var/log/myapp/* rw,
network inet stream,
}
# Enforce mode
aa-enforce /usr/bin/myapp
# Complain mode (testing)
aa-complain /usr/bin/myapp
# Reload profile
apparmor_parser -r /etc/apparmor.d/usr.bin.myapp

Answer:

Terminal window
# Check status
getenforce
sestatus
# Set mode
setenforce 1 # Enforcing
setenforce 0 # Permissive
# Configure
# /etc/selinux/config
SELINUX=enforcing
SELINUXTYPE=targeted
# Manage contexts
chcon -t httpd_sys_content_t /var/www/html/index.html
# Make persistent
semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
restorecon -Rv /web
# Boolean values
getsebool -a
setsebool -P httpd_can_network_connect on
# Create module
# myapp.te
module myapp 1.0;
require { type httpd_t; }
allow httpd_t self:tcp_socket { accept listen };
# Compile and install
checkmodule -M -m -o myapp.mod myapp.te
semodule_package -o myapp.pp -m myapp.mod
semodule -i myapp.pp

Answer:

Terminal window
# View CPU info
lscpu
cat /proc/cpuinfo
# CPU frequency scaling
cpupower frequency-info
cpupower frequency-set -g performance
# Set CPU affinity
taskset -c 0-3 myapp
# Process priority
nice -n 10 myapp
renice 5 -p $(pgrep myapp)
# Disable turbo boost (if needed)
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
# CFS scheduler tuning
# /etc/sysctl.conf
kernel.sched_latency_ns = 10000000
kernel.sched_min_granularity_ns = 1000000
kernel.sched_wakeup_granularity_ns = 2000000

Q1767: How do you tune memory performance?

Section titled “Q1767: How do you tune memory performance?”

Answer:

Terminal window
# View memory
free -h
cat /proc/meminfo
# Swappiness
# /etc/sysctl.conf
vm.swappiness=10
vm.vfs_cache_pressure=50
# Drop caches
sync && echo 3 > /proc/sys/vm/drop_caches
# Huge pages
# /etc/sysctl.conf
vm.nr_hugepages=1024
# Memory overcommit
# /etc/sysctl.conf
vm.overcommit_memory=1
vm.overcommit_ratio=50
# Transparent huge pages
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
# Enable
sysctl -p

Answer:

Terminal window
# Check I/O scheduler
cat /sys/block/sda/queue/scheduler
# Set scheduler
echo deadline > /sys/block/sda/queue/scheduler
# Make permanent
# /etc/udev/rules.d/60-ioschedulers.rules
ACTION=="add|change", KERNEL=="sda", SUBSYSTEM=="block", ATTR{queue/scheduler}="deadline"
# I/O priorities
ionice -c 2 -n 0 -p $(pgrep myapp)
# Read ahead
cat /sys/block/sda/queue/read_ahead_kb
echo 4096 > /sys/block/sda/queue/read_ahead_kb
# Queue depth
cat /sys/block/sda/queue/nr_requests
echo 1024 > /sys/block/sda/queue/nr_requests
# Filesystem options
# /etc/fstab
/dev/sda1 / ext4 noatime,nodiratime,errors=remount-ro 0 1

Q1769: How do you tune network performance?

Section titled “Q1769: How do you tune network performance?”

Answer:

/etc/sysctl.conf
# Network buffer sizes
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
# TCP tuning
net.ipv4.tcp_congestion_control=cubic
net.ipv4.tcp_fastopen=3
net.ipv4.tcp_max_syn_backlog=8192
net.ipv4.tcp_fin_timeout=15
net.ipv4.tcp_keepalive_time=600
net.ipv4.tcp_keepalive_intvl=60
# Enable offloading
ethtool -K eth0 tso on
ethtool -K eth0 gso on
ethtool -K eth0 gro on
# Ring buffer
ethtool -G eth0 rx 4096 tx 4096
# Apply
sysctl -p

Q1770: How do you use performance monitoring tools?

Section titled “Q1770: How do you use performance monitoring tools?”

Answer:

Terminal window
# System monitoring
top
htop
atop
# Process monitoring
pidstat -p <pid> 1
ps aux --sort=-%cpu | head
# CPU monitoring
mpstat -P ALL 1
sar -u 1
# Memory monitoring
vmstat 1
sar -r 1
# I/O monitoring
iostat -xz 1
iotop
# Network monitoring
nethogs
iftop
sar -n DEV 1
# Full analysis
perf record -g ./myapp
perf report
# System resource usage
ss -s
netstat -s

Q1771: How do you configure Docker networking?

Section titled “Q1771: How do you configure Docker networking?”

Answer:

Terminal window
# Create custom network
docker network create --driver bridge mynetwork
docker network create --driver overlay myoverlay
# Network inspection
docker network inspect bridge
# Connect container
docker network connect mynetwork container
# Port mapping
docker run -d -p 8080:80 nginx
# Host network
docker run --network host nginx
# DNS configuration
docker run --dns 8.8.8.8 nginx
docker run --network-alias db mysql
# Macvlan
docker network create -d macvlan \
--subnet=192.168.1.0/24 \
--gateway=192.168.1.1 \
-o parent=eth0 mymacvlan

Answer:

Terminal window
# Create volume
docker volume create mydata
# Mount volume
docker run -v mydata:/data mysql
# Bind mount
docker run -v /host/path:/container/path nginx
# tmpfs mount
docker run --tmpfs /tmp nginx
# List volumes
docker volume ls
# Inspect volume
docker volume inspect mydata
# Remove unused volumes
docker volume prune
# Backup volume
docker run --rm -v mydata:/data -v $(pwd):/backup alpine \
tar cvf /backup/backup.tar /data

Q1773: How do you configure Docker Compose?

Section titled “Q1773: How do you configure Docker Compose?”

Answer:

docker-compose.yml
version: '3.8'
services:
web:
build: .
ports:
- "8080:80"
environment:
- NODE_ENV=production
volumes:
- ./data:/data
depends_on:
- db
networks:
- frontend
- backend
restart: always
db:
image: postgres:14
environment:
POSTGRES_PASSWORD: secret
volumes:
- db-data:/var/lib/postgresql/data
networks:
- backend
redis:
image: redis:alpine
networks:
- backend
volumes:
db-data:
networks:
frontend:
backend:

Q1774: How do you secure Docker containers?

Section titled “Q1774: How do you secure Docker containers?”

Answer:

Terminal window
# Run as non-root
docker run -u 1000:1000 nginx
# Read-only filesystem
docker run --read-only nginx
# Limit capabilities
docker run --cap-drop ALL --cap-add NET_BIND_SERVICE nginx
# Disable networking
docker run --network none nginx
# Resource limits
docker run --memory=256m --cpus=0.5 nginx
# Selinux/AppArmor
docker run --security-opt seccomp:default nginx
# Scan images
trivy image nginx
docker scan nginx
# Best practices
# Use specific versions
# Don't store secrets in images
# Multi-stage builds
# Minimal base images

Q1775: How do you configure Kubernetes networking?

Section titled “Q1775: How do you configure Kubernetes networking?”

Answer:

# Service
apiVersion: v1
kind: Service
metadata:
name: myapp
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
type: ClusterIP
---
# Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: myapp
spec:
rules:
- host: myapp.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: myapp
port:
number: 80
---
# NetworkPolicy
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress

Answer:

Terminal window
# Install KVM
apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
# Verify
kvm-ok
# Create VM
virt-install \
--name webserver \
--ram 2048 \
--disk path=/var/lib/libvirt/images/webserver.qcow2,size=20 \
--vcpus 2 \
--os-type linux \
--os-variant ubuntu22.04 \
--network bridge=virbr0 \
--graphics vnc \
--location 'http://archive.ubuntu.com/ubuntu/dists/jammy/main/installer-amd64/' \
--extra-args 'console=ttyS0'
# Manage VMs
virsh list --all
virsh start webserver
virsh shutdown webserver
virsh reboot webserver
virsh undefine webserver
# Manage storage pools
virsh pool-list
virsh pool-info default

Answer:

Terminal window
# Connect to libvirt
virsh --connect qemu:///system
# Create network
virsh net-define /tmp/network.xml
virsh net-start mynetwork
virsh net-autostart mynetwork
# Create storage pool
virsh pool-define-as default dir --target /var/lib/libvirt/images
virsh pool-build default
virsh pool-start default
# Create snapshot
virsh snapshot-create-as webserver --name "before-update"
virsh snapshot-list webserver
virsh snapshot-revert webserver before-update
# Migrate VM
virsh migrate --live webserver qemu+ssh://dest-host/system
# Clone VM
virt-clone --original webserver --name webserver2 --auto-clone

Answer:

Terminal window
# Install LXC
apt install lxc
# Create container
lxc-create -n mycontainer -t ubuntu
# Start container
lxc-start -n mycontainer
lxc-attach -n mycontainer
# Configuration
# /var/lib/lxc/mycontainer/config
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
lxc.uts.name = mycontainer
lxc.network.type = veth
lxc.network.link = lxcbr0
# Clone container
lxc-copy -n mycontainer -N mycontainer2
# Snapshot
lxc-snapshot -n mycontainer
# Manage
lxc-ls -f
lxc-info -n mycontainer
lxc-stop -n mycontainer
lxc-destroy -n mycontainer

Answer:

Terminal window
# Install server
apt install nfs-kernel-server
# Configure exports
# /etc/exports
/data 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)
/backup 192.168.1.10(rw,sync,all_squash,anonuid=1000,anongid=1000)
# Export
exportfs -a
# Install client
apt install nfs-common
# Mount
mount -t nfs server:/data /mnt/data
# Auto mount
# /etc/fstab
server:/data /mnt/data nfs defaults,_netdev 0 0
# Verify
showmount -e server
mount | grep nfs

Answer:

Terminal window
# Install client
apt install cifs-utils
# Mount manually
mount -t cifs //server/share /mnt -o user=username
# Auto mount
# /etc/fstab
//server/share /mnt cifs credentials=/root/.smbcredentials,iocharset=utf8 0 0
# Create credentials file
# /root/.smbcredentials
username=smbuser
password=password
domain=WORKGROUP
# Secure credentials
chmod 600 /root/.smbcredentials
# Test
smbclient -L //server -U username

Answer:

Terminal window
# Install AWS CLI
apt install awscli
# Configure
aws configure
# AWS Access Key ID: ***
# AWS Secret Access Key: ***
# Region: us-east-1
# Output format: json
# S3 commands
aws s3 ls
aws s3 mb s3://mybucket
aws s3 cp file.txt s3://mybucket/
aws s3 sync ./folder s3://mybucket/folder
# EC2 commands
aws ec2 describe-instances
aws ec2 start-instances --instance-ids i-xxx
aws ec2 stop-instances --instance-ids i-xxx
# IAM
aws iam list-users
aws iam create-user --user-name myuser
# Get instance metadata
curl http://169.254.169.254/latest/meta-data/
curl http://169.254.169.254/latest/user-data/

Answer:

cloud-config.yaml
#cloud-config
package_update: true
packages:
- nginx
- curl
write_files:
- path: /var/www/html/index.html
content: |
<html><h1>Hello from Cloud-Init</h1></html>
permissions: '0644'
runcmd:
- systemctl enable nginx
- systemctl start nginx
- echo "192.168.1.10 webserver" >> /etc/hosts
users:
- name: admin
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa AAAA...
# Mount data disk
mounts:
- [ /dev/sdb, /data, "ext4", "defaults,nofail", "0", "2" ]

Answer:

{
"builders": [{
"type": "amazon-ebs",
"region": "us-east-1",
"source_ami": "ami-0c55b159cbfafe1f0",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "myapp-{{timestamp}}"
}],
"provisioners": [{
"type": "shell",
"inline": [
"apt-get update",
"apt-get install -y nginx"
]
}, {
"type": "ansible",
"playbook_file": "playbook.yml"
}]
}
# Build image
packer build template.json
# Validate
packer validate template.json

Answer:

main.tf
provider "aws" {
region = "us-east-1"
}
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t3.micro"
tags = {
Name = "webserver"
}
user_data = <<-EOF
#!/bin/bash
yum update -y
yum install -y nginx
systemctl start nginx
EOF
}
resource "aws_security_group" "web" {
name = "web-sg"
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
# Commands
terraform init
terraform plan
terraform apply
terraform destroy
terraform show

Answer:

Terminal window
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
# Configure
mkdir -p ~/.kube
cp /path/to/admin.conf ~/.kube/config
# Create deployment
kubectl create deployment nginx --image=nginx
# Scale deployment
kubectl scale deployment nginx --replicas=3
# Expose service
kubectl expose deployment nginx --port=80 --type=LoadBalancer
# View resources
kubectl get pods,svc,deployments
kubectl describe pod nginx
kubectl logs nginx
# Apply configuration
kubectl apply -f deployment.yaml
kubectl delete -f deployment.yaml

Answer:

playbook.yml
- name: Configure webserver
hosts: webservers
become: yes
vars:
http_port: 80
tasks:
- name: Install Apache
apt:
name: apache2
state: present
when: ansible_os_family == "Debian"
- name: Start Apache
service:
name: apache2
state: started
enabled: yes
- name: Configure Apache
template:
src: templates/httpd.conf.j2
dest: /etc/apache2/apache2.conf
notify: restart apache
handlers:
- name: restart apache
service:
name: apache2
state: restarted

Answer:

# Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.synced_folder "./data", "/vagrant_data"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
apt update
apt install -y apache2
SHELL
end
# Commands
vagrant up
vagrant ssh
vagrant halt
vagrant destroy
vagrant provision

Answer:

cookbook/recipes/default.rb
package 'httpd' do
action :install
end
service 'httpd' do
action [:enable, :start]
end
template '/var/www/html/index.html' do
source 'index.html.erb'
mode '0644'
end
# Run chef
chef-client --local-mode recipe.rb
# Bootstrap
knife solo bootstrap user@server

Answer:

manifests/site.pp
node 'webserver.example.com' {
package { 'apache2':
ensure => installed,
}
service { 'apache2':
ensure => running,
enable => true,
require => Package['apache2'],
}
file { '/var/www/html/index.html':
ensure => file,
content => template('webserver/index.html.erb'),
mode => '0644',
require => Service['apache2'],
}
}
# Run
puppet apply manifests/site.pp

Answer:

/srv/salt/webserver.sls
apache:
pkg.installed: []
service.running:
- name: apache2
- enable: True
- require:
- pkg: apache
apache_config:
file.managed:
- name: /etc/apache2/apache2.conf
- source: salt://apache/apache2.conf
- require:
- pkg: apache
- watch_in:
- service: apache
# Run
salt '*' state.apply webserver
salt '*' pkg.install nginx
salt '*' service.restart apache2

Answer:

Terminal window
# System information
uname -a
cat /etc/os-release
lsb_release -a
# Hardware info
lshw
lspci
lsblk
# System logs
dmesg | tail
journalctl -xe
tail -f /var/log/syslog
# Process status
ps auxf
top
htop
# Resource usage
df -h
free -h
vmstat 1
iostat -xz 1
# Network status
ip addr
ip route
netstat -tulpn
ss -tulpn
# Service status
systemctl status service
systemctl list-failed

Answer:

Terminal window
# Interface status
ip link
ip addr
ethtool eth0
# Routing
ip route
ip route get 8.8.8.8
ip neighbor show
# DNS
dig example.com
getent hosts example.com
cat /etc/resolv.conf
# Connectivity
ping -c 4 8.8.8.8
traceroute 8.8.8.8
mtr -n 8.8.8.8
# Ports
nc -zv host port
telnet host port
# Capture
tcpdump -i eth0 host 192.168.1.1
tcpdump -i eth0 port 80
# Firewall
iptables -L -n -v
firewall-cmd --list-all

Answer:

Terminal window
# Disk usage
df -h
df -i
du -sh /*
# Find large files
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null | sort -k5 -h
# I/O stats
iostat -xz 1
sar -d 1
# Mount status
mount
cat /proc/mounts
# Filesystem check
fsck -n /dev/sda1
# SMART status
smartctl -a /dev/sda
# LVM status
lvs
pvs
vgs
# Deleted files
lsof +L1

Answer:

Terminal window
# Service status
systemctl status service
systemctl list-units --failed
# Service logs
journalctl -u service -n 50
journalctl -u service --since "1 hour ago"
journalctl -xe
# Process info
ps auxf | grep service
lsof -p $(pgrep -f service)
# Configuration test
nginx -t
apache2ctl configtest
mysqladmin ping
# Dependencies
systemctl list-dependencies service
systemctl is-active service
# Strace
strace -f -p $(pgrep -f service)
strace -c service
# Limits
cat /proc/$(pgrep -f service)/limits

Q1795: How do you debug performance issues?

Section titled “Q1795: How do you debug performance issues?”

Answer:

Terminal window
# CPU
top
htop
mpstat -P ALL 1
# Memory
free -h
vmstat 1
# I/O
iostat -xz 1
iotop
# Network
nethogs
iftop
# System-wide
sar -A 1 5
# Process
perf top
perf record -g -p <pid>
perf report
# Flame graph
git clone https://github.com/brendangregg/FlameGraph.git
perf record -F 99 -g -p <pid>
perf script | ./stackcollapse-perf.pl | ./flamegraph.pl > flame.svg

Q1796: How do you configure automated backups?

Section titled “Q1796: How do you configure automated backups?”

Answer:

/usr/local/bin/backup.sh
#!/bin/bash
set -euo pipefail
BACKUP_DIR="/backup"
DATE=$(date +%Y%m%d)
RETENTION_DAYS=30
# Create backup directory
mkdir -p $BACKUP_DIR/{mysql,files,configs}
# Database backup
mysqldump -u root -p --all-databases | gzip > $BACKUP_DIR/mysql/all-$DATE.sql.gz
# Files backup
tar -czf $BACKUP_DIR/files/files-$DATE.tar.gz /var/www/html/ --exclude='*.log'
# Configs backup
tar -czf $BACKUP_DIR/configs/configs-$DATE.tar.gz /etc/
# Clean old backups
find $BACKUP_DIR -type f -mtime +$RETENTION_DAYS -delete
# Report
echo "Backup completed at $(date)"

Q1797: How do you test backup restoration?

Section titled “Q1797: How do you test backup restoration?”

Answer:

Terminal window
# Test backup file integrity
gzip -t backup.tar.gz
sha256sum backup.tar.gz
# Test database restoration
mysql -u root -p -e "DROP DATABASE IF EXISTS test_restore;"
mysql -u root -p test_restore < backup.sql
mysql -u root -p -e "SHOW TABLES;" test_restore
# Test file restoration
mkdir /tmp/test_restore
tar -xzf backup.tar.gz -C /tmp/test_restore
ls -la /tmp/test_restore/
# Test in VM
vagrant up test
vagrant ssh test -c "mysql -u root -p mydb < /vagrant/backup.sql"
vagrant ssh test -c "ls /var/www/html/"
vagrant destroy test

Q1798: How do you implement disaster recovery?

Section titled “Q1798: How do you implement disaster recovery?”

Answer:

Terminal window
# DR Plan
# 1. Document critical systems
# 2. Define RTO/RPO
# 3. Create runbooks
# 4. Test regularly
# Recovery steps
# 1. Assess damage
# 2. Provision new infrastructure
# 3. Restore from backups
# 4. Verify services
# 5. Update DNS
# Database recovery
systemctl stop myapp
gunzip < backup.sql | mysql -u root -p mydb
# File recovery
tar -xzf configs.tar.gz -C /
# Verification
systemctl start myapp
curl http://localhost/health

Q1799: How do you implement incremental backups?

Section titled “Q1799: How do you implement incremental backups?”

Answer:

#!/bin/bash
# Incremental backup with tar
SOURCE="/data"
BACKUP_DIR="/backup"
DATE=$(date +%Y%m%d)
# Full backup on Sunday
if [ $(date +%w) -eq 0 ]; then
echo "Creating full backup"
rm -rf $BACKUP_DIR/full
tar -czf $BACKUP_DIR/full.tar.gz -g $BACKUP_DIR/snapshot $SOURCE/
else
# Incremental backup
echo "Creating incremental backup"
tar -czf $BACKUP_DIR/inc-$DATE.tar.gz -g $BACKUP_DIR/snapshot $SOURCE/
fi
# Retention
find $BACKUP_DIR -name "*.tar.gz" -mtime +30 -delete
# Restore incremental
# tar -xzf full.tar.gz
# tar -xzf inc-20240102.tar.gz
# tar -xzf inc-20240103.tar.gz

Q1800: How do you configure remote backup?

Section titled “Q1800: How do you configure remote backup?”

Answer:

#!/bin/bash
# Remote backup using rsync over SSH
SOURCE="/data"
REMOTE_USER="backup"
REMOTE_HOST="backup-server.example.com"
REMOTE_DIR="/backups/$(hostname)"
# Rsync over SSH with compression
rsync -avz --delete \
-e "ssh -i /root/.ssh/backup_key" \
--exclude='*.tmp' \
$SOURCE/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/
# Verify
rsync -avzn -e "ssh" $SOURCE/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/
# Daily incremental with link-dest
rsync -avz --delete \
-e "ssh" \
--link-dest=$REMOTE_DIR/previous \
$SOURCE/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/current

Answer:

Terminal window
# Install
apt install keepalived
# Configure
# /etc/keepalived/keepalived.conf
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
virtual_ipaddress {
192.168.1.100/24
}
track_interface {
eth0 weight -20
}
authentication {
auth_type PASS
auth_pass secret123
}
}
# Backup configuration
# state BACKUP
# priority 90

Answer:

Terminal window
# Install
apt install haproxy
# Configure
# /etc/haproxy/haproxy.cfg
global
log /dev/log local0
maxconn 4096
user haproxy
group haproxy
defaults
log global
mode http
option httplog
option dontlognull
frontend http_front
bind *:80
default_backend app_servers
backend app_servers
balance roundrobin
option httpchk GET /health
server app1 192.168.1.10:8080 check inter 2000 fall 3 rise 2
server app2 192.168.1.11:8080 check inter 2000 fall 3 rise 2

Answer:

Terminal window
# Install
apt install pacemaker corosync pcs
# Configure corosync
# /etc/corosync/corosync.conf
totem {
version: 2
cluster_name: mycluster
transport: udpu
}
nodelist {
node {
ring0_addr: node1.example.com
nodeid: 1
}
node {
ring0_addr: node2.example.com
nodeid: 2
}
}
quorum {
provider: corosync_votequorum
expected_votes: 2
}
# Setup cluster
pcs host auth node1 node2
pcs cluster setup mycluster node1 node2
pcs cluster start --all
pcs cluster enable --all

Answer:

Terminal window
# Create resource
pcs resource create VirtualIP ocf:heartbeat:IPaddr2 \
ip=192.168.1.100 cidr_netmask=24 op monitor interval=30s
pcs resource create WebService ocf:heartbeat:apache \
configfile=/etc/apache2/apache2.conf \
op monitor interval=30s
# Constraints
pcs constraint colocation add WebService VirtualIP INFINITY
pcs constraint order VirtualIP then WebService
# Stickiness
pcs resource meta WebService resource-stickiness=100
# Failover
pcs constraint location WebService prefers node1=50
# View status
pcs status
pcs resource show

Answer:

Terminal window
# Install
apt install drbd-utils
# Configure
# /etc/drbd.d/web.res
resource web {
protocol C;
on node1 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.1.10:7788;
meta-disk internal;
}
on node2 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.1.11:7788;
meta-disk internal;
}
}
# Initialize
drbdadm create-md web
drbdadm up web
# Primary
drbdadm primary --force web
# Filesystem
mkfs.xfs /dev/drbd0
mount /dev/drbd0 /var/www
# Status
cat /proc/drbd

Q1806: How do you write efficient bash scripts?

Section titled “Q1806: How do you write efficient bash scripts?”

Answer:

#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Use functions
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*"
}
# Use arrays
files=("file1" "file2" "file3")
for file in "${files[@]}"; do
[[ -f "$file" ]] || continue
process "$file"
done
# Process efficiently
while IFS= read -r line; do
((count++))
done < <(grep -r "pattern" .)
# Parallel processing
parallel -j 4 process {} ::: *.log

Answer:

Terminal window
# Using jq
cat data.json | jq '.name'
cat data.json | jq '.items[].value'
cat data.json | jq '.items[] | select(.id > 5)'
# Create JSON
jq -n '{name: "test", items: [1,2,3]}'
# Modify
jq '.name = "new"' data.json
# Filter
jq '.items[] | select(.age > 25)' data.json

Answer:

Terminal window
# Basic
awk '{print $1}' file.txt
# Field separator
awk -F: '{print $1, $6}' /etc/passwd
# Conditional
awk '$3 > 1000 {print $1, $3}' /etc/passwd
# Calculations
awk '{sum+=$1} END {print sum}' numbers.txt
# Patterns
awk '/ERROR/ {print}' logfile
# Multiple fields
awk '{for(i=1;i<=NF;i++) sum[i]+=$i} END {for(i in sum) print i, sum[i]}' file.txt

Answer:

Terminal window
# Replace
sed 's/old/new/' file.txt
sed 's/old/new/g' file.txt
sed -i 's/old/new/g' file.txt
# Delete lines
sed '/pattern/d' file.txt
sed '1,5d' file.txt
# Insert
sed '1i\Header' file.txt
# Regex
sed -E 's/[0-9]{4}/[REDACTED]/g' file.txt
# In-place with backup
sed -i.bak 's/old/new/g' file.txt

Answer:

#!/usr/bin/env python3
import subprocess
import json
import sys
def run_command(cmd):
result = subprocess.run(
cmd, shell=True, capture_output=True, text=True
)
return result.stdout.strip()
def main():
# Get system info
cpu = run_command("nproc")
mem = run_command("free -h | awk '/^Mem:/ {print $2}'")
# Process JSON
with open('config.json') as f:
config = json.load(f)
# Output
result = {"cpu": cpu, "memory": mem, "config": config}
print(json.dumps(result, indent=2))
return 0
if __name__ == "__main__":
sys.exit(main())

Q1811: How do you implement user authentication?

Section titled “Q1811: How do you implement user authentication?”

Answer:

/etc/pam.d/common-auth
# PAM configuration
auth required pam_tally2.so deny=3 unlock_time=600
# Password policy
# /etc/pam.d/common-password
password required pam_pwhistory.so remember=5
password requisite pam_cracklib.so try_first_pass retry=3 minlen=12
# Account expiry
# /etc/login.defs
PASS_MAX_DAYS 90
PASS_MIN_DAYS 1
PASS_WARN_AGE 14
# User expiry
passwd -x 90 -w 14 -n 1 username

Q1821: How do you implement system monitoring?

Section titled “Q1821: How do you implement system monitoring?”

Answer:

Terminal window
# Prometheus + node_exporter
# Install
apt install prometheus-node-exporter
# Configure
# /etc/default/prometheus
ARGS="--collector.interval=30s"
# Start service
systemctl start prometheus-node-exporter
systemctl enable prometheus-node-exporter
# Metrics
curl http://localhost:9100/metrics

Answer:

Terminal window
# Install
apt install grafana
# Configure datasource
# HTTP URL: http://localhost:9090
# Create dashboard
# Add panel with query
# node_exporter metrics:
# - node_cpu_seconds_total
# - node_memory_MemAvailable_bytes
# - node_filesystem_avail_bytes

Answer:

Terminal window
# Install Elasticsearch
apt install elasticsearch
# Configure
# /etc/elasticsearch/elasticsearch.yml
cluster.name: mycluster
network.host: 0.0.0.0
# Install Kibana
apt install kibana
# /etc/kibana/kibana.yml
# server.host: "0.0.0.0"
# Install Logstash
apt install logstash
# Configure Filebeat
apt install filebeat
# /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: log
paths:
- /var/log/*.log
output.logstash:
hosts: ["localhost:5044"]

Answer:

Terminal window
# Install
apt install nagios4
# Create check script
# /usr/local/nagios/lib/check_disk.sh
#!/bin/bash
USAGE=$(df -h / | tail -1 | awk '{print $5}' | sed 's/%//')
if [ "$USAGE" -gt 90 ]; then
echo "CRITICAL - Disk usage is ${USAGE}%"
exit 2
fi
echo "OK - Disk usage is ${USAGE}%"
exit 0
# Configure service
# /etc/nagios4/conf.d/services.cfg
define service{
host_name localhost
service_description Disk Usage
check_command check_disk
}

Answer:

Terminal window
# Install Zabbix server
apt install zabbix-server-mysql zabbix-frontend-php
# Configure database
mysql -u root -p
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
quit;
# Import schema
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -u zabbix -p zabbix
# Configure Zabbix
# /etc/zabbix/zabbix_server.conf
DBPassword=password
# Start services
systemctl start zabbix-server
systemctl start apache2

Q1826: How do you implement zero trust security?

Section titled “Q1826: How do you implement zero trust security?”

Answer:

Terminal window
# Network policies (Kubernetes)
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
EOF
# iptables zero trust
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# mTLS
# Use service mesh (Istio) for automatic mTLS

Q1827: How do you implement chaos engineering?

Section titled “Q1827: How do you implement chaos engineering?”

Answer:

Terminal window
# Install Chaos Mesh
helm repo add chaos-mesh https://charts.chaos-mesh.org
helm install chaos-mesh chaos-mesh/chaos-mesh -n chaos-mesh --create-namespace
# Create experiment
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
name: pod-failure
spec:
action: pod-failure
mode: one
duration: 60s
selector:
namespaces:
- default
# Apply
kubectl apply -f experiment.yaml

Answer:

Terminal window
# Install ArgoCD
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Create application
kubectl apply -f - <<EOF
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/org/repo.git
targetRevision: HEAD
path: k8s
destination:
server: https://kubernetes.default.svc
namespace: default
syncPolicy:
automated:
prune: true
selfHeal: true
EOF

Answer:

Terminal window
# Install Istio
curl -L https://istio.io/downloadIstio | sh -
istioctl install --set profile=demo
# Enable injection
kubectl label namespace default istio-injection=enabled
# Deploy application
kubectl apply -f app.yaml
# Configure mTLS
kubectl apply -f - <<EOF
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
spec:
mtls:
mode: STRICT
EOF
# Configure traffic
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: myapp
spec:
hosts:
- myapp
http:
- route:
- destination:
host: myapp
subset: v1
weight: 90
- destination:
host: myapp
subset: v2
weight: 10

Q1830: How do you implement edge computing?

Section titled “Q1830: How do you implement edge computing?”

Answer:

Terminal window
# Install K3s
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--write-kubeconfig-mode 644" sh -
# Install KubeEdge
# Cloud node
helm install cloudcore kubeedge/cloudcore --namespace kubeedge
# Edge node
wget https://github.com/kubeedge/kubeedge/releases/download/v1.12.0/kubeedge_1.12.0_linux_amd64.tar.gz
tar -xzf kubeedge_1.12.0_linux_amd64.tar.gz
edgecore --config=/etc/kubeedge/config/edgecore.yaml
# Deploy to edge
kubectl apply -f deployment.yaml

Q1831: How do you implement supply chain security?

Section titled “Q1831: How do you implement supply chain security?”

Answer:

Terminal window
# Dependency scanning
# Snyk
npm install -g snyk
snyk test
# Trivy for containers
trivy image myimage:latest
trivy image --severity HIGH,CRITICAL myimage:latest
# SBOM generation
# Syft
syft myimage:latest
# Cosign for signing
cosign sign myimage:latest
cosign verify myimage:latest
# GitHub Dependabot
# Enable in repo settings
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"

Q1832: How do you implement cost optimization?

Section titled “Q1832: How do you implement cost optimization?”

Answer:

Terminal window
# Right-sizing
# AWS
aws ec2 describe-instance-types --instance-type t3.micro
# Reserved instances
# Purchase for steady workloads
# Spot instances
# Use for fault-tolerant workloads
# Autoscaling
# Scale in when not needed
# Storage lifecycle
# Move cold data to Glacier
aws s3api put-bucket-lifecycle-configuration --bucket mybucket \
--lifecycle-configuration file://lifecycle.json
# Budget alerts
aws budgets create-budget \
--account-id 123456789012 \
--budget file://budget.json

Q1833: How do you implement compliance automation?

Section titled “Q1833: How do you implement compliance automation?”

Answer:

Terminal window
# OPA Gatekeeper
# Install
kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/allownswidgetpolicies/template.yaml
# Policy example
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sRequiredLabels
metadata:
name: require-labels
spec:
match:
kinds:
- apiGroups: [""]
kinds: ["Namespace"]
parameters:
labels:
- key: "environment"

Q1834: How do you implement data governance?

Section titled “Q1834: How do you implement data governance?”

Answer:

Terminal window
# Data classification
# Public, Internal, Confidential, Restricted
# Encryption at rest
# LUKS
cryptsetup luksFormat /dev/sdb1
# Encryption in transit
# TLS everywhere
# Access control
# IAM policies
# Database permissions
# Data loss prevention
# Block sensitive data exfiltration
# Audit logging
# Track all access

Answer:

Terminal window
# Visibility
# Tag all resources
# Environment, Team, Project
# Monitoring
# AWS Cost Explorer
# Budget alerts
# Optimization
# Right-size instances
# Use savings plans
# Spot instances
# Showback
# Report costs by team
# Automation
# Terminate unused resources
# Move cold data to cheaper storage

Q1836: How do you handle a production outage?

Section titled “Q1836: How do you handle a production outage?”

Answer:

Terminal window
# 1. Detection
# Monitor alerts
# User reports
# 2. Assessment
# Check severity
# Determine impact
# 3. Communication
# Create incident channel
# Update status page
# 4. Mitigation
# Stop bleeding
# Restore service
# 5. Resolution
# Fix root cause
# 6. Post-incident
# Document timeline
# Identify root cause
# Action items

Q1837: How do you troubleshoot slow database queries?

Section titled “Q1837: How do you troubleshoot slow database queries?”

Answer:

Terminal window
# Check slow queries
# PostgreSQL
# pg_stat_statements
# EXPLAIN ANALYZE
# MySQL
# SHOW PROCESSLIST
# EXPLAIN
# Check indexes
# Missing indexes
# Outdated statistics
# Fixes
# Add indexes
# Rewrite queries
# Tune configuration
# Scale horizontally

Q1838: How do you design a backup strategy?

Section titled “Q1838: How do you design a backup strategy?”

Answer:

Terminal window
# 3-2-1 rule
# 3 copies of data
# 2 different storage types
# 1 offsite copy
# Backup types
# Full backup: Daily
# Incremental: Hourly
# Transaction logs: Every 15 minutes
# Retention
# Daily: 7 days
# Weekly: 4 weeks
# Monthly: 12 months
# Yearly: 7 years
# Testing
# Monthly restoration tests

Answer:

Terminal window
# Updates
# Regular patching
# Firewall
# Configure iptables/firewalld
# SELinux/AppArmor
# Enable and configure
# Users
# Disable root login
# SSH keys only
# Services
# Disable unused
# Network
# Harden kernel parameters
# Monitoring
# Enable audit logging
# Encryption
# Full disk encryption
# TLS everywhere

Q1840: How do you design a monitoring system?

Section titled “Q1840: How do you design a monitoring system?”

Answer:

Terminal window
# Components
# 1. Metrics: Prometheus
# 2. Logs: ELK/Loki
# 3. Traces: Jaeger
# 4. Alerting: AlertManager
# 5. Dashboards: Grafana
# Implementation
# - Install exporters
# - Configure scrape intervals
# - Set up alerts
# - Create dashboards
# Best practices
# - Alert on symptoms
# - Avoid alert fatigue
# - Have runbooks

Q1841: How do you optimize Linux performance?

Section titled “Q1841: How do you optimize Linux performance?”

Answer:

Terminal window
# 1. CPU
# Tune scheduler
# Process priority
# CPU affinity
# 2. Memory
# Swappiness
# Huge pages
# Cache tuning
# 3. I/O
# I/O scheduler
# Filesystem choice
# Mount options
# 4. Network
# Buffer sizes
# TCP tuning
# Offloading
# 5. Kernel
# Update regularly
# Tune parameters

Q1842: How do you implement disaster recovery?

Section titled “Q1842: How do you implement disaster recovery?”

Answer:

Terminal window
# Define RTO/RPO
# Recovery Time Objective
# Recovery Point Objective
# Strategy
# Backup & Restore
# Pilot Light
# Warm Standby
# Multi-region
# Implementation
# Automated backups
# Replication
# Infrastructure as Code
# Testing
# Regular DR tests
# Documentation
# Runbooks
# Contact list

Q1843: How do you implement zero-downtime deployment?

Section titled “Q1843: How do you implement zero-downtime deployment?”

Answer:

Terminal window
# Strategies
# 1. Rolling update
kubectl rolling-update myapp --image=myapp:v2
# 2. Blue-green
# Deploy to green
# Test
# Switch traffic
# 3. Canary
# Route 10% to new version
# Monitor
# Gradually increase
# 4. Feature flags
# Toggle features without deployment

Q1844: How do you handle capacity planning?

Section titled “Q1844: How do you handle capacity planning?”

Answer:

Terminal window
# Current state
# Measure utilization
sar -u 1
sar -r 1
sar -d 1
# Trends
# Analyze growth rate
# Forecasting
# Predict future needs
# Planning
# Add capacity proactively
# Optimization
# Right-size resources
# Use automation

Answer:

Terminal window
# Framework
# SOC 2, PCI-DSS, HIPAA, GDPR
# Controls
# Access control
# Encryption
# Monitoring
# Auditing
# Automation
# Policy as Code
# Evidence
# Automated collection
# Training
# Security awareness
# Testing
# Vulnerability scans
# Penetration tests

Answer:

Terminal window
# Horizontal scaling
# Stateless applications
# Load balancers
# Auto-scaling
# Database scaling
# Read replicas
# Sharding
# Caching
# Caching
# Redis/Memcached
# CDN
# Async
# Message queues
# Optimization
# Profiling
# Database tuning
# Monitoring
# Early detection

Q1847: How do you implement observability?

Section titled “Q1847: How do you implement observability?”

Answer:

Terminal window
# Metrics
# Prometheus
# Custom metrics
# Logs
# Structured logging
# ELK/Loki
# Traces
# Distributed tracing
# Correlation
# Trace IDs
# Request IDs
# Alerting
# Based on SLOs
# Dashboards
# Service overview
# Troubleshooting
# Post-mortems
# Blameless analysis

Answer:

Terminal window
# Images
# Minimal base
# No secrets
# Scan for vulnerabilities
# Runtime
# Non-root user
# Read-only root
# Resource limits
# Network
# Network policies
# Service mesh
# Orchestrator
# RBAC
# Pod security
# Secrets
# Use secrets manager

Q1849: How do you implement infrastructure as code?

Section titled “Q1849: How do you implement infrastructure as code?”

Answer:

Terminal window
# Version control
# Git
# Modules
# Reusable components
# State management
# Remote state
# State locking
# Testing
# Validate
# Plan
# CI/CD
# Automated deployment
# Drift detection
# Detect changes

Q1850: How do you manage secrets in CI/CD?

Section titled “Q1850: How do you manage secrets in CI/CD?”

Answer:

Terminal window
# Never commit secrets
# Use secrets management
# HashiCorp Vault
# AWS Secrets Manager
# Azure Key Vault
# Environment variables
# Inject at runtime
# CI/CD integration
# GitHub Secrets
# GitLab CI variables
# Rotation
# Auto-rotate secrets
# Audit
# Log access

Q1851: How do you design a secure network?

Section titled “Q1851: How do you design a secure network?”

Answer:

Terminal window
# Segmentation
# DMZ
# Internal
# Database
# Firewall
# Whitelist approach
# Default deny
# Encryption
# TLS everywhere
# VPN for access
# Monitoring
# IDS/IPS
# NetFlow
# DDoS protection
# CDN
# WAF
# Rate limiting

Q1852: How do you handle database failover?

Section titled “Q1852: How do you handle database failover?”

Answer:

Terminal window
# Automatic detection
# Health checks
# Failover process
# Promote replica
# Update DNS
# Application handling
# Connection retry
# Circuit breakers
# Monitoring
# Alert on failover
# Testing
# Regular drills

Answer:

Terminal window
# CDN
# Static assets
# Application cache
# Redis
# Memcached
# Database cache
# Query cache
# Buffer pool
# Browser cache
# Headers
# Invalidation
# TTL
# Cache busting
# Patterns

Q1854: How do you design for high availability?

Section titled “Q1854: How do you design for high availability?”

Answer:

Terminal window
# Redundancy
# Multiple AZs
# Multiple regions
# Load balancing
# Health checks
# Failover
# Data replication
# Synchronous
# Asynchronous
# Monitoring
# Fast detection
# Automation
# Self-healing
# Testing
# Chaos engineering

Answer:

Terminal window
# RBAC
# Least privilege
# Network policies
# Default deny
# Pod security
# Standards
# Secrets
# External
# Images
# Scanning
# Runtime
# Falco
# Updates
# Regular

Answer:

Terminal window
# Authentication
# OAuth 2.0
# JWT
# Authorization
# RBAC
# Scopes
# Rate limiting
# Throttling
# Input validation
# Sanitization
# TLS
# Encryption
# Monitoring
# Anomaly detection

Answer:

Terminal window
# Format
# JSON
# Structured
# Levels
# DEBUG, INFO, WARN, ERROR
# Correlation
# Trace IDs
# Rotation
# Logrotate
# Aggregation
# ELK/Loki
# Retention
# Policy

Answer:

Terminal window
# Defense in depth
# Multiple layers
# Least privilege
# Minimize access
# Zero trust
# Verify always
# Encryption
# Everywhere
# Monitoring
# Continuous
# Automation
# Respond fast

Q1859: How do you implement incident response?

Section titled “Q1859: How do you implement incident response?”

Answer:

Terminal window
# Preparation
# Runbooks
# Tools
# Detection
# Alerts
# Containment
# Isolate
# Eradication
# Fix
# Recovery
# Restore
# Lessons learned
# Post-mortem

Answer:

Terminal window
# Right-sizing
# Match needs
# Reservations
# Steady state
# Spot
# Fault-tolerant
# Automation
# Scale down
# Cleanup
# Unused resources
# Monitoring
# Alerts

Q1861: How do you implement change automation?

Section titled “Q1861: How do you implement change automation?”

Answer:

Terminal window
# GitOps
# All changes in Git
# CI/CD
# Automated testing
# Approval gates
# Manual steps
# Rollback
# Automatic
# Monitoring
# Quick detection

Answer:

Terminal window
# Redundancy
# Multiple copies
# Graceful degradation
# Partial service
# Circuit breakers
# Prevent cascade
# Bulkheads
# Isolate
# Recovery
# Fast
# Testing
# Chaos

Q1863: How do you implement access control?

Section titled “Q1863: How do you implement access control?”

Answer:

Terminal window
# Authentication
# MFA
# Authorization
# RBAC
# Least privilege
# Minimal access
# Audit
# Log access
# Review
# Regular

Answer:

Terminal window
# Classification
# Sensitivity
# Encryption
# At rest
# In transit
# Access control
# Need to know
# Backup
# Encrypted
# Monitoring
# Audit

Answer:

Terminal window
# REST
# Resources
# HTTP verbs
# Versioning
# URL path
# Error handling
# Consistent
# Pagination
# Large sets
# Rate limiting
# Throttle
# Documentation
# OpenAPI

Answer:

Terminal window
# Traffic management
# Routing
# Security
# mTLS
# Observability
# Tracing
# Resilience
# Retries
# Tools
# Istio
# Linkerd
# Consul Connect

Answer:

Terminal window
# Indexing
# Proper indexes
# Query optimization
# EXPLAIN
# Caching
# Use cache
# Connection pooling
# Pool
# Scaling
# Read replicas
# Sharding
# Configuration
# Tune parameters

Q1868: How do you implement secrets management?

Section titled “Q1868: How do you implement secrets management?”

Answer:

Terminal window
# Centralized
# Vault
# Rotation
# Auto
# Audit
# Log access
# Encryption
# Encrypt
# Access control
# Least privilege

Answer:

Terminal window
# Backup
# Regular
# Replication
# Cross-region
# Automation
# Fast recovery
# Testing
# Regular
# Documentation
# Runbooks

Q1870: How do you implement observability?

Section titled “Q1870: How do you implement observability?”

Answer:

Terminal window
# Metrics
# Prometheus
# Logs
# ELK
# Traces
# Jaeger
# Correlation
# Trace IDs
# Alerting
# SLO-based

Answer:

Terminal window
# Test in staging
# Check compatibility
# Backup
# Schedule window
# Apply
# Monitor
# Rollback plan

Q1872: How do you design multi-tenant systems?

Section titled “Q1872: How do you design multi-tenant systems?”

Answer:

Terminal window
# Isolation
# Namespaces
# RBAC
# Quotas
# Resources
# Billing
# Usage tracking
# Data separation
# Logical/physical
# Network
# Segmentation

Q1873: How do you implement edge computing?

Section titled “Q1873: How do you implement edge computing?”

Answer:

Terminal window
# Lightweight K8s
# K3s
# Data processing
# Local first
# Sync
# Periodic
# Security
# Edge-specific
# Management
# Centralized

Q1874: How do you optimize Linux for containers?

Section titled “Q1874: How do you optimize Linux for containers?”

Answer:

Terminal window
# OS
# Minimal OS
# Kernel
# Tuned for containers
# Storage
# Overlay2
# Network
# CNI
# Runtime
# containerd
# Security
# Hardened

Answer:

Terminal window
# Data minimization
# Collect less
# Consent
# Explicit
# Right to erasure
# Delete capability
# Portability
# Export data
# Breach notification
# Process
# DPO
# Appoint

Q1876: How do you implement zero-downtime patching?

Section titled “Q1876: How do you implement zero-downtime patching?”

Answer:

Terminal window
# Blue-green
# Two environments
# Canary
# Gradual
# Rolling
# One by one
# Health checks
# Before switch
# Rollback
# Quick

Answer:

Terminal window
# Edge
# Local processing
# Protocol
# MQTT
# Security
# Device auth
# Scale
# Millions
# OTA updates
# Secure

Answer:

Terminal window
# Roles
# Define
# Permissions
# Map
# Assignment
# Users
# Audit
# Regular review
# Tools
# LDAP integration

Q1879: How do you optimize network performance?

Section titled “Q1879: How do you optimize network performance?”

Answer:

Terminal window
# Offloading
# Hardware
# Buffer tuning
# TCP
# Compression
# Accept encoding
# CDN
# Static
# Keepalive
# HTTP

Answer:

Terminal window
# API design
# Efficient
# Compression
# gz/brotli
# Caching
# Aggressive
# Offline
# PWA
# Security
# Certificate pinning

Q1881: How do you implement chaos engineering?

Section titled “Q1881: How do you implement chaos engineering?”

Answer:

Terminal window
# Define steady state
# What works
# Hypothesize
# What will fail
# Experiment
# Inject failure
# Learn
# Observe
# Improve
# Fix
# Tools
# Chaos Mesh
# Litmus
# Gremlin

Q1882: How do you implement immutable infrastructure?

Section titled “Q1882: How do you implement immutable infrastructure?”

Answer:

Terminal window
# Images
# Pre-built
# No changes
# Rebuild
# Versioned
# All
# Rollback
# Previous image
# Tools
# Packer
# Container

Q1883: How do you design for high performance?

Section titled “Q1883: How do you design for high performance?”

Answer:

Terminal window
# Profiling
# Find bottleneck
# Optimization
# Targeted
# Caching
# Multi-layer
# Async
# Non-blocking
# Scaling
# Horizontal

Answer:

Terminal window
# Abstraction
# Terraform
# Portability
# Container
# Vendor lock-in
# Avoid
# Data
# Strategy
# Operations
# Unified

Q1885: How do you implement cost allocation?

Section titled “Q1885: How do you implement cost allocation?”

Answer:

Terminal window
# Tagging
# All resources
# Tracking
# By team/project
# Reporting
# Regular
# Budgets
# Alerts
# Showback
# Chargeback

Q1886: How do you implement compliance automation?

Section titled “Q1886: How do you implement compliance automation?”

Answer:

Terminal window
# Policy as code
# OPA
# Scanning
# Automated
# Evidence
# Auto-collect
# Remediation
# Auto-fix
# Audit
# Regular

Q1887: How do you implement API rate limiting?

Section titled “Q1887: How do you implement API rate limiting?”

Answer:

Terminal window
# Token bucket
# Leaky bucket
# Per-user
# By key
# Headers
# Rate limit
# Response
# 429
# Throttling
# Graceful

Q1888: How do you design for IoT security?

Section titled “Q1888: How do you design for IoT security?”

Answer:

Terminal window
# Device identity
# Certificates
# OTA updates
# Signed
# Network
# Segmentation
# Data
# Encryption
# Monitoring
# Anomaly

Q1889: How do you implement infrastructure monitoring?

Section titled “Q1889: How do you implement infrastructure monitoring?”

Answer:

Terminal window
# Metrics
# Collect
# Storage
# Time-series
# Visualization
# Dashboards
# Alerting
# Thresholds
# Analysis
# Trends

Q1890: How do you implement database sharding?

Section titled “Q1890: How do you implement database sharding?”

Answer:

Terminal window
# Key strategy
# Choose shard key
# Routing
# Application
# Rebalancing
# Plan
# Cross-shard
# Minimize
# Monitoring
# Performance

Answer:

Terminal window
# Edge computing
# Local processing
# Network slicing
# Dedicated
# Low latency
# Optimization
# Massive IoT
# Scale

Q1892: How do you implement service discovery?

Section titled “Q1892: How do you implement service discovery?”

Answer:

Terminal window
# DNS
# Consul
# Health checks
# Registration
# Load balancing
# Client-side
# Failover
# Automatic

Q1893: How do you optimize web performance?

Section titled “Q1893: How do you optimize web performance?”

Answer:

Terminal window
# CDN
# Static assets
# Compression
# gz/brotli
# Caching
# Headers
# Minification
# CSS/JS
# Images
# Optimization

Q1894: How do you implement backup verification?

Section titled “Q1894: How do you implement backup verification?”

Answer:

Terminal window
# Test restore
# Regular
# Automation
# Script
# Checksums
# Verify
# Documentation
# Procedures

Answer:

Terminal window
# Data minimization
# Collect less
# Encryption
# Strong
# Access control
# Strict
# Audit
# Logging
# Retention
# Policy

Q1896: How do you implement auto-remediation?

Section titled “Q1896: How do you implement auto-remediation?”

Answer:

Terminal window
# Detection
# Alerts
# Classification
# Severity
# Action
# Runbook
# Automation
# Scripts
# Verification
# Confirm fix

Answer:

Terminal window
# Tiering
# Hot/cold
# Compression
# Deduplication
# Lifecycle
# Policies
# Monitoring
# Usage
# Cleanup
# Regular

Answer:

Terminal window
# Factors
# Multiple
# Methods
# TOTP/Push
# Rollout
# Gradual
# Backup
# Recovery codes
# Enforcement
# Policy

Answer:

Terminal window
# Redundancy
# Multiple
# Fault tolerance
# Graceful
# Recovery
# Fast
# Testing
# Chaos
# Monitoring
# Real-time

Q1900: How do you implement cost reporting?

Section titled “Q1900: How do you implement cost reporting?”

Answer:

Terminal window
# Tagging
# Comprehensive
# Collection
# Automated
# Analysis
# By team
# Visualization
# Dashboards
# Actions
# Optimization

Answer:

Terminal window
# Collection
# MQTT/HTTP
# Processing
# Stream
# Storage
# Time-series
# Analysis
# Real-time
# Retention
# Policy

Q1902: How do you implement service catalog?

Section titled “Q1902: How do you implement service catalog?”

Answer:

Terminal window
# Self-service
# Portal
# Standardization
# Templates
# Governance
# Approval
# Documentation
# Auto-generated

Q1903: How do you optimize database queries?

Section titled “Q1903: How do you optimize database queries?”

Answer:

Terminal window
# EXPLAIN
# Analyze
# Indexing
# Strategic
# Rewriting
# Equivalent
# Caching
# Query cache
# Profiling
# Slow queries

Answer:

Terminal window
# Routing
# Path-based
# Authentication
# JWT
# Rate limiting
# Quotas
# Caching
# Response
# Monitoring
# Usage

Answer:

Terminal window
# Controls
# Framework
# Automation
# Policy
# Evidence
# Collection
# Monitoring
# Continuous
# Audit
# Regular

Q1906: How do you implement incident automation?

Section titled “Q1906: How do you implement incident automation?”

Answer:

Terminal window
# Detection
# Automated
# Triage
# Classification
# Response
# Runbooks
# Escalation
# Rules
# Resolution
# Tracking

Answer:

Terminal window
# Resources
# Requests/limits
# Scheduling
# Affinity
# Networking
# CNI
# Storage
# Classes
# Autoscaling
# HPA/VPA

Q1908: How do you implement data governance?

Section titled “Q1908: How do you implement data governance?”

Answer:

Terminal window
# Classification
# Sensitivity
# Ownership
# Clear
# Quality
# Rules
# Lineage
# Tracking
# Compliance
# Policy

Q1909: How do you design for ML infrastructure?

Section titled “Q1909: How do you design for ML infrastructure?”

Answer:

Terminal window
# Data pipeline
# ETL
# Training
# Distributed
# Serving
# Model serving
# Monitoring
# Drift
# MLOps
# Automation

Q1910: How do you implement cloud governance?

Section titled “Q1910: How do you implement cloud governance?”

Answer:

Terminal window
# Policies
# Guardrails
# Tagging
# Standards
# Cost control
# Budgets
# Security
# Baseline
# Compliance
# Audit

Q1911: How do you design for edge security?

Section titled “Q1911: How do you design for edge security?”

Answer:

Terminal window
# Device auth
# Certificates
# Data encryption
# TLS
# Network
# Segmentation
# Updates
# Signed
# Monitoring
# Centralized

Q1912: How do you implement container orchestration?

Section titled “Q1912: How do you implement container orchestration?”

Answer:

Terminal window
# Scheduling
# Placement
# Scaling
# Auto
# Networking
# Service mesh
# Storage
# CSI
# Security
# Policies

Q1913: How do you optimize network latency?

Section titled “Q1913: How do you optimize network latency?”

Answer:

Terminal window
# CDN
# Geographic
# Caching
# Multi-layer
# Compression
# gz/brotli
# HTTP/2
# Multiplexing
# DNS
# Anycast

Q1914: How do you implement data protection?

Section titled “Q1914: How do you implement data protection?”

Answer:

Terminal window
# Encryption
# At rest/transit
# Access control
# RBAC
# Backup
# Automated
# Monitoring
# Audit
# Incident
# Response

Q1915: How do you design for real-time processing?

Section titled “Q1915: How do you design for real-time processing?”

Answer:

Terminal window
# Stream processing
# Kafka/Spark
# Low latency
# Optimization
# Scalability
# Horizontal
# Monitoring
# Metrics
# Backpressure
# Handling

Q1916: How do you implement application security?

Section titled “Q1916: How do you implement application security?”

Answer:

Terminal window
# SDLC
# Secure
# SAST/DAST
# Scanning
# Dependencies
# Scanning
# Runtime
# Protection
# Training
# Developers

Q1917: How do you optimize Linux for databases?

Section titled “Q1917: How do you optimize Linux for databases?”

Answer:

Terminal window
# Filesystem
# XFS/ext4
# I/O scheduler
# Deadline/noop
# Memory
# Huge pages
# Network
# Buffer sizes
# Disk
# SSD/NVMe

Q1918: How do you implement data retention?

Section titled “Q1918: How do you implement data retention?”

Answer:

Terminal window
# Policy
# Defined
# Classification
# By type
# Automation
# Scripts
# Compliance
# Legal holds
# Verification
# Regular

Q1919: How do you design for compliance reporting?

Section titled “Q1919: How do you design for compliance reporting?”

Answer:

Terminal window
# Evidence
# Automated
# Framework
# Mapping
# Controls
# Validation
# Audit
# Support
# Remediation
# Tracking

Q1920: How do you implement Kubernetes networking?

Section titled “Q1920: How do you implement Kubernetes networking?”

Answer:

Terminal window
# CNI plugin
# Calico/Flannel
# Network policies
# Segmentation
# Services
# Types
# Ingress
# Controller
# DNS
# CoreDNS

Q1921: How do you optimize database connections?

Section titled “Q1921: How do you optimize database connections?”

Answer:

Terminal window
# Pooling
# Connection pool
# Sizing
# Pool size
# Timeouts
# Configure
# Monitoring
# Active connections
# Tuning
# Database config

Q1922: How do you implement backup automation?

Section titled “Q1922: How do you implement backup automation?”

Answer:

Terminal window
# Scheduling
# Cron
# Retention
# Policy
# Verification
# Test restore
# Offsite
# Replication
# Monitoring
# Alerts

Q1923: How do you design for regulatory compliance?

Section titled “Q1923: How do you design for regulatory compliance?”

Answer:

Terminal window
# Assessment
# Gap analysis
# Controls
# Implementation
# Monitoring
# Continuous
# Documentation
# Evidence
# Audit
# Support

Q1924: How do you implement service level objectives?

Section titled “Q1924: How do you implement service level objectives?”

Answer:

Terminal window
# Define
# Metrics
# Measurement
# Collection
# Alerting
# Budget
# Reporting
# Regular
# Improvement
# Action

Answer:

Terminal window
# Filesystem
# Choice
# Mount options
# Tuning
# LVM
# Flexible
# RAID
# Configuration
# Monitoring
# I/O

Q1926: How do you implement network segmentation?

Section titled “Q1926: How do you implement network segmentation?”

Answer:

Terminal window
# VLANs
# Isolation
# Firewalls
# Zones
# Zero trust
# Micro-segmentation
# Monitoring
# Traffic
# Compliance
# Audit

Q1927: How do you design for ML model serving?

Section titled “Q1927: How do you design for ML model serving?”

Answer:

Terminal window
# Framework
# TensorFlow Serving
# Scaling
# Horizontal
# A/B testing
# Canary
# Monitoring
# Drift
# Updates
# Rolling

Q1928: How do you implement vulnerability management?

Section titled “Q1928: How do you implement vulnerability management?”

Answer:

Terminal window
# Scanning
# Regular
# Prioritization
# Severity
# Remediation
# Process
# Verification
# Rescan
# Reporting
# Metrics

Q1929: How do you optimize web application security?

Section titled “Q1929: How do you optimize web application security?”

Answer:

Terminal window
# WAF
# Deploy
# Headers
# Security
# Input validation
# Sanitization
# SQL injection
# Prevention
# XSS
# Protection

Q1930: How do you design for compliance automation?

Section titled “Q1930: How do you design for compliance automation?”

Answer:

Terminal window
# Policy as code
# OPA
# Scanning
# Continuous
# Remediation
# Auto
# Evidence
# Collection
# Reporting
# Automated

Q1931: How do you implement incident communication?

Section titled “Q1931: How do you implement incident communication?”

Answer:

Terminal window
# Stakeholders
# Identification
# Status page
# Updates
# Channels
# Multiple
# Timing
# Regular
# Post-incident
# Communication

Q1932: How do you optimize Kubernetes resources?

Section titled “Q1932: How do you optimize Kubernetes resources?”

Answer:

Terminal window
# Requests
# Set appropriately
# Limits
# Configure
# HPA
# Auto-scale
# VPA
# Recommendations
# Monitoring
# Usage

Q1933: How do you implement data classification?

Section titled “Q1933: How do you implement data classification?”

Answer:

Terminal window
# Categories
# Public, Internal, Confidential
# Labeling
# Automatic
# Policies
# Based on class
# Training
# Awareness
# Auditing
# Regular

Q1934: How do you design for regulatory requirements?

Section titled “Q1934: How do you design for regulatory requirements?”

Answer:

Terminal window
# Framework
# Selection
# Controls
# Implementation
# Monitoring
# Continuous
# Evidence
# Automated
# Audit
# Support

Q1935: How do you implement cost allocation tags?

Section titled “Q1935: How do you implement cost allocation tags?”

Answer:

Terminal window
# Tagging policy
# Required tags
# Enforcement
# SCP
# Reporting
# By tag
# Alerts
# Budget
# Optimization
# Action

Q1936: How do you optimize Linux for networking?

Section titled “Q1936: How do you optimize Linux for networking?”

Answer:

Terminal window
# Buffer sizes
# Tuning
# Offloading
# Enable
# TCP
# Parameters
# Queue
# Tuning
# Monitoring
# Metrics

Q1937: How do you implement service mesh security?

Section titled “Q1937: How do you implement service mesh security?”

Answer:

Terminal window
# mTLS
# Enable
# Authorization
# Policies
# Encryption
# Automatic
# Audit
# Logging
# Updates
# Regular

Q1938: How do you design for disaster recovery testing?

Section titled “Q1938: How do you design for disaster recovery testing?”

Answer:

Terminal window
# Schedule
# Regular
# Scope
# Defined
# Documentation
# Runbooks
# Validation
# Success
# Improvements
# Action items

Q1939: How do you implement API versioning?

Section titled “Q1939: How do you implement API versioning?”

Answer:

Terminal window
# Strategy
# URL path
# Deprecation
# Policy
# Documentation
# Swagger
# Migration
# Guide
# Support
# Timeline

Q1940: How do you optimize container images?

Section titled “Q1940: How do you optimize container images?”

Answer:

Terminal window
# Base image
# Minimal
# Layers
# Reduce
# Caching
# Build cache
# Multi-stage
# Build
# Scanning
# Security

Q1941: How do you implement compliance monitoring?

Section titled “Q1941: How do you implement compliance monitoring?”

Answer:

Terminal window
# Controls
# Continuous
# Alerts
# Deviation
# Reporting
# Regular
# Remediation
# Tracking
# Audit
# Support

Q1942: How do you design for data pipelines?

Section titled “Q1942: How do you design for data pipelines?”

Answer:

Terminal window
# Source
# Connectors
# Processing
# ETL/ELT
# Quality
# Validation
# Destination
# Storage
# Monitoring
# Alerts

Q1943: How do you implement zero trust network?

Section titled “Q1943: How do you implement zero trust network?”

Answer:

Terminal window
# Verify
# Always
# Least privilege
# Access
# Micro-segmentation
# Network
# Encryption
# All traffic
# Monitoring
# Continuous

Q1944: How do you optimize Linux for high availability?

Section titled “Q1944: How do you optimize Linux for high availability?”

Answer:

Terminal window
# Keepalived
# Configure
# HAProxy
# Tune
# Health checks
# Configure
# Monitoring
# Comprehensive
# Testing
# Regular

Q1945: How do you implement security automation?

Section titled “Q1945: How do you implement security automation?”

Answer:

Terminal window
# Scanning
# Automated
# Remediation
# Auto-fix
# Response
# Playbooks
# Integration
# CI/CD
# Monitoring
# Continuous

Q1946: How do you design for event-driven architecture?

Section titled “Q1946: How do you design for event-driven architecture?”

Answer:

Terminal window
# Event sourcing
# Design
# Message broker
# Kafka
# Consumers
# Scaling
# Idempotency
# Handle
# Monitoring
# Events

Q1947: How do you implement infrastructure testing?

Section titled “Q1947: How do you implement infrastructure testing?”

Answer:

Terminal window
# Validation
# Terraform
# Integration
# Kitchen
# Compliance
# InSpec
# Security
# Scanning
# Chaos
# Engineering

Answer:

Terminal window
# CI/CD
# Optimize
# Automation
# Everything
# Monitoring
# Feedback
# Collaboration
# Teams
# Culture
# Improvement

Q1949: How do you implement data encryption?

Section titled “Q1949: How do you implement data encryption?”

Answer:

Terminal window
# At rest
# LUKS
# In transit
# TLS
# Application
# Field-level
# Keys
# Management
# Rotation
# Policy

Q1950: How do you design for incident recovery?

Section titled “Q1950: How do you design for incident recovery?”

Answer:

Terminal window
# Detection
# Fast
# Containment
# Quick
# Eradication
# Complete
# Recovery
# Fast
# Post-incident
# Learning

Q1951: How do you implement container security scanning?

Section titled “Q1951: How do you implement container security scanning?”

Answer:

Terminal window
# Build time
# Scan images
# Registry
# Scan stored
# Runtime
# Scan running
# Policies
# Define
# Automation
# CI/CD

Q1952: How do you optimize Linux for virtualization?

Section titled “Q1952: How do you optimize Linux for virtualization?”

Answer:

Terminal window
# CPU
# Pinning
# Memory
# Overcommit
# Network
# Para-virtual
# Storage
# VirtIO
# Monitoring
# Per-VM

Q1953: How do you implement access certification?

Section titled “Q1953: How do you implement access certification?”

Answer:

Terminal window
# Review schedule
# Quarterly
# Certification
# Campaign
# Remediation
# Tasks
# Exceptions
# Approval
# Reporting
# Audit

Q1954: How do you design for data recovery?

Section titled “Q1954: How do you design for data recovery?”

Answer:

Terminal window
# Backups
# Multiple
# Point in time
# Capability
# Testing
# Regular
# Documentation
# Procedures
# Team
# Training

Q1955: How do you implement API authentication?

Section titled “Q1955: How do you implement API authentication?”

Answer:

Terminal window
# OAuth 2.0
# Implement
# JWT
# Tokens
# API keys
# Management
# Rotation
# Policy
# Monitoring
# Usage

Q1956: How do you optimize database indexing?

Section titled “Q1956: How do you optimize database indexing?”

Answer:

Terminal window
# Identify
# Slow queries
# Analyze
# EXPLAIN
# Create
# Appropriate
# Composite
# Order
# Maintenance
# Rebuild

Q1957: How do you implement incident triage?

Section titled “Q1957: How do you implement incident triage?”

Answer:

Terminal window
# Classification
# Severity
# Impact
# Assessment
# Prioritization
# Order
# Assignment
# Owner
# Escalation
# Path

Q1958: How do you design for cloud migration?

Section titled “Q1958: How do you design for cloud migration?”

Answer:

Terminal window
# Assessment
# Discovery
# Planning
# Strategy
# Migration
# Execute
# Validation
# Testing
# Optimization
# Post-migration

Q1959: How do you implement security policies?

Section titled “Q1959: How do you implement security policies?”

Answer:

Terminal window
# Framework
# Define
# Implementation
# Deploy
# Enforcement
# Monitor
# Training
# Awareness
# Review
# Regular

Q1960: How do you design for data architecture?

Section titled “Q1960: How do you design for data architecture?”

Answer:

Terminal window
# Storage
# Selection
# Processing
# Pipeline
# Integration
# API
# Governance
# Policy
# Security
# Encryption

Q1961: How do you implement compliance reporting?

Section titled “Q1961: How do you implement compliance reporting?”

Answer:

Terminal window
# Collect evidence
# Automated
# Map controls
# Framework
# Generate reports
# Templates
# Review
# Stakeholders
# Archive
# Secure

Answer:

Terminal window
# Version control
# Models
# Experimentation
# Tracking
# Deployment
# CI/CD
# Monitoring
# Performance
# Retraining
# Automation

Q1963: How do you implement secure coding?

Section titled “Q1963: How do you implement secure coding?”

Answer:

Terminal window
# Training
# Developers
# Standards
# OWASP
# Review
# Code review
# Testing
# SAST/DAST
# Dependencies
# Scanning

Q1964: How do you design for API management?

Section titled “Q1964: How do you design for API management?”

Answer:

Terminal window
# Gateway
# Deploy
# Rate limiting
# Configure
# Authentication
# OAuth
# Documentation
# OpenAPI
# Analytics
# Usage

Q1965: How do you implement incident management automation?

Section titled “Q1965: How do you implement incident management automation?”

Answer:

Terminal window
# Triage
# Automated
# Response
# Playbooks
# Escalation
# Rules
# Communication
# Templates
# Resolution
# Tracking

Q1966: How do you optimize storage performance?

Section titled “Q1966: How do you optimize storage performance?”

Answer:

Terminal window
# SSD
# Use
# RAID
# Configuration
# Filesystem
# Choice
# Caching
# Enable
# Monitoring
# I/O metrics

Q1967: How do you design for zero downtime?

Section titled “Q1967: How do you design for zero downtime?”

Answer:

Terminal window
# Load balancing
# Health checks
# Database
# Blue-green
# Caching
# Warm up
# Deployment
# Canary
# Rollback
# Quick

Q1968: How do you implement infrastructure cost optimization?

Section titled “Q1968: How do you implement infrastructure cost optimization?”

Answer:

Terminal window
# Right-sizing
# Continuous
# Reservations
# Plan
# Spot instances
# Use
# Cleanup
# Scheduled
# Monitoring
# Alerts

Q1969: How do you design for data privacy?

Section titled “Q1969: How do you design for data privacy?”

Answer:

Terminal window
# Classification
# Automated
# Encryption
# End-to-end
# Access control
# Fine-grained
# Audit logging
# Comprehensive
# Retention
# Policy

Q1970: How do you implement network automation?

Section titled “Q1970: How do you implement network automation?”

Answer:

Terminal window
# Ansible
# Network modules
# Templates
# Jinja2
# Testing
# CI/CD
# Documentation
# Auto-generated
# Version control
# Git

Q1971: How do you optimize Linux for cloud?

Section titled “Q1971: How do you optimize Linux for cloud?”

Answer:

Terminal window
# Cloud provider
# Optimized kernel
# Instance types
# Right-sized
# Storage
# EBS optimization
# Network
# ENA
# Monitoring
# CloudWatch

Q1972: How do you implement cost governance?

Section titled “Q1972: How do you implement cost governance?”

Answer:

Terminal window
# Tagging
# Mandatory
# Budgets
# Teams
# Alerts
# Thresholds
# Reporting
# Regular
# Optimization
# Action items

Q1973: How do you design for digital transformation?

Section titled “Q1973: How do you design for digital transformation?”

Answer:

Terminal window
# Assessment
# Current state
# Strategy
# Roadmap
# Implementation
# Phased
# Training
# Change management
# Measurement
# KPIs

Q1974: How do you implement security operations?

Section titled “Q1974: How do you implement security operations?”

Answer:

Terminal window
# SIEM
# Deploy
# SOAR
# Automate
# Threat intelligence
# Integrate
# Incident response
# Playbooks
# Monitoring
# 24/7

Q1975: How do you design for container registry?

Section titled “Q1975: How do you design for container registry?”

Answer:

Terminal window
# Registry
# Deploy
# Scanning
# Automatic
# Retention
# Policy
# Access control
# IAM
# Replication
# Multi-region

Answer:

Terminal window
# Catalog
# Deploy
# Metadata
# Automate
# Discovery
# Self-service
# Governance
# Policies
# Lineage
# Track

Q1977: How do you optimize Kubernetes storage?

Section titled “Q1977: How do you optimize Kubernetes storage?”

Answer:

Terminal window
# Storage classes
# Choose
# PVC
# Configure
# Snapshot
# Enable
# Backup
# Velero
# Monitoring
# Metrics

Answer:

Terminal window
# Gateway
# Deploy
# Routing
# Configure
# Authentication
# Implement
# Rate limiting
# Policy
# Monitoring
# Analytics

Q1979: How do you implement security scanning?

Section titled “Q1979: How do you implement security scanning?”

Answer:

Terminal window
# SAST
# Integrate
# DAST
# Automated
# SCA
# Dependencies
# Container
# Scanning
# Runtime
# Protection

Q1980: How do you optimize database performance?

Section titled “Q1980: How do you optimize database performance?”

Answer:

Terminal window
# Profiling
# Identify bottleneck
# Indexing
# Optimize
# Caching
# Configure
# Query
# Rewrite
# Scaling
# Plan

Q1981: How do you design for multi-region?

Section titled “Q1981: How do you design for multi-region?”

Answer:

Terminal window
# Architecture
# Multi-region
# Data replication
# Configure
# DNS
# Global
# CDN
# Deploy
# Testing
# Failover

Q1982: How do you implement observability platform?

Section titled “Q1982: How do you implement observability platform?”

Answer:

Terminal window
# Metrics
# Prometheus
# Logs
# Loki/ELK
# Traces
# Jaeger
# Dashboards
# Grafana
# Alerting
# PagerDuty

Answer:

Terminal window
# Domain ownership
# Decentralized
# Data products
# Define
# Platform
# Self-service
# Governance
# Federated
# Architecture
# Scalable

Q1984: How do you implement compliance as code?

Section titled “Q1984: How do you implement compliance as code?”

Answer:

Terminal window
# Policy
# Write
# Testing
# Validate
# Enforcement
# Gatekeeper
# Reporting
# Automated
# Audit
# Evidence

Answer:

Terminal window
# Minimal OS
# Build
# Kernel
# Strip
# Storage
# Optimize
# Network
# Configure
# Security
# Hardened

Answer:

Terminal window
# Design
# OpenAPI
# Versioning
# Strategy
# Documentation
# Auto-generate
# Mocking
# Enable
# Testing
# Contract

Q1987: How do you implement incident readiness?

Section titled “Q1987: How do you implement incident readiness?”

Answer:

Terminal window
# Runbooks
# Create
# Training
# Regular
# Tools
# Prepare
# Communication
# Templates
# Post-incident
# Review process

Q1988: How do you design for edge architecture?

Section titled “Q1988: How do you design for edge architecture?”

Answer:

Terminal window
# Compute
# Edge location
# Storage
# Local cache
# Networking
# Low latency
# Security
# Hardened
# Management
# Centralized

Q1989: How do you implement security posture?

Section titled “Q1989: How do you implement security posture?”

Answer:

Terminal window
# Assessment
# Continuous
# Hardening
# CIS benchmarks
# Monitoring
# Real-time
# Response
# Automated
# Improvement
# Action items

Answer:

Terminal window
# Shift left
# Security
# Automation
# Pipeline
# Scanning
# Integrate
# Training
# Developers
# Governance
# Policies

Q1991: How do you design for data platform?

Section titled “Q1991: How do you design for data platform?”

Answer:

Terminal window
# Ingestion
# Batch/Stream
# Processing
# Spark/Flink
# Storage
# Data Lake
# Serving
# Query engines
# Governance
# Catalog

Q1992: How do you implement cloud security?

Section titled “Q1992: How do you implement cloud security?”

Answer:

Terminal window
# Shared responsibility
# Understand
# IAM
# Least privilege
# Network
# Segmentation
# Encryption
# Enable
# Monitoring
# Configure

Q1993: How do you optimize for cost efficiency?

Section titled “Q1993: How do you optimize for cost efficiency?”

Answer:

Terminal window
# Rightsizing
# Continuous
# Reservations
# Purchase
# Spot
# Use
# Automation
# Scale down
# Cleanup
# Scheduled

Q1994: How do you design for resilience engineering?

Section titled “Q1994: How do you design for resilience engineering?”

Answer:

Terminal window
# Antifragility
# Build
# Chaos
# Test
# Graceful degradation
# Implement
# Recovery
# Automate
# Learning
# Continuous

Q1995: How do you implement DevOps metrics?

Section titled “Q1995: How do you implement DevOps metrics?”

Answer:

Terminal window
# DORA metrics
# Track
# Deployment frequency
# Measure
# Lead time
# Monitor
# MTTR
# Calculate
# Change failure rate
# Analyze

Q1996: How do you design for zero trust architecture?

Section titled “Q1996: How do you design for zero trust architecture?”

Answer:

Terminal window
# Verify explicitly
# Always
# Least privilege access
# Grant
# Assume breach
# Design
# Micro-segmentation
# Implement
# Monitor
# Continuously

Q1997: How do you implement cloud migration?

Section titled “Q1997: How do you implement cloud migration?”

Answer:

Terminal window
# Assess
# Discover
# Plan
# Strategy
# Migrate
# Execute
# Validate
# Test
# Optimize
# Post-migration

Q1998: How do you implement Kubernetes security?

Section titled “Q1998: How do you implement Kubernetes security?”

Answer:

Terminal window
# RBAC
# Configure
# Network policies
# Apply
# Pod security
# Standards
# Secrets
# External
# Scanning
# Integrate

Q1999: How do you design for data protection?

Section titled “Q1999: How do you design for data protection?”

Answer:

Terminal window
# Encryption
# At rest/transit
# Access control
# Implement
# Backup
# Automate
# Recovery
# Test
# Compliance
# Meet

Q2000: How do you implement SRE practices?

Section titled “Q2000: How do you implement SRE practices?”

Answer:

Terminal window
# Error budgets
# Define
# SLOs
# Set
# Toil
# Reduce
# Monitoring
# Implement
# Post-incident
# Review
# Automation
# Enable