Linux_Practical_Interview_1751 2000
Linux Practical Interview Questions (1751-2000)
Section titled “Linux Practical Interview Questions (1751-2000)”Linux System Administration Advanced
Section titled “Linux System Administration Advanced”Q1751: How do you configure system auditing?
Section titled “Q1751: How do you configure system auditing?”Answer:
# Install auditdapt 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 logsausearch -k passwd_changesaureport -faureport -u
# Real-time monitoringauditctl -w /etc/passwd -p wa -k passwd_changesQ1752: How do you implement system hardening?
Section titled “Q1752: How do you implement system hardening?”Answer:
# Disable unnecessary servicessystemctl mask avahi-daemonsystemctl mask cupssystemctl mask bluetooth
# Secure kernel parameters# /etc/sysctl.confkernel.dmesg_restrict=1kernel.kptr_restrict=2kernel.yama.ptrace_scope=2kernel.sysrq=0
# Disable IPv6 if not needednet.ipv6.conf.all.disable_ipv6=1net.ipv6.conf.default.disable_ipv6=1
# Disable USB storage# /etc/modprobe.d/blacklist.confinstall usb-storage /bin/true
# Set secure umask# /etc/profileumask 027
# Password policies# /etc/login.defsPASS_MIN_LEN 12PASS_MAX_DAYS 90Q1753: How do you configure system logging?
Section titled “Q1753: How do you configure system logging?”Answer:
# 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=persistentCompress=yesSystemMaxUse=500MMaxRetentionSec=30day
# Forward to syslogForwardToSyslog=yes
# View logsjournalctl -u servicejournalctl --since "1 hour ago"journalctl -p err
# Log rotation# /etc/logrotate.confdailyrotate 14compressQ1754: How do you manage system updates?
Section titled “Q1754: How do you manage system updates?”Answer:
# Debian/Ubuntuapt updateapt list --upgradableapt upgradeapt full-upgrade
# Unattended upgradesapt install unattended-upgrades# /etc/apt/apt.conf.d/50unattended-upgradesUnattended-Upgrade::Allowed-Origins { "${distro_id}:${distro_codename}-security";};
# RHEL/CentOSyum updateyum check-update
# Kernel live patching# Ubuntusnap install canonical-livepatchcanonical-livepatch enable <token>
# RHELyum install kpatchQ1755: How do you configure system backup?
Section titled “Q1755: How do you configure system backup?”Answer:
# Full system backup with tartar -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 backuptar -czpvf /backup/inc-backup-$(date +%Y%m%d).tar.gz -g /var/log/backup.snar /
# Database backupmysqldump -u root -p --all-databases > /backup/mysql-$(date +%Y%m%d).sqlpg_dumpall -U postgres > /backup/postgres-$(date +%Y%m%d).sql
# Configuration backuptar -czf /backup/configs-$(date +%Y%m%d).tar.gz /etc/
# Restorationtar -xzpvf /backup/full-backup-20240101.tar.gz -C /Linux Network Services
Section titled “Linux Network Services”Q1756: How do you configure DHCP server?
Section titled “Q1756: How do you configure DHCP server?”Answer:
# Install DHCP serverapt install isc-dhcp-server
# Configure# /etc/dhcp/dhcpd.confdefault-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 reservationhost printer { hardware ethernet 00:11:22:33:44:55; fixed-address 192.168.1.50;}
# Start servicesystemctl start isc-dhcp-serversystemctl enable isc-dhcp-serverQ1757: How do you configure DNS server?
Section titled “Q1757: How do you configure DNS server?”Answer:
# Install BIND9apt install bind9 bind9utils
# Configure named.conf.options# /etc/bind/named.conf.optionsoptions { 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.localzone "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.10www IN A 192.168.1.10Q1758: How do you configure mail server?
Section titled “Q1758: How do you configure mail server?”Answer:
# Install Postfixapt install postfix
# Configure main.cf# /etc/postfix/main.cfmyhostname = mail.example.commydomain = example.commyorigin = $mydomaininet_interfaces = allmydestination = $myhostname, localhost, localhost.localdomainhome_mailbox = Maildir/smtpd_sasl_auth_enable = yessmtpd_recipient_restrictions = permit_sasl_authenticated, reject
# Install Dovecotapt install dovecot-imapd
# Configure /etc/dovecot/conf.d/10-auth.confdisable_plaintext_auth = yesauth_mechanisms = plain login
# Configure /etc/dovecot/conf.d/10-mail.confmail_location = maildir:~/Maildir
# Create mail useruseradd -m -s /bin/bash mailuserpasswd mailuserQ1759: How do you configure proxy server?
Section titled “Q1759: How do you configure proxy server?”Answer:
# Install Squidapt install squid
# Configure# /etc/squid/squid.confhttp_port 3128cache_dir ufs /var/spool/squid 1000 16 256
# Access controlacl localnet src 192.168.0.0/16http_access allow localnethttp_access deny all
# Authentication# /etc/squid/squid.confauth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/passwordsacl authenticated proxy_auth REQUIREDhttp_access allow authenticated
# Create userhtpasswd -c /etc/squid/passwords username
# Cache rulesrefresh_pattern -i \.jpg$ 10080 90% 43200refresh_pattern -i \.html$ 1440 90% 3600
# Transparent proxyhttp_port 3128 transparentQ1760: How do you configure FTP server?
Section titled “Q1760: How do you configure FTP server?”Answer:
# Install vsftpdapt install vsftpd
# Configure# /etc/vsftpd.conflisten=YESanonymous_enable=NOlocal_enable=YESwrite_enable=YESlocal_umask=022dirmessage_enable=YESxferlog_enable=YESconnect_from_port_20=YES
# Enable SSLssl_enable=YESrsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pemrsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
# Chroot userschroot_local_user=YESallow_writeable_chroot=YES
# User listuserlist_enable=YESuserlist_file=/etc/vsftpd.userlistuserlist_deny=NO
# Start servicesystemctl start vsftpdsystemctl enable vsftpdLinux Security Advanced
Section titled “Linux Security Advanced”Q1761: How do you implement intrusion detection?
Section titled “Q1761: How do you implement intrusion detection?”Answer:
# Install AIDEapt install aide
# Configure# /etc/aide/aide.confdatabase=file:/var/lib/aide/aide.dbdatabase_out=file:/var/lib/aide/aide.db.new
# RulesFip = p+i+n+u+g+s+m+c+md5+sha256Lnx = p+u+g+i+n+S
# Files to monitor/etc Fip/bin Lnx/sbin Lnx
# Initialize databaseaideinit
# Check integrityaide --check
# Schedule checks# /etc/cron.d/aide0 5 * * * root /usr/bin/aide --check | mail -s "AIDE Report" admin@example.comQ1762: How do you configure fail2ban?
Section titled “Q1762: How do you configure fail2ban?”Answer:
# Install fail2banapt install fail2ban
# Configure# /etc/fail2ban/jail.local[DEFAULT]bantime = 3600findtime = 600maxretry = 5
[sshd]enabled = trueport = sshfilter = sshdlogpath = /var/log/auth.log
[nginx-http-auth]enabled = truefilter = nginx-http-authport = http,https
[apache2]enabled = trueport = http,https
# Custom filter# /etc/fail2ban/filter.d/custom.conf[Definition]failregex = <HOST> - .* "GET /admin
# Start servicesystemctl start fail2ban
# Check statusfail2ban-client statusfail2ban-client status sshdQ1763: How do you implement IPTables firewall?
Section titled “Q1763: How do you implement IPTables firewall?”Answer:
# Flush existing rulesiptables -Fiptables -Xiptables -t nat -Fiptables -t mangle -F
# Default policiesiptables -P INPUT DROPiptables -P FORWARD DROPiptables -P OUTPUT ACCEPT
# Loopbackiptables -A INPUT -i lo -j ACCEPT
# Established connectionsiptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# SSHiptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
# HTTP/HTTPSiptables -A INPUT -p tcp --dport 80 -j ACCEPTiptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Rate limitingiptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --setiptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP
# Save rulesiptables-save > /etc/iptables/rules.v4Q1764: How do you configure AppArmor?
Section titled “Q1764: How do you configure AppArmor?”Answer:
# Install AppArmorapt install apparmor apparmor-utils
# Check statusaa-status
# Create profileaa-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 modeaa-enforce /usr/bin/myapp
# Complain mode (testing)aa-complain /usr/bin/myapp
# Reload profileapparmor_parser -r /etc/apparmor.d/usr.bin.myappQ1765: How do you configure SELinux?
Section titled “Q1765: How do you configure SELinux?”Answer:
# Check statusgetenforcesestatus
# Set modesetenforce 1 # Enforcingsetenforce 0 # Permissive
# Configure# /etc/selinux/configSELINUX=enforcingSELINUXTYPE=targeted
# Manage contextschcon -t httpd_sys_content_t /var/www/html/index.html
# Make persistentsemanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"restorecon -Rv /web
# Boolean valuesgetsebool -asetsebool -P httpd_can_network_connect on
# Create module# myapp.temodule myapp 1.0;require { type httpd_t; }allow httpd_t self:tcp_socket { accept listen };
# Compile and installcheckmodule -M -m -o myapp.mod myapp.tesemodule_package -o myapp.pp -m myapp.modsemodule -i myapp.ppLinux Performance Tuning
Section titled “Linux Performance Tuning”Q1766: How do you tune CPU performance?
Section titled “Q1766: How do you tune CPU performance?”Answer:
# View CPU infolscpucat /proc/cpuinfo
# CPU frequency scalingcpupower frequency-infocpupower frequency-set -g performance
# Set CPU affinitytaskset -c 0-3 myapp
# Process prioritynice -n 10 myapprenice 5 -p $(pgrep myapp)
# Disable turbo boost (if needed)echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
# CFS scheduler tuning# /etc/sysctl.confkernel.sched_latency_ns = 10000000kernel.sched_min_granularity_ns = 1000000kernel.sched_wakeup_granularity_ns = 2000000Q1767: How do you tune memory performance?
Section titled “Q1767: How do you tune memory performance?”Answer:
# View memoryfree -hcat /proc/meminfo
# Swappiness# /etc/sysctl.confvm.swappiness=10vm.vfs_cache_pressure=50
# Drop cachessync && echo 3 > /proc/sys/vm/drop_caches
# Huge pages# /etc/sysctl.confvm.nr_hugepages=1024
# Memory overcommit# /etc/sysctl.confvm.overcommit_memory=1vm.overcommit_ratio=50
# Transparent huge pagesecho never > /sys/kernel/mm/transparent_hugepage/enabledecho never > /sys/kernel/mm/transparent_hugepage/defrag
# Enablesysctl -pQ1768: How do you tune I/O performance?
Section titled “Q1768: How do you tune I/O performance?”Answer:
# Check I/O schedulercat /sys/block/sda/queue/scheduler
# Set schedulerecho deadline > /sys/block/sda/queue/scheduler
# Make permanent# /etc/udev/rules.d/60-ioschedulers.rulesACTION=="add|change", KERNEL=="sda", SUBSYSTEM=="block", ATTR{queue/scheduler}="deadline"
# I/O prioritiesionice -c 2 -n 0 -p $(pgrep myapp)
# Read aheadcat /sys/block/sda/queue/read_ahead_kbecho 4096 > /sys/block/sda/queue/read_ahead_kb
# Queue depthcat /sys/block/sda/queue/nr_requestsecho 1024 > /sys/block/sda/queue/nr_requests
# Filesystem options# /etc/fstab/dev/sda1 / ext4 noatime,nodiratime,errors=remount-ro 0 1Q1769: How do you tune network performance?
Section titled “Q1769: How do you tune network performance?”Answer:
# Network buffer sizesnet.core.rmem_max=16777216net.core.wmem_max=16777216net.ipv4.tcp_rmem=4096 87380 16777216net.ipv4.tcp_wmem=4096 65536 16777216
# TCP tuningnet.ipv4.tcp_congestion_control=cubicnet.ipv4.tcp_fastopen=3net.ipv4.tcp_max_syn_backlog=8192net.ipv4.tcp_fin_timeout=15net.ipv4.tcp_keepalive_time=600net.ipv4.tcp_keepalive_intvl=60
# Enable offloadingethtool -K eth0 tso onethtool -K eth0 gso onethtool -K eth0 gro on
# Ring bufferethtool -G eth0 rx 4096 tx 4096
# Applysysctl -pQ1770: How do you use performance monitoring tools?
Section titled “Q1770: How do you use performance monitoring tools?”Answer:
# System monitoringtophtopatop
# Process monitoringpidstat -p <pid> 1ps aux --sort=-%cpu | head
# CPU monitoringmpstat -P ALL 1sar -u 1
# Memory monitoringvmstat 1sar -r 1
# I/O monitoringiostat -xz 1iotop
# Network monitoringnethogsiftopsar -n DEV 1
# Full analysisperf record -g ./myappperf report
# System resource usagess -snetstat -sLinux Container Management
Section titled “Linux Container Management”Q1771: How do you configure Docker networking?
Section titled “Q1771: How do you configure Docker networking?”Answer:
# Create custom networkdocker network create --driver bridge mynetworkdocker network create --driver overlay myoverlay
# Network inspectiondocker network inspect bridge
# Connect containerdocker network connect mynetwork container
# Port mappingdocker run -d -p 8080:80 nginx
# Host networkdocker run --network host nginx
# DNS configurationdocker run --dns 8.8.8.8 nginxdocker run --network-alias db mysql
# Macvlandocker network create -d macvlan \ --subnet=192.168.1.0/24 \ --gateway=192.168.1.1 \ -o parent=eth0 mymacvlanQ1772: How do you manage Docker volumes?
Section titled “Q1772: How do you manage Docker volumes?”Answer:
# Create volumedocker volume create mydata
# Mount volumedocker run -v mydata:/data mysql
# Bind mountdocker run -v /host/path:/container/path nginx
# tmpfs mountdocker run --tmpfs /tmp nginx
# List volumesdocker volume ls
# Inspect volumedocker volume inspect mydata
# Remove unused volumesdocker volume prune
# Backup volumedocker run --rm -v mydata:/data -v $(pwd):/backup alpine \ tar cvf /backup/backup.tar /dataQ1773: How do you configure Docker Compose?
Section titled “Q1773: How do you configure Docker Compose?”Answer:
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:
# Run as non-rootdocker run -u 1000:1000 nginx
# Read-only filesystemdocker run --read-only nginx
# Limit capabilitiesdocker run --cap-drop ALL --cap-add NET_BIND_SERVICE nginx
# Disable networkingdocker run --network none nginx
# Resource limitsdocker run --memory=256m --cpus=0.5 nginx
# Selinux/AppArmordocker run --security-opt seccomp:default nginx
# Scan imagestrivy image nginxdocker scan nginx
# Best practices# Use specific versions# Don't store secrets in images# Multi-stage builds# Minimal base imagesQ1775: How do you configure Kubernetes networking?
Section titled “Q1775: How do you configure Kubernetes networking?”Answer:
# ServiceapiVersion: v1kind: Servicemetadata: name: myappspec: selector: app: myapp ports: - port: 80 targetPort: 8080 type: ClusterIP
---# IngressapiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: myappspec: rules: - host: myapp.example.com http: paths: - path: / pathType: Prefix backend: service: name: myapp port: number: 80
---# NetworkPolicyapiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata: name: default-denyspec: podSelector: {} policyTypes: - Ingress - EgressLinux Virtualization
Section titled “Linux Virtualization”Q1776: How do you configure KVM?
Section titled “Q1776: How do you configure KVM?”Answer:
# Install KVMapt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
# Verifykvm-ok
# Create VMvirt-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 VMsvirsh list --allvirsh start webservervirsh shutdown webservervirsh reboot webservervirsh undefine webserver
# Manage storage poolsvirsh pool-listvirsh pool-info defaultQ1777: How do you configure libvirt?
Section titled “Q1777: How do you configure libvirt?”Answer:
# Connect to libvirtvirsh --connect qemu:///system
# Create networkvirsh net-define /tmp/network.xmlvirsh net-start mynetworkvirsh net-autostart mynetwork
# Create storage poolvirsh pool-define-as default dir --target /var/lib/libvirt/imagesvirsh pool-build defaultvirsh pool-start default
# Create snapshotvirsh snapshot-create-as webserver --name "before-update"virsh snapshot-list webservervirsh snapshot-revert webserver before-update
# Migrate VMvirsh migrate --live webserver qemu+ssh://dest-host/system
# Clone VMvirt-clone --original webserver --name webserver2 --auto-cloneQ1778: How do you configure LXC?
Section titled “Q1778: How do you configure LXC?”Answer:
# Install LXCapt install lxc
# Create containerlxc-create -n mycontainer -t ubuntu
# Start containerlxc-start -n mycontainerlxc-attach -n mycontainer
# Configuration# /var/lib/lxc/mycontainer/configlxc.include = /usr/share/lxc/config/ubuntu.common.conflxc.uts.name = mycontainerlxc.network.type = vethlxc.network.link = lxcbr0
# Clone containerlxc-copy -n mycontainer -N mycontainer2
# Snapshotlxc-snapshot -n mycontainer
# Managelxc-ls -flxc-info -n mycontainerlxc-stop -n mycontainerlxc-destroy -n mycontainerQ1779: How do you configure NFS?
Section titled “Q1779: How do you configure NFS?”Answer:
# Install serverapt 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)
# Exportexportfs -a
# Install clientapt install nfs-common
# Mountmount -t nfs server:/data /mnt/data
# Auto mount# /etc/fstabserver:/data /mnt/data nfs defaults,_netdev 0 0
# Verifyshowmount -e servermount | grep nfsQ1780: How do you configure CIFS?
Section titled “Q1780: How do you configure CIFS?”Answer:
# Install clientapt install cifs-utils
# Mount manuallymount -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/.smbcredentialsusername=smbuserpassword=passworddomain=WORKGROUP
# Secure credentialschmod 600 /root/.smbcredentials
# Testsmbclient -L //server -U usernameLinux Cloud Integration
Section titled “Linux Cloud Integration”Q1781: How do you configure AWS CLI?
Section titled “Q1781: How do you configure AWS CLI?”Answer:
# Install AWS CLIapt install awscli
# Configureaws configure# AWS Access Key ID: ***# AWS Secret Access Key: ***# Region: us-east-1# Output format: json
# S3 commandsaws s3 lsaws s3 mb s3://mybucketaws s3 cp file.txt s3://mybucket/aws s3 sync ./folder s3://mybucket/folder
# EC2 commandsaws ec2 describe-instancesaws ec2 start-instances --instance-ids i-xxxaws ec2 stop-instances --instance-ids i-xxx
# IAMaws iam list-usersaws iam create-user --user-name myuser
# Get instance metadatacurl http://169.254.169.254/latest/meta-data/curl http://169.254.169.254/latest/user-data/Q1782: How do you configure cloud-init?
Section titled “Q1782: How do you configure cloud-init?”Answer:
#cloud-configpackage_update: truepackages: - 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 diskmounts: - [ /dev/sdb, /data, "ext4", "defaults,nofail", "0", "2" ]Q1783: How do you use Packer?
Section titled “Q1783: How do you use Packer?”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 imagepacker build template.json
# Validatepacker validate template.jsonQ1784: How do you use Terraform?
Section titled “Q1784: How do you use Terraform?”Answer:
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"] }}
# Commandsterraform initterraform planterraform applyterraform destroyterraform showQ1785: How do you configure Kubernetes?
Section titled “Q1785: How do you configure Kubernetes?”Answer:
# Install kubectlcurl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"chmod +x kubectlsudo mv kubectl /usr/local/bin/
# Configuremkdir -p ~/.kubecp /path/to/admin.conf ~/.kube/config
# Create deploymentkubectl create deployment nginx --image=nginx
# Scale deploymentkubectl scale deployment nginx --replicas=3
# Expose servicekubectl expose deployment nginx --port=80 --type=LoadBalancer
# View resourceskubectl get pods,svc,deploymentskubectl describe pod nginxkubectl logs nginx
# Apply configurationkubectl apply -f deployment.yamlkubectl delete -f deployment.yamlLinux Automation
Section titled “Linux Automation”Q1786: How do you use Ansible?
Section titled “Q1786: How do you use Ansible?”Answer:
- 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: restartedQ1787: How do you use Vagrant?
Section titled “Q1787: How do you use Vagrant?”Answer:
# VagrantfileVagrant.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 SHELLend
# Commandsvagrant upvagrant sshvagrant haltvagrant destroyvagrant provisionQ1788: How do you use Chef?
Section titled “Q1788: How do you use Chef?”Answer:
package 'httpd' do action :installend
service 'httpd' do action [:enable, :start]end
template '/var/www/html/index.html' do source 'index.html.erb' mode '0644'end
# Run chefchef-client --local-mode recipe.rb
# Bootstrapknife solo bootstrap user@serverQ1789: How do you use Puppet?
Section titled “Q1789: How do you use Puppet?”Answer:
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'], }}
# Runpuppet apply manifests/site.ppQ1790: How do you use Salt?
Section titled “Q1790: How do you use Salt?”Answer:
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
# Runsalt '*' state.apply webserversalt '*' pkg.install nginxsalt '*' service.restart apache2Linux Troubleshooting
Section titled “Linux Troubleshooting”Q1791: How do you debug system issues?
Section titled “Q1791: How do you debug system issues?”Answer:
# System informationuname -acat /etc/os-releaselsb_release -a
# Hardware infolshwlspcilsblk
# System logsdmesg | tailjournalctl -xetail -f /var/log/syslog
# Process statusps auxftophtop
# Resource usagedf -hfree -hvmstat 1iostat -xz 1
# Network statusip addrip routenetstat -tulpnss -tulpn
# Service statussystemctl status servicesystemctl list-failedQ1792: How do you debug network issues?
Section titled “Q1792: How do you debug network issues?”Answer:
# Interface statusip linkip addrethtool eth0
# Routingip routeip route get 8.8.8.8ip neighbor show
# DNSdig example.comgetent hosts example.comcat /etc/resolv.conf
# Connectivityping -c 4 8.8.8.8traceroute 8.8.8.8mtr -n 8.8.8.8
# Portsnc -zv host porttelnet host port
# Capturetcpdump -i eth0 host 192.168.1.1tcpdump -i eth0 port 80
# Firewalliptables -L -n -vfirewall-cmd --list-allQ1793: How do you debug disk issues?
Section titled “Q1793: How do you debug disk issues?”Answer:
# Disk usagedf -hdf -idu -sh /*
# Find large filesfind / -type f -size +100M -exec ls -lh {} \; 2>/dev/null | sort -k5 -h
# I/O statsiostat -xz 1sar -d 1
# Mount statusmountcat /proc/mounts
# Filesystem checkfsck -n /dev/sda1
# SMART statussmartctl -a /dev/sda
# LVM statuslvspvsvgs
# Deleted fileslsof +L1Q1794: How do you debug service failures?
Section titled “Q1794: How do you debug service failures?”Answer:
# Service statussystemctl status servicesystemctl list-units --failed
# Service logsjournalctl -u service -n 50journalctl -u service --since "1 hour ago"journalctl -xe
# Process infops auxf | grep servicelsof -p $(pgrep -f service)
# Configuration testnginx -tapache2ctl configtestmysqladmin ping
# Dependenciessystemctl list-dependencies servicesystemctl is-active service
# Stracestrace -f -p $(pgrep -f service)strace -c service
# Limitscat /proc/$(pgrep -f service)/limitsQ1795: How do you debug performance issues?
Section titled “Q1795: How do you debug performance issues?”Answer:
# CPUtophtopmpstat -P ALL 1
# Memoryfree -hvmstat 1
# I/Oiostat -xz 1iotop
# Networknethogsiftop
# System-widesar -A 1 5
# Processperf topperf record -g -p <pid>perf report
# Flame graphgit clone https://github.com/brendangregg/FlameGraph.gitperf record -F 99 -g -p <pid>perf script | ./stackcollapse-perf.pl | ./flamegraph.pl > flame.svgLinux Backup and Recovery
Section titled “Linux Backup and Recovery”Q1796: How do you configure automated backups?
Section titled “Q1796: How do you configure automated backups?”Answer:
#!/bin/bashset -euo pipefail
BACKUP_DIR="/backup"DATE=$(date +%Y%m%d)RETENTION_DAYS=30
# Create backup directorymkdir -p $BACKUP_DIR/{mysql,files,configs}
# Database backupmysqldump -u root -p --all-databases | gzip > $BACKUP_DIR/mysql/all-$DATE.sql.gz
# Files backuptar -czf $BACKUP_DIR/files/files-$DATE.tar.gz /var/www/html/ --exclude='*.log'
# Configs backuptar -czf $BACKUP_DIR/configs/configs-$DATE.tar.gz /etc/
# Clean old backupsfind $BACKUP_DIR -type f -mtime +$RETENTION_DAYS -delete
# Reportecho "Backup completed at $(date)"Q1797: How do you test backup restoration?
Section titled “Q1797: How do you test backup restoration?”Answer:
# Test backup file integritygzip -t backup.tar.gzsha256sum backup.tar.gz
# Test database restorationmysql -u root -p -e "DROP DATABASE IF EXISTS test_restore;"mysql -u root -p test_restore < backup.sqlmysql -u root -p -e "SHOW TABLES;" test_restore
# Test file restorationmkdir /tmp/test_restoretar -xzf backup.tar.gz -C /tmp/test_restorels -la /tmp/test_restore/
# Test in VMvagrant up testvagrant ssh test -c "mysql -u root -p mydb < /vagrant/backup.sql"vagrant ssh test -c "ls /var/www/html/"vagrant destroy testQ1798: How do you implement disaster recovery?
Section titled “Q1798: How do you implement disaster recovery?”Answer:
# 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 recoverysystemctl stop myappgunzip < backup.sql | mysql -u root -p mydb
# File recoverytar -xzf configs.tar.gz -C /
# Verificationsystemctl start myappcurl http://localhost/healthQ1799: 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 Sundayif [ $(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
# Retentionfind $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.gzQ1800: 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 compressionrsync -avz --delete \ -e "ssh -i /root/.ssh/backup_key" \ --exclude='*.tmp' \ $SOURCE/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/
# Verifyrsync -avzn -e "ssh" $SOURCE/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/
# Daily incremental with link-destrsync -avz --delete \ -e "ssh" \ --link-dest=$REMOTE_DIR/previous \ $SOURCE/ $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/currentLinux High Availability
Section titled “Linux High Availability”Q1801: How do you configure Keepalived?
Section titled “Q1801: How do you configure Keepalived?”Answer:
# Installapt install keepalived
# Configure# /etc/keepalived/keepalived.confvrrp_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 90Q1802: How do you configure HAProxy?
Section titled “Q1802: How do you configure HAProxy?”Answer:
# Installapt install haproxy
# Configure# /etc/haproxy/haproxy.cfgglobal 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 2Q1803: How do you configure Corosync?
Section titled “Q1803: How do you configure Corosync?”Answer:
# Installapt install pacemaker corosync pcs
# Configure corosync# /etc/corosync/corosync.conftotem { 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 clusterpcs host auth node1 node2pcs cluster setup mycluster node1 node2pcs cluster start --allpcs cluster enable --allQ1804: How do you configure Pacemaker?
Section titled “Q1804: How do you configure Pacemaker?”Answer:
# Create resourcepcs 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
# Constraintspcs constraint colocation add WebService VirtualIP INFINITYpcs constraint order VirtualIP then WebService
# Stickinesspcs resource meta WebService resource-stickiness=100
# Failoverpcs constraint location WebService prefers node1=50
# View statuspcs statuspcs resource showQ1805: How do you configure DRBD?
Section titled “Q1805: How do you configure DRBD?”Answer:
# Installapt install drbd-utils
# Configure# /etc/drbd.d/web.resresource 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; }}
# Initializedrbdadm create-md webdrbdadm up web
# Primarydrbdadm primary --force web
# Filesystemmkfs.xfs /dev/drbd0mount /dev/drbd0 /var/www
# Statuscat /proc/drbdLinux Scripting Advanced
Section titled “Linux Scripting Advanced”Q1806: How do you write efficient bash scripts?
Section titled “Q1806: How do you write efficient bash scripts?”Answer:
#!/bin/bashset -euo pipefailIFS=$'\n\t'
# Use functionslog() { echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*"}
# Use arraysfiles=("file1" "file2" "file3")for file in "${files[@]}"; do [[ -f "$file" ]] || continue process "$file"done
# Process efficientlywhile IFS= read -r line; do ((count++))done < <(grep -r "pattern" .)
# Parallel processingparallel -j 4 process {} ::: *.logQ1807: How do you parse JSON in bash?
Section titled “Q1807: How do you parse JSON in bash?”Answer:
# Using jqcat data.json | jq '.name'cat data.json | jq '.items[].value'cat data.json | jq '.items[] | select(.id > 5)'
# Create JSONjq -n '{name: "test", items: [1,2,3]}'
# Modifyjq '.name = "new"' data.json
# Filterjq '.items[] | select(.age > 25)' data.jsonQ1808: How do you use awk?
Section titled “Q1808: How do you use awk?”Answer:
# Basicawk '{print $1}' file.txt
# Field separatorawk -F: '{print $1, $6}' /etc/passwd
# Conditionalawk '$3 > 1000 {print $1, $3}' /etc/passwd
# Calculationsawk '{sum+=$1} END {print sum}' numbers.txt
# Patternsawk '/ERROR/ {print}' logfile
# Multiple fieldsawk '{for(i=1;i<=NF;i++) sum[i]+=$i} END {for(i in sum) print i, sum[i]}' file.txtQ1809: How do you use sed?
Section titled “Q1809: How do you use sed?”Answer:
# Replacesed 's/old/new/' file.txtsed 's/old/new/g' file.txtsed -i 's/old/new/g' file.txt
# Delete linessed '/pattern/d' file.txtsed '1,5d' file.txt
# Insertsed '1i\Header' file.txt
# Regexsed -E 's/[0-9]{4}/[REDACTED]/g' file.txt
# In-place with backupsed -i.bak 's/old/new/g' file.txtQ1810: How do you write Python scripts?
Section titled “Q1810: How do you write Python scripts?”Answer:
#!/usr/bin/env python3import subprocessimport jsonimport 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())Linux Security Advanced
Section titled “Linux Security Advanced”Q1811: How do you implement user authentication?
Section titled “Q1811: How do you implement user authentication?”Answer:
# PAM configurationauth required pam_tally2.so deny=3 unlock_time=600
# Password policy# /etc/pam.d/common-passwordpassword required pam_pwhistory.so remember=5password requisite pam_cracklib.so try_first_pass retry=3 minlen=12
# Account expiry# /etc/login.defsPASS_MAX_DAYS 90PASS_MIN_DAYS 1PASS_WARN_AGE 14
# User expirypasswd -x 90 -w 14 -n 1 usernameQ1821: How do you implement system monitoring?
Section titled “Q1821: How do you implement system monitoring?”Answer:
# Prometheus + node_exporter# Installapt install prometheus-node-exporter
# Configure# /etc/default/prometheusARGS="--collector.interval=30s"
# Start servicesystemctl start prometheus-node-exportersystemctl enable prometheus-node-exporter
# Metricscurl http://localhost:9100/metricsQ1822: How do you configure Grafana?
Section titled “Q1822: How do you configure Grafana?”Answer:
# Installapt 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_bytesQ1823: How do you use ELK stack?
Section titled “Q1823: How do you use ELK stack?”Answer:
# Install Elasticsearchapt install elasticsearch
# Configure# /etc/elasticsearch/elasticsearch.ymlcluster.name: myclusternetwork.host: 0.0.0.0
# Install Kibanaapt install kibana# /etc/kibana/kibana.yml# server.host: "0.0.0.0"
# Install Logstashapt install logstash
# Configure Filebeatapt install filebeat# /etc/filebeat/filebeat.ymlfilebeat.inputs: - type: log paths: - /var/log/*.logoutput.logstash: hosts: ["localhost:5044"]Q1824: How do you configure Nagios?
Section titled “Q1824: How do you configure Nagios?”Answer:
# Installapt install nagios4
# Create check script# /usr/local/nagios/lib/check_disk.sh#!/bin/bashUSAGE=$(df -h / | tail -1 | awk '{print $5}' | sed 's/%//')if [ "$USAGE" -gt 90 ]; then echo "CRITICAL - Disk usage is ${USAGE}%" exit 2fiecho "OK - Disk usage is ${USAGE}%"exit 0
# Configure service# /etc/nagios4/conf.d/services.cfgdefine service{ host_name localhost service_description Disk Usage check_command check_disk}Q1825: How do you configure Zabbix?
Section titled “Q1825: How do you configure Zabbix?”Answer:
# Install Zabbix serverapt install zabbix-server-mysql zabbix-frontend-php
# Configure databasemysql -u root -pCREATE 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 schemazcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -u zabbix -p zabbix
# Configure Zabbix# /etc/zabbix/zabbix_server.confDBPassword=password
# Start servicessystemctl start zabbix-serversystemctl start apache2Linux Expert Topics
Section titled “Linux Expert Topics”Q1826: How do you implement zero trust security?
Section titled “Q1826: How do you implement zero trust security?”Answer:
# Network policies (Kubernetes)kubectl apply -f - <<EOFapiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata: name: default-denyspec: podSelector: {} policyTypes: - Ingress - EgressEOF
# iptables zero trustiptables -P INPUT DROPiptables -P FORWARD DROPiptables -P OUTPUT ACCEPTiptables -A INPUT -i lo -j ACCEPTiptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# mTLS# Use service mesh (Istio) for automatic mTLSQ1827: How do you implement chaos engineering?
Section titled “Q1827: How do you implement chaos engineering?”Answer:
# Install Chaos Meshhelm repo add chaos-mesh https://charts.chaos-mesh.orghelm install chaos-mesh chaos-mesh/chaos-mesh -n chaos-mesh --create-namespace
# Create experimentapiVersion: chaos-mesh.org/v1alpha1kind: PodChaosmetadata: name: pod-failurespec: action: pod-failure mode: one duration: 60s selector: namespaces: - default
# Applykubectl apply -f experiment.yamlQ1828: How do you implement GitOps?
Section titled “Q1828: How do you implement GitOps?”Answer:
# Install ArgoCDkubectl create namespace argocdkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Create applicationkubectl apply -f - <<EOFapiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: myapp namespace: argocdspec: 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: trueEOFQ1829: How do you implement service mesh?
Section titled “Q1829: How do you implement service mesh?”Answer:
# Install Istiocurl -L https://istio.io/downloadIstio | sh -istioctl install --set profile=demo
# Enable injectionkubectl label namespace default istio-injection=enabled
# Deploy applicationkubectl apply -f app.yaml
# Configure mTLSkubectl apply -f - <<EOFapiVersion: security.istio.io/v1beta1kind: PeerAuthenticationmetadata: name: defaultspec: mtls: mode: STRICTEOF
# Configure trafficapiVersion: networking.istio.io/v1beta1kind: VirtualServicemetadata: name: myappspec: hosts: - myapp http: - route: - destination: host: myapp subset: v1 weight: 90 - destination: host: myapp subset: v2 weight: 10Q1830: How do you implement edge computing?
Section titled “Q1830: How do you implement edge computing?”Answer:
# Install K3scurl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--write-kubeconfig-mode 644" sh -
# Install KubeEdge# Cloud nodehelm install cloudcore kubeedge/cloudcore --namespace kubeedge
# Edge nodewget https://github.com/kubeedge/kubeedge/releases/download/v1.12.0/kubeedge_1.12.0_linux_amd64.tar.gztar -xzf kubeedge_1.12.0_linux_amd64.tar.gzedgecore --config=/etc/kubeedge/config/edgecore.yaml
# Deploy to edgekubectl apply -f deployment.yamlQ1831: How do you implement supply chain security?
Section titled “Q1831: How do you implement supply chain security?”Answer:
# Dependency scanning# Snyknpm install -g snyksnyk test
# Trivy for containerstrivy image myimage:latesttrivy image --severity HIGH,CRITICAL myimage:latest
# SBOM generation# Syftsyft myimage:latest
# Cosign for signingcosign sign myimage:latestcosign verify myimage:latest
# GitHub Dependabot# Enable in repo settings# .github/dependabot.ymlversion: 2updates: - package-ecosystem: "npm" directory: "/"Q1832: How do you implement cost optimization?
Section titled “Q1832: How do you implement cost optimization?”Answer:
# Right-sizing# AWSaws 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 Glacieraws s3api put-bucket-lifecycle-configuration --bucket mybucket \ --lifecycle-configuration file://lifecycle.json
# Budget alertsaws budgets create-budget \ --account-id 123456789012 \ --budget file://budget.jsonQ1833: How do you implement compliance automation?
Section titled “Q1833: How do you implement compliance automation?”Answer:
# OPA Gatekeeper# Installkubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/allownswidgetpolicies/template.yaml
# Policy exampleapiVersion: constraints.gatekeeper.sh/v1beta1kind: K8sRequiredLabelsmetadata: name: require-labelsspec: 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:
# Data classification# Public, Internal, Confidential, Restricted
# Encryption at rest# LUKScryptsetup 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 accessQ1835: How do you implement FinOps?
Section titled “Q1835: How do you implement FinOps?”Answer:
# 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 storageLinux Interview Scenarios
Section titled “Linux Interview Scenarios”Q1836: How do you handle a production outage?
Section titled “Q1836: How do you handle a production outage?”Answer:
# 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 itemsQ1837: How do you troubleshoot slow database queries?
Section titled “Q1837: How do you troubleshoot slow database queries?”Answer:
# 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 horizontallyQ1838: How do you design a backup strategy?
Section titled “Q1838: How do you design a backup strategy?”Answer:
# 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 testsQ1839: How do you secure a Linux server?
Section titled “Q1839: How do you secure a Linux server?”Answer:
# 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 everywhereQ1840: How do you design a monitoring system?
Section titled “Q1840: How do you design a monitoring system?”Answer:
# 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 runbooksQ1841: How do you optimize Linux performance?
Section titled “Q1841: How do you optimize Linux performance?”Answer:
# 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 parametersQ1842: How do you implement disaster recovery?
Section titled “Q1842: How do you implement disaster recovery?”Answer:
# 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 listQ1843: How do you implement zero-downtime deployment?
Section titled “Q1843: How do you implement zero-downtime deployment?”Answer:
# Strategies# 1. Rolling updatekubectl 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 deploymentQ1844: How do you handle capacity planning?
Section titled “Q1844: How do you handle capacity planning?”Answer:
# Current state# Measure utilizationsar -u 1sar -r 1sar -d 1
# Trends# Analyze growth rate
# Forecasting# Predict future needs
# Planning# Add capacity proactively
# Optimization# Right-size resources# Use automationQ1845: How do you implement compliance?
Section titled “Q1845: How do you implement compliance?”Answer:
# 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 testsQ1846: How do you design for scale?
Section titled “Q1846: How do you design for scale?”Answer:
# 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 detectionQ1847: How do you implement observability?
Section titled “Q1847: How do you implement observability?”Answer:
# 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 analysisQ1848: How do you secure containers?
Section titled “Q1848: How do you secure containers?”Answer:
# 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 managerQ1849: How do you implement infrastructure as code?
Section titled “Q1849: How do you implement infrastructure as code?”Answer:
# Version control# Git
# Modules# Reusable components
# State management# Remote state# State locking
# Testing# Validate# Plan
# CI/CD# Automated deployment
# Drift detection# Detect changesQ1850: How do you manage secrets in CI/CD?
Section titled “Q1850: How do you manage secrets in CI/CD?”Answer:
# 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 accessQ1851: How do you design a secure network?
Section titled “Q1851: How do you design a secure network?”Answer:
# Segmentation# DMZ# Internal# Database
# Firewall# Whitelist approach# Default deny
# Encryption# TLS everywhere# VPN for access
# Monitoring# IDS/IPS# NetFlow
# DDoS protection# CDN# WAF# Rate limitingQ1852: How do you handle database failover?
Section titled “Q1852: How do you handle database failover?”Answer:
# Automatic detection# Health checks
# Failover process# Promote replica# Update DNS
# Application handling# Connection retry# Circuit breakers
# Monitoring# Alert on failover
# Testing# Regular drillsQ1853: How do you implement caching?
Section titled “Q1853: How do you implement caching?”Answer:
# CDN# Static assets
# Application cache# Redis# Memcached
# Database cache# Query cache# Buffer pool
# Browser cache# Headers
# Invalidation# TTL# Cache busting# PatternsQ1854: How do you design for high availability?
Section titled “Q1854: How do you design for high availability?”Answer:
# Redundancy# Multiple AZs# Multiple regions
# Load balancing# Health checks# Failover
# Data replication# Synchronous# Asynchronous
# Monitoring# Fast detection
# Automation# Self-healing
# Testing# Chaos engineeringQ1855: How do you secure Kubernetes?
Section titled “Q1855: How do you secure Kubernetes?”Answer:
# RBAC# Least privilege
# Network policies# Default deny
# Pod security# Standards
# Secrets# External
# Images# Scanning
# Runtime# Falco
# Updates# RegularQ1856: How do you design API security?
Section titled “Q1856: How do you design API security?”Answer:
# Authentication# OAuth 2.0# JWT
# Authorization# RBAC# Scopes
# Rate limiting# Throttling
# Input validation# Sanitization
# TLS# Encryption
# Monitoring# Anomaly detectionQ1857: How do you implement logging?
Section titled “Q1857: How do you implement logging?”Answer:
# Format# JSON# Structured
# Levels# DEBUG, INFO, WARN, ERROR
# Correlation# Trace IDs
# Rotation# Logrotate
# Aggregation# ELK/Loki
# Retention# PolicyQ1858: How do you design for security?
Section titled “Q1858: How do you design for security?”Answer:
# Defense in depth# Multiple layers
# Least privilege# Minimize access
# Zero trust# Verify always
# Encryption# Everywhere
# Monitoring# Continuous
# Automation# Respond fastQ1859: How do you implement incident response?
Section titled “Q1859: How do you implement incident response?”Answer:
# Preparation# Runbooks# Tools
# Detection# Alerts
# Containment# Isolate
# Eradication# Fix
# Recovery# Restore
# Lessons learned# Post-mortemQ1860: How do you optimize cloud costs?
Section titled “Q1860: How do you optimize cloud costs?”Answer:
# Right-sizing# Match needs
# Reservations# Steady state
# Spot# Fault-tolerant
# Automation# Scale down
# Cleanup# Unused resources
# Monitoring# AlertsQ1861: How do you implement change automation?
Section titled “Q1861: How do you implement change automation?”Answer:
# GitOps# All changes in Git
# CI/CD# Automated testing
# Approval gates# Manual steps
# Rollback# Automatic
# Monitoring# Quick detectionQ1862: How do you design for failure?
Section titled “Q1862: How do you design for failure?”Answer:
# Redundancy# Multiple copies
# Graceful degradation# Partial service
# Circuit breakers# Prevent cascade
# Bulkheads# Isolate
# Recovery# Fast
# Testing# ChaosQ1863: How do you implement access control?
Section titled “Q1863: How do you implement access control?”Answer:
# Authentication# MFA
# Authorization# RBAC
# Least privilege# Minimal access
# Audit# Log access
# Review# RegularQ1864: How do you secure data?
Section titled “Q1864: How do you secure data?”Answer:
# Classification# Sensitivity
# Encryption# At rest# In transit
# Access control# Need to know
# Backup# Encrypted
# Monitoring# AuditQ1865: How do you design APIs?
Section titled “Q1865: How do you design APIs?”Answer:
# REST# Resources# HTTP verbs
# Versioning# URL path
# Error handling# Consistent
# Pagination# Large sets
# Rate limiting# Throttle
# Documentation# OpenAPIQ1866: How do you implement service mesh?
Section titled “Q1866: How do you implement service mesh?”Answer:
# Traffic management# Routing
# Security# mTLS
# Observability# Tracing
# Resilience# Retries
# Tools# Istio# Linkerd# Consul ConnectQ1867: How do you optimize databases?
Section titled “Q1867: How do you optimize databases?”Answer:
# Indexing# Proper indexes
# Query optimization# EXPLAIN
# Caching# Use cache
# Connection pooling# Pool
# Scaling# Read replicas# Sharding
# Configuration# Tune parametersQ1868: How do you implement secrets management?
Section titled “Q1868: How do you implement secrets management?”Answer:
# Centralized# Vault
# Rotation# Auto
# Audit# Log access
# Encryption# Encrypt
# Access control# Least privilegeQ1869: How do you design for disasters?
Section titled “Q1869: How do you design for disasters?”Answer:
# Backup# Regular
# Replication# Cross-region
# Automation# Fast recovery
# Testing# Regular
# Documentation# RunbooksQ1870: How do you implement observability?
Section titled “Q1870: How do you implement observability?”Answer:
# Metrics# Prometheus
# Logs# ELK
# Traces# Jaeger
# Correlation# Trace IDs
# Alerting# SLO-basedQ1871: How do you handle kernel upgrades?
Section titled “Q1871: How do you handle kernel upgrades?”Answer:
# Test in staging# Check compatibility# Backup# Schedule window# Apply# Monitor# Rollback planQ1872: How do you design multi-tenant systems?
Section titled “Q1872: How do you design multi-tenant systems?”Answer:
# Isolation# Namespaces# RBAC
# Quotas# Resources
# Billing# Usage tracking
# Data separation# Logical/physical
# Network# SegmentationQ1873: How do you implement edge computing?
Section titled “Q1873: How do you implement edge computing?”Answer:
# Lightweight K8s# K3s
# Data processing# Local first
# Sync# Periodic
# Security# Edge-specific
# Management# CentralizedQ1874: How do you optimize Linux for containers?
Section titled “Q1874: How do you optimize Linux for containers?”Answer:
# OS# Minimal OS
# Kernel# Tuned for containers
# Storage# Overlay2
# Network# CNI
# Runtime# containerd
# Security# HardenedQ1875: How do you design for GDPR?
Section titled “Q1875: How do you design for GDPR?”Answer:
# Data minimization# Collect less
# Consent# Explicit
# Right to erasure# Delete capability
# Portability# Export data
# Breach notification# Process
# DPO# AppointQ1876: How do you implement zero-downtime patching?
Section titled “Q1876: How do you implement zero-downtime patching?”Answer:
# Blue-green# Two environments
# Canary# Gradual
# Rolling# One by one
# Health checks# Before switch
# Rollback# QuickQ1877: How do you design for IoT?
Section titled “Q1877: How do you design for IoT?”Answer:
# Edge# Local processing
# Protocol# MQTT
# Security# Device auth
# Scale# Millions
# OTA updates# SecureQ1878: How do you implement RBAC?
Section titled “Q1878: How do you implement RBAC?”Answer:
# Roles# Define
# Permissions# Map
# Assignment# Users
# Audit# Regular review
# Tools# LDAP integrationQ1879: How do you optimize network performance?
Section titled “Q1879: How do you optimize network performance?”Answer:
# Offloading# Hardware
# Buffer tuning# TCP
# Compression# Accept encoding
# CDN# Static
# Keepalive# HTTPQ1880: How do you design for mobile?
Section titled “Q1880: How do you design for mobile?”Answer:
# API design# Efficient
# Compression# gz/brotli
# Caching# Aggressive
# Offline# PWA
# Security# Certificate pinningQ1881: How do you implement chaos engineering?
Section titled “Q1881: How do you implement chaos engineering?”Answer:
# Define steady state# What works
# Hypothesize# What will fail
# Experiment# Inject failure
# Learn# Observe
# Improve# Fix
# Tools# Chaos Mesh# Litmus# GremlinQ1882: How do you implement immutable infrastructure?
Section titled “Q1882: How do you implement immutable infrastructure?”Answer:
# Images# Pre-built
# No changes# Rebuild
# Versioned# All
# Rollback# Previous image
# Tools# Packer# ContainerQ1883: How do you design for high performance?
Section titled “Q1883: How do you design for high performance?”Answer:
# Profiling# Find bottleneck
# Optimization# Targeted
# Caching# Multi-layer
# Async# Non-blocking
# Scaling# HorizontalQ1884: How do you implement multi-cloud?
Section titled “Q1884: How do you implement multi-cloud?”Answer:
# Abstraction# Terraform
# Portability# Container
# Vendor lock-in# Avoid
# Data# Strategy
# Operations# UnifiedQ1885: How do you implement cost allocation?
Section titled “Q1885: How do you implement cost allocation?”Answer:
# Tagging# All resources
# Tracking# By team/project
# Reporting# Regular
# Budgets# Alerts
# Showback# ChargebackQ1886: How do you implement compliance automation?
Section titled “Q1886: How do you implement compliance automation?”Answer:
# Policy as code# OPA
# Scanning# Automated
# Evidence# Auto-collect
# Remediation# Auto-fix
# Audit# RegularQ1887: How do you implement API rate limiting?
Section titled “Q1887: How do you implement API rate limiting?”Answer:
# Token bucket# Leaky bucket
# Per-user# By key
# Headers# Rate limit
# Response# 429
# Throttling# GracefulQ1888: How do you design for IoT security?
Section titled “Q1888: How do you design for IoT security?”Answer:
# Device identity# Certificates
# OTA updates# Signed
# Network# Segmentation
# Data# Encryption
# Monitoring# AnomalyQ1889: How do you implement infrastructure monitoring?
Section titled “Q1889: How do you implement infrastructure monitoring?”Answer:
# Metrics# Collect
# Storage# Time-series
# Visualization# Dashboards
# Alerting# Thresholds
# Analysis# TrendsQ1890: How do you implement database sharding?
Section titled “Q1890: How do you implement database sharding?”Answer:
# Key strategy# Choose shard key
# Routing# Application
# Rebalancing# Plan
# Cross-shard# Minimize
# Monitoring# PerformanceQ1891: How do you design for 5G?
Section titled “Q1891: How do you design for 5G?”Answer:
# Edge computing# Local processing
# Network slicing# Dedicated
# Low latency# Optimization
# Massive IoT# ScaleQ1892: How do you implement service discovery?
Section titled “Q1892: How do you implement service discovery?”Answer:
# DNS# Consul
# Health checks# Registration
# Load balancing# Client-side
# Failover# AutomaticQ1893: How do you optimize web performance?
Section titled “Q1893: How do you optimize web performance?”Answer:
# CDN# Static assets
# Compression# gz/brotli
# Caching# Headers
# Minification# CSS/JS
# Images# OptimizationQ1894: How do you implement backup verification?
Section titled “Q1894: How do you implement backup verification?”Answer:
# Test restore# Regular
# Automation# Script
# Checksums# Verify
# Documentation# ProceduresQ1895: How do you design for privacy?
Section titled “Q1895: How do you design for privacy?”Answer:
# Data minimization# Collect less
# Encryption# Strong
# Access control# Strict
# Audit# Logging
# Retention# PolicyQ1896: How do you implement auto-remediation?
Section titled “Q1896: How do you implement auto-remediation?”Answer:
# Detection# Alerts
# Classification# Severity
# Action# Runbook
# Automation# Scripts
# Verification# Confirm fixQ1897: How do you optimize storage?
Section titled “Q1897: How do you optimize storage?”Answer:
# Tiering# Hot/cold
# Compression# Deduplication
# Lifecycle# Policies
# Monitoring# Usage
# Cleanup# RegularQ1898: How do you implement MFA?
Section titled “Q1898: How do you implement MFA?”Answer:
# Factors# Multiple
# Methods# TOTP/Push
# Rollout# Gradual
# Backup# Recovery codes
# Enforcement# PolicyQ1899: How do you design for resilience?
Section titled “Q1899: How do you design for resilience?”Answer:
# Redundancy# Multiple
# Fault tolerance# Graceful
# Recovery# Fast
# Testing# Chaos
# Monitoring# Real-timeQ1900: How do you implement cost reporting?
Section titled “Q1900: How do you implement cost reporting?”Answer:
# Tagging# Comprehensive
# Collection# Automated
# Analysis# By team
# Visualization# Dashboards
# Actions# OptimizationQ1901: How do you design for IoT data?
Section titled “Q1901: How do you design for IoT data?”Answer:
# Collection# MQTT/HTTP
# Processing# Stream
# Storage# Time-series
# Analysis# Real-time
# Retention# PolicyQ1902: How do you implement service catalog?
Section titled “Q1902: How do you implement service catalog?”Answer:
# Self-service# Portal
# Standardization# Templates
# Governance# Approval
# Documentation# Auto-generatedQ1903: How do you optimize database queries?
Section titled “Q1903: How do you optimize database queries?”Answer:
# EXPLAIN# Analyze
# Indexing# Strategic
# Rewriting# Equivalent
# Caching# Query cache
# Profiling# Slow queriesQ1904: How do you implement API gateway?
Section titled “Q1904: How do you implement API gateway?”Answer:
# Routing# Path-based
# Authentication# JWT
# Rate limiting# Quotas
# Caching# Response
# Monitoring# UsageQ1905: How do you design for compliance?
Section titled “Q1905: How do you design for compliance?”Answer:
# Controls# Framework
# Automation# Policy
# Evidence# Collection
# Monitoring# Continuous
# Audit# RegularQ1906: How do you implement incident automation?
Section titled “Q1906: How do you implement incident automation?”Answer:
# Detection# Automated
# Triage# Classification
# Response# Runbooks
# Escalation# Rules
# Resolution# TrackingQ1907: How do you optimize Kubernetes?
Section titled “Q1907: How do you optimize Kubernetes?”Answer:
# Resources# Requests/limits
# Scheduling# Affinity
# Networking# CNI
# Storage# Classes
# Autoscaling# HPA/VPAQ1908: How do you implement data governance?
Section titled “Q1908: How do you implement data governance?”Answer:
# Classification# Sensitivity
# Ownership# Clear
# Quality# Rules
# Lineage# Tracking
# Compliance# PolicyQ1909: How do you design for ML infrastructure?
Section titled “Q1909: How do you design for ML infrastructure?”Answer:
# Data pipeline# ETL
# Training# Distributed
# Serving# Model serving
# Monitoring# Drift
# MLOps# AutomationQ1910: How do you implement cloud governance?
Section titled “Q1910: How do you implement cloud governance?”Answer:
# Policies# Guardrails
# Tagging# Standards
# Cost control# Budgets
# Security# Baseline
# Compliance# AuditQ1911: How do you design for edge security?
Section titled “Q1911: How do you design for edge security?”Answer:
# Device auth# Certificates
# Data encryption# TLS
# Network# Segmentation
# Updates# Signed
# Monitoring# CentralizedQ1912: How do you implement container orchestration?
Section titled “Q1912: How do you implement container orchestration?”Answer:
# Scheduling# Placement
# Scaling# Auto
# Networking# Service mesh
# Storage# CSI
# Security# PoliciesQ1913: How do you optimize network latency?
Section titled “Q1913: How do you optimize network latency?”Answer:
# CDN# Geographic
# Caching# Multi-layer
# Compression# gz/brotli
# HTTP/2# Multiplexing
# DNS# AnycastQ1914: How do you implement data protection?
Section titled “Q1914: How do you implement data protection?”Answer:
# Encryption# At rest/transit
# Access control# RBAC
# Backup# Automated
# Monitoring# Audit
# Incident# ResponseQ1915: How do you design for real-time processing?
Section titled “Q1915: How do you design for real-time processing?”Answer:
# Stream processing# Kafka/Spark
# Low latency# Optimization
# Scalability# Horizontal
# Monitoring# Metrics
# Backpressure# HandlingQ1916: How do you implement application security?
Section titled “Q1916: How do you implement application security?”Answer:
# SDLC# Secure
# SAST/DAST# Scanning
# Dependencies# Scanning
# Runtime# Protection
# Training# DevelopersQ1917: How do you optimize Linux for databases?
Section titled “Q1917: How do you optimize Linux for databases?”Answer:
# Filesystem# XFS/ext4
# I/O scheduler# Deadline/noop
# Memory# Huge pages
# Network# Buffer sizes
# Disk# SSD/NVMeQ1918: How do you implement data retention?
Section titled “Q1918: How do you implement data retention?”Answer:
# Policy# Defined
# Classification# By type
# Automation# Scripts
# Compliance# Legal holds
# Verification# RegularQ1919: How do you design for compliance reporting?
Section titled “Q1919: How do you design for compliance reporting?”Answer:
# Evidence# Automated
# Framework# Mapping
# Controls# Validation
# Audit# Support
# Remediation# TrackingQ1920: How do you implement Kubernetes networking?
Section titled “Q1920: How do you implement Kubernetes networking?”Answer:
# CNI plugin# Calico/Flannel
# Network policies# Segmentation
# Services# Types
# Ingress# Controller
# DNS# CoreDNSQ1921: How do you optimize database connections?
Section titled “Q1921: How do you optimize database connections?”Answer:
# Pooling# Connection pool
# Sizing# Pool size
# Timeouts# Configure
# Monitoring# Active connections
# Tuning# Database configQ1922: How do you implement backup automation?
Section titled “Q1922: How do you implement backup automation?”Answer:
# Scheduling# Cron
# Retention# Policy
# Verification# Test restore
# Offsite# Replication
# Monitoring# AlertsQ1923: How do you design for regulatory compliance?
Section titled “Q1923: How do you design for regulatory compliance?”Answer:
# Assessment# Gap analysis
# Controls# Implementation
# Monitoring# Continuous
# Documentation# Evidence
# Audit# SupportQ1924: How do you implement service level objectives?
Section titled “Q1924: How do you implement service level objectives?”Answer:
# Define# Metrics
# Measurement# Collection
# Alerting# Budget
# Reporting# Regular
# Improvement# ActionQ1925: How do you optimize Linux storage?
Section titled “Q1925: How do you optimize Linux storage?”Answer:
# Filesystem# Choice
# Mount options# Tuning
# LVM# Flexible
# RAID# Configuration
# Monitoring# I/OQ1926: How do you implement network segmentation?
Section titled “Q1926: How do you implement network segmentation?”Answer:
# VLANs# Isolation
# Firewalls# Zones
# Zero trust# Micro-segmentation
# Monitoring# Traffic
# Compliance# AuditQ1927: How do you design for ML model serving?
Section titled “Q1927: How do you design for ML model serving?”Answer:
# Framework# TensorFlow Serving
# Scaling# Horizontal
# A/B testing# Canary
# Monitoring# Drift
# Updates# RollingQ1928: How do you implement vulnerability management?
Section titled “Q1928: How do you implement vulnerability management?”Answer:
# Scanning# Regular
# Prioritization# Severity
# Remediation# Process
# Verification# Rescan
# Reporting# MetricsQ1929: How do you optimize web application security?
Section titled “Q1929: How do you optimize web application security?”Answer:
# WAF# Deploy
# Headers# Security
# Input validation# Sanitization
# SQL injection# Prevention
# XSS# ProtectionQ1930: How do you design for compliance automation?
Section titled “Q1930: How do you design for compliance automation?”Answer:
# Policy as code# OPA
# Scanning# Continuous
# Remediation# Auto
# Evidence# Collection
# Reporting# AutomatedQ1931: How do you implement incident communication?
Section titled “Q1931: How do you implement incident communication?”Answer:
# Stakeholders# Identification
# Status page# Updates
# Channels# Multiple
# Timing# Regular
# Post-incident# CommunicationQ1932: How do you optimize Kubernetes resources?
Section titled “Q1932: How do you optimize Kubernetes resources?”Answer:
# Requests# Set appropriately
# Limits# Configure
# HPA# Auto-scale
# VPA# Recommendations
# Monitoring# UsageQ1933: How do you implement data classification?
Section titled “Q1933: How do you implement data classification?”Answer:
# Categories# Public, Internal, Confidential
# Labeling# Automatic
# Policies# Based on class
# Training# Awareness
# Auditing# RegularQ1934: How do you design for regulatory requirements?
Section titled “Q1934: How do you design for regulatory requirements?”Answer:
# Framework# Selection
# Controls# Implementation
# Monitoring# Continuous
# Evidence# Automated
# Audit# SupportQ1935: How do you implement cost allocation tags?
Section titled “Q1935: How do you implement cost allocation tags?”Answer:
# Tagging policy# Required tags
# Enforcement# SCP
# Reporting# By tag
# Alerts# Budget
# Optimization# ActionQ1936: How do you optimize Linux for networking?
Section titled “Q1936: How do you optimize Linux for networking?”Answer:
# Buffer sizes# Tuning
# Offloading# Enable
# TCP# Parameters
# Queue# Tuning
# Monitoring# MetricsQ1937: How do you implement service mesh security?
Section titled “Q1937: How do you implement service mesh security?”Answer:
# mTLS# Enable
# Authorization# Policies
# Encryption# Automatic
# Audit# Logging
# Updates# RegularQ1938: How do you design for disaster recovery testing?
Section titled “Q1938: How do you design for disaster recovery testing?”Answer:
# Schedule# Regular
# Scope# Defined
# Documentation# Runbooks
# Validation# Success
# Improvements# Action itemsQ1939: How do you implement API versioning?
Section titled “Q1939: How do you implement API versioning?”Answer:
# Strategy# URL path
# Deprecation# Policy
# Documentation# Swagger
# Migration# Guide
# Support# TimelineQ1940: How do you optimize container images?
Section titled “Q1940: How do you optimize container images?”Answer:
# Base image# Minimal
# Layers# Reduce
# Caching# Build cache
# Multi-stage# Build
# Scanning# SecurityQ1941: How do you implement compliance monitoring?
Section titled “Q1941: How do you implement compliance monitoring?”Answer:
# Controls# Continuous
# Alerts# Deviation
# Reporting# Regular
# Remediation# Tracking
# Audit# SupportQ1942: How do you design for data pipelines?
Section titled “Q1942: How do you design for data pipelines?”Answer:
# Source# Connectors
# Processing# ETL/ELT
# Quality# Validation
# Destination# Storage
# Monitoring# AlertsQ1943: How do you implement zero trust network?
Section titled “Q1943: How do you implement zero trust network?”Answer:
# Verify# Always
# Least privilege# Access
# Micro-segmentation# Network
# Encryption# All traffic
# Monitoring# ContinuousQ1944: How do you optimize Linux for high availability?
Section titled “Q1944: How do you optimize Linux for high availability?”Answer:
# Keepalived# Configure
# HAProxy# Tune
# Health checks# Configure
# Monitoring# Comprehensive
# Testing# RegularQ1945: How do you implement security automation?
Section titled “Q1945: How do you implement security automation?”Answer:
# Scanning# Automated
# Remediation# Auto-fix
# Response# Playbooks
# Integration# CI/CD
# Monitoring# ContinuousQ1946: How do you design for event-driven architecture?
Section titled “Q1946: How do you design for event-driven architecture?”Answer:
# Event sourcing# Design
# Message broker# Kafka
# Consumers# Scaling
# Idempotency# Handle
# Monitoring# EventsQ1947: How do you implement infrastructure testing?
Section titled “Q1947: How do you implement infrastructure testing?”Answer:
# Validation# Terraform
# Integration# Kitchen
# Compliance# InSpec
# Security# Scanning
# Chaos# EngineeringQ1948: How do you optimize for DevOps?
Section titled “Q1948: How do you optimize for DevOps?”Answer:
# CI/CD# Optimize
# Automation# Everything
# Monitoring# Feedback
# Collaboration# Teams
# Culture# ImprovementQ1949: How do you implement data encryption?
Section titled “Q1949: How do you implement data encryption?”Answer:
# At rest# LUKS
# In transit# TLS
# Application# Field-level
# Keys# Management
# Rotation# PolicyQ1950: How do you design for incident recovery?
Section titled “Q1950: How do you design for incident recovery?”Answer:
# Detection# Fast
# Containment# Quick
# Eradication# Complete
# Recovery# Fast
# Post-incident# LearningQ1951: How do you implement container security scanning?
Section titled “Q1951: How do you implement container security scanning?”Answer:
# Build time# Scan images
# Registry# Scan stored
# Runtime# Scan running
# Policies# Define
# Automation# CI/CDQ1952: How do you optimize Linux for virtualization?
Section titled “Q1952: How do you optimize Linux for virtualization?”Answer:
# CPU# Pinning
# Memory# Overcommit
# Network# Para-virtual
# Storage# VirtIO
# Monitoring# Per-VMQ1953: How do you implement access certification?
Section titled “Q1953: How do you implement access certification?”Answer:
# Review schedule# Quarterly
# Certification# Campaign
# Remediation# Tasks
# Exceptions# Approval
# Reporting# AuditQ1954: How do you design for data recovery?
Section titled “Q1954: How do you design for data recovery?”Answer:
# Backups# Multiple
# Point in time# Capability
# Testing# Regular
# Documentation# Procedures
# Team# TrainingQ1955: How do you implement API authentication?
Section titled “Q1955: How do you implement API authentication?”Answer:
# OAuth 2.0# Implement
# JWT# Tokens
# API keys# Management
# Rotation# Policy
# Monitoring# UsageQ1956: How do you optimize database indexing?
Section titled “Q1956: How do you optimize database indexing?”Answer:
# Identify# Slow queries
# Analyze# EXPLAIN
# Create# Appropriate
# Composite# Order
# Maintenance# RebuildQ1957: How do you implement incident triage?
Section titled “Q1957: How do you implement incident triage?”Answer:
# Classification# Severity
# Impact# Assessment
# Prioritization# Order
# Assignment# Owner
# Escalation# PathQ1958: How do you design for cloud migration?
Section titled “Q1958: How do you design for cloud migration?”Answer:
# Assessment# Discovery
# Planning# Strategy
# Migration# Execute
# Validation# Testing
# Optimization# Post-migrationQ1959: How do you implement security policies?
Section titled “Q1959: How do you implement security policies?”Answer:
# Framework# Define
# Implementation# Deploy
# Enforcement# Monitor
# Training# Awareness
# Review# RegularQ1960: How do you design for data architecture?
Section titled “Q1960: How do you design for data architecture?”Answer:
# Storage# Selection
# Processing# Pipeline
# Integration# API
# Governance# Policy
# Security# EncryptionQ1961: How do you implement compliance reporting?
Section titled “Q1961: How do you implement compliance reporting?”Answer:
# Collect evidence# Automated
# Map controls# Framework
# Generate reports# Templates
# Review# Stakeholders
# Archive# SecureQ1962: How do you design for ML ops?
Section titled “Q1962: How do you design for ML ops?”Answer:
# Version control# Models
# Experimentation# Tracking
# Deployment# CI/CD
# Monitoring# Performance
# Retraining# AutomationQ1963: How do you implement secure coding?
Section titled “Q1963: How do you implement secure coding?”Answer:
# Training# Developers
# Standards# OWASP
# Review# Code review
# Testing# SAST/DAST
# Dependencies# ScanningQ1964: How do you design for API management?
Section titled “Q1964: How do you design for API management?”Answer:
# Gateway# Deploy
# Rate limiting# Configure
# Authentication# OAuth
# Documentation# OpenAPI
# Analytics# UsageQ1965: How do you implement incident management automation?
Section titled “Q1965: How do you implement incident management automation?”Answer:
# Triage# Automated
# Response# Playbooks
# Escalation# Rules
# Communication# Templates
# Resolution# TrackingQ1966: How do you optimize storage performance?
Section titled “Q1966: How do you optimize storage performance?”Answer:
# SSD# Use
# RAID# Configuration
# Filesystem# Choice
# Caching# Enable
# Monitoring# I/O metricsQ1967: How do you design for zero downtime?
Section titled “Q1967: How do you design for zero downtime?”Answer:
# Load balancing# Health checks
# Database# Blue-green
# Caching# Warm up
# Deployment# Canary
# Rollback# QuickQ1968: How do you implement infrastructure cost optimization?
Section titled “Q1968: How do you implement infrastructure cost optimization?”Answer:
# Right-sizing# Continuous
# Reservations# Plan
# Spot instances# Use
# Cleanup# Scheduled
# Monitoring# AlertsQ1969: How do you design for data privacy?
Section titled “Q1969: How do you design for data privacy?”Answer:
# Classification# Automated
# Encryption# End-to-end
# Access control# Fine-grained
# Audit logging# Comprehensive
# Retention# PolicyQ1970: How do you implement network automation?
Section titled “Q1970: How do you implement network automation?”Answer:
# Ansible# Network modules
# Templates# Jinja2
# Testing# CI/CD
# Documentation# Auto-generated
# Version control# GitQ1971: How do you optimize Linux for cloud?
Section titled “Q1971: How do you optimize Linux for cloud?”Answer:
# Cloud provider# Optimized kernel
# Instance types# Right-sized
# Storage# EBS optimization
# Network# ENA
# Monitoring# CloudWatchQ1972: How do you implement cost governance?
Section titled “Q1972: How do you implement cost governance?”Answer:
# Tagging# Mandatory
# Budgets# Teams
# Alerts# Thresholds
# Reporting# Regular
# Optimization# Action itemsQ1973: How do you design for digital transformation?
Section titled “Q1973: How do you design for digital transformation?”Answer:
# Assessment# Current state
# Strategy# Roadmap
# Implementation# Phased
# Training# Change management
# Measurement# KPIsQ1974: How do you implement security operations?
Section titled “Q1974: How do you implement security operations?”Answer:
# SIEM# Deploy
# SOAR# Automate
# Threat intelligence# Integrate
# Incident response# Playbooks
# Monitoring# 24/7Q1975: How do you design for container registry?
Section titled “Q1975: How do you design for container registry?”Answer:
# Registry# Deploy
# Scanning# Automatic
# Retention# Policy
# Access control# IAM
# Replication# Multi-regionQ1976: How do you implement data catalog?
Section titled “Q1976: How do you implement data catalog?”Answer:
# Catalog# Deploy
# Metadata# Automate
# Discovery# Self-service
# Governance# Policies
# Lineage# TrackQ1977: How do you optimize Kubernetes storage?
Section titled “Q1977: How do you optimize Kubernetes storage?”Answer:
# Storage classes# Choose
# PVC# Configure
# Snapshot# Enable
# Backup# Velero
# Monitoring# MetricsQ1978: How do you design for API gateway?
Section titled “Q1978: How do you design for API gateway?”Answer:
# Gateway# Deploy
# Routing# Configure
# Authentication# Implement
# Rate limiting# Policy
# Monitoring# AnalyticsQ1979: How do you implement security scanning?
Section titled “Q1979: How do you implement security scanning?”Answer:
# SAST# Integrate
# DAST# Automated
# SCA# Dependencies
# Container# Scanning
# Runtime# ProtectionQ1980: How do you optimize database performance?
Section titled “Q1980: How do you optimize database performance?”Answer:
# Profiling# Identify bottleneck
# Indexing# Optimize
# Caching# Configure
# Query# Rewrite
# Scaling# PlanQ1981: How do you design for multi-region?
Section titled “Q1981: How do you design for multi-region?”Answer:
# Architecture# Multi-region
# Data replication# Configure
# DNS# Global
# CDN# Deploy
# Testing# FailoverQ1982: How do you implement observability platform?
Section titled “Q1982: How do you implement observability platform?”Answer:
# Metrics# Prometheus
# Logs# Loki/ELK
# Traces# Jaeger
# Dashboards# Grafana
# Alerting# PagerDutyQ1983: How do you design for data mesh?
Section titled “Q1983: How do you design for data mesh?”Answer:
# Domain ownership# Decentralized
# Data products# Define
# Platform# Self-service
# Governance# Federated
# Architecture# ScalableQ1984: How do you implement compliance as code?
Section titled “Q1984: How do you implement compliance as code?”Answer:
# Policy# Write
# Testing# Validate
# Enforcement# Gatekeeper
# Reporting# Automated
# Audit# EvidenceQ1985: How do you optimize Linux for IoT?
Section titled “Q1985: How do you optimize Linux for IoT?”Answer:
# Minimal OS# Build
# Kernel# Strip
# Storage# Optimize
# Network# Configure
# Security# HardenedQ1986: How do you design for API first?
Section titled “Q1986: How do you design for API first?”Answer:
# Design# OpenAPI
# Versioning# Strategy
# Documentation# Auto-generate
# Mocking# Enable
# Testing# ContractQ1987: How do you implement incident readiness?
Section titled “Q1987: How do you implement incident readiness?”Answer:
# Runbooks# Create
# Training# Regular
# Tools# Prepare
# Communication# Templates
# Post-incident# Review processQ1988: How do you design for edge architecture?
Section titled “Q1988: How do you design for edge architecture?”Answer:
# Compute# Edge location
# Storage# Local cache
# Networking# Low latency
# Security# Hardened
# Management# CentralizedQ1989: How do you implement security posture?
Section titled “Q1989: How do you implement security posture?”Answer:
# Assessment# Continuous
# Hardening# CIS benchmarks
# Monitoring# Real-time
# Response# Automated
# Improvement# Action itemsQ1990: How do you optimize for DevSecOps?
Section titled “Q1990: How do you optimize for DevSecOps?”Answer:
# Shift left# Security
# Automation# Pipeline
# Scanning# Integrate
# Training# Developers
# Governance# PoliciesQ1991: How do you design for data platform?
Section titled “Q1991: How do you design for data platform?”Answer:
# Ingestion# Batch/Stream
# Processing# Spark/Flink
# Storage# Data Lake
# Serving# Query engines
# Governance# CatalogQ1992: How do you implement cloud security?
Section titled “Q1992: How do you implement cloud security?”Answer:
# Shared responsibility# Understand
# IAM# Least privilege
# Network# Segmentation
# Encryption# Enable
# Monitoring# ConfigureQ1993: How do you optimize for cost efficiency?
Section titled “Q1993: How do you optimize for cost efficiency?”Answer:
# Rightsizing# Continuous
# Reservations# Purchase
# Spot# Use
# Automation# Scale down
# Cleanup# ScheduledQ1994: How do you design for resilience engineering?
Section titled “Q1994: How do you design for resilience engineering?”Answer:
# Antifragility# Build
# Chaos# Test
# Graceful degradation# Implement
# Recovery# Automate
# Learning# ContinuousQ1995: How do you implement DevOps metrics?
Section titled “Q1995: How do you implement DevOps metrics?”Answer:
# DORA metrics# Track
# Deployment frequency# Measure
# Lead time# Monitor
# MTTR# Calculate
# Change failure rate# AnalyzeQ1996: How do you design for zero trust architecture?
Section titled “Q1996: How do you design for zero trust architecture?”Answer:
# Verify explicitly# Always
# Least privilege access# Grant
# Assume breach# Design
# Micro-segmentation# Implement
# Monitor# ContinuouslyQ1997: How do you implement cloud migration?
Section titled “Q1997: How do you implement cloud migration?”Answer:
# Assess# Discover
# Plan# Strategy
# Migrate# Execute
# Validate# Test
# Optimize# Post-migrationQ1998: How do you implement Kubernetes security?
Section titled “Q1998: How do you implement Kubernetes security?”Answer:
# RBAC# Configure
# Network policies# Apply
# Pod security# Standards
# Secrets# External
# Scanning# IntegrateQ1999: How do you design for data protection?
Section titled “Q1999: How do you design for data protection?”Answer:
# Encryption# At rest/transit
# Access control# Implement
# Backup# Automate
# Recovery# Test
# Compliance# MeetQ2000: How do you implement SRE practices?
Section titled “Q2000: How do you implement SRE practices?”Answer:
# Error budgets# Define
# SLOs# Set
# Toil# Reduce
# Monitoring# Implement
# Post-incident# Review
# Automation# Enable