DEV Community

Aisalkyn Aidarova
Aisalkyn Aidarova

Posted on

interview questions

This is a very large topic. For a DevOps/SRE interview, these are the most common questions with answers and explanations.

1. What is an Operating System (OS)?

Answer

An Operating System is software that manages hardware resources and provides services for applications.

Examples:

  • Linux
  • Windows
  • macOS

Responsibilities

  • Process management
  • Memory management
  • File management
  • User management
  • Network management
  • Device management

Real Example

When you open Chrome:

  1. OS allocates RAM.
  2. OS schedules CPU.
  3. OS accesses files from disk.
  4. OS handles network traffic.

2. What are the main Linux Components?

Answer

Linux consists of:

Kernel

Core of Linux.

Responsible for:

  • CPU scheduling
  • Memory management
  • Device drivers
  • Networking

Shell

Examples:

  • Bash
  • Zsh
  • Sh

Responsible for:

  • Executing commands

File System

Stores:

  • Files
  • Directories

System Libraries

Allow applications to communicate with the kernel.

User Space Applications

Examples:

  • nginx
  • docker
  • kubectl

3. Explain Linux Boot Process

Answer

  1. BIOS/UEFI starts
  2. GRUB bootloader loads
  3. Linux kernel loads
  4. systemd starts
  5. Services start
  6. Login prompt appears

4. What is CPU?

Answer

CPU = Central Processing Unit

It executes instructions.

Think of CPU as the brain of the computer.

Responsibilities

  • Calculations
  • Running applications
  • Scheduling processes

Check CPU

lscpu
Enter fullscreen mode Exit fullscreen mode
top
Enter fullscreen mode Exit fullscreen mode
htop
Enter fullscreen mode Exit fullscreen mode

5. What is RAM?

Answer

RAM = Random Access Memory

Temporary storage used by running applications.

Example

Application running:

  • CPU processes data
  • RAM stores active data

Check RAM

free -h
Enter fullscreen mode Exit fullscreen mode
top
Enter fullscreen mode Exit fullscreen mode
vmstat
Enter fullscreen mode Exit fullscreen mode

6. Difference Between RAM and Disk

RAM Disk
Temporary Permanent
Faster Slower
Lost after reboot Saved after reboot

7. What is a Process?

Answer

A process is a running program.

Example:

ps -ef
Enter fullscreen mode Exit fullscreen mode

Show all processes.


8. What is a Thread?

Answer

A thread is a lightweight execution unit inside a process.

Example:

Google Chrome:

  • One process
  • Many threads

9. Linux Directory Structure

What is / ?

Root directory.

Important Directories

/etc

Configuration files

Examples:

/etc/passwd
/etc/hosts
Enter fullscreen mode Exit fullscreen mode

/var

Logs

Examples:

/var/log
Enter fullscreen mode Exit fullscreen mode

/home

User files


/tmp

Temporary files


/bin

Basic commands


/usr

Installed applications


/opt

Third-party applications


/dev

Devices

Example:

/dev/sda
Enter fullscreen mode Exit fullscreen mode

/proc

Kernel information


10. What is a File?

Everything in Linux is treated as a file.

Examples:

  • Regular file
  • Directory
  • Device
  • Socket

Check:

ls -l
Enter fullscreen mode Exit fullscreen mode

11. File Permissions

Example:

-rwxr-xr-x
Enter fullscreen mode Exit fullscreen mode

Meaning

Owner:

rwx
Enter fullscreen mode Exit fullscreen mode

Group:

r-x
Enter fullscreen mode Exit fullscreen mode

Others:

r-x
Enter fullscreen mode Exit fullscreen mode

Change permissions

chmod 755 file
Enter fullscreen mode Exit fullscreen mode

12. Network Troubleshooting Questions

Check IP

ip a
Enter fullscreen mode Exit fullscreen mode

Check Routing

ip route
Enter fullscreen mode Exit fullscreen mode

Check DNS

nslookup google.com
Enter fullscreen mode Exit fullscreen mode

or

dig google.com
Enter fullscreen mode Exit fullscreen mode

Check Connectivity

ping google.com
Enter fullscreen mode Exit fullscreen mode

Check Port

nc -zv host 443
Enter fullscreen mode Exit fullscreen mode

Check Open Connections

ss -tulpn
Enter fullscreen mode Exit fullscreen mode

Trace Network Path

traceroute google.com
Enter fullscreen mode Exit fullscreen mode

13. What is DNS?

Answer

DNS converts:

google.com
Enter fullscreen mode Exit fullscreen mode

to

142.250.x.x
Enter fullscreen mode Exit fullscreen mode

Without DNS you would need to remember IP addresses.


14. TCP vs UDP

TCP

Reliable

Examples:

  • HTTPS
  • SSH

UDP

Faster

Examples:

  • DNS
  • Video streaming

15. What is AWS?

Answer

Amazon Web Services is a cloud platform that provides:

  • Compute
  • Storage
  • Networking
  • Security

Pay only for what you use.


16. What is EC2?

Answer

Amazon EC2 is a virtual machine in AWS.

Used for:

  • Applications
  • Databases
  • Containers

17. What is Elastic IP?

Answer

Static public IP address.

Used when:

  • Public IP must not change.

Example:

  • Bastion host
  • Web server

18. What is EBS?

Answer

Amazon EBS = Block Storage

Think:

Virtual hard drive attached to EC2.

Features

  • Persistent
  • Fast
  • Single AZ

19. What is EFS?

Answer

Amazon EFS = Shared File System

Many EC2 instances can mount the same storage.

Uses

  • Shared application files
  • Kubernetes persistent storage

20. EBS vs EFS

EBS EFS
Block Storage File Storage
One EC2 Many EC2
Single AZ Multi-AZ
Faster Shared

21. What is S3?

Answer

Amazon S3

Stores:

  • Images
  • Videos
  • Backups
  • Logs

Unlimited scale.


22. What is CloudFront?

Answer

Amazon CloudFront

CDN service.

Caches content close to users.

Benefits

  • Faster websites
  • Lower latency
  • DDoS protection

23. What is Load Balancer?

Answer

Distributes traffic among servers.

Example:

1000 users
      |
     ALB
   /     \
EC2     EC2
Enter fullscreen mode Exit fullscreen mode

24. What is ALB?

Answer

Application Load Balancer

Works at:

  • HTTP
  • HTTPS

Can route:

/app
/api
/images
Enter fullscreen mode Exit fullscreen mode

to different targets.


25. What is NLB?

Answer

Network Load Balancer

Works at:

  • TCP
  • UDP

Used for:

  • High performance
  • Millions of requests

26. ALB vs NLB

ALB NLB
Layer 7 Layer 4
HTTP/HTTPS TCP/UDP
Path Routing No Path Routing
Web Apps High-performance apps

27. What is Auto Scaling Group?

Answer

Automatically adds or removes EC2 instances.

Example:

CPU > 70%

2 EC2 → 4 EC2
Enter fullscreen mode Exit fullscreen mode

Traffic decreases:

4 EC2 → 2 EC2
Enter fullscreen mode Exit fullscreen mode

28. What is Reserved Instance?

Answer

Commit for:

  • 1 year
  • 3 years

Receive large discount.

Used for predictable workloads.


29. What is Spot Instance?

Answer

Unused AWS capacity.

Up to 90% cheaper.

Can be terminated anytime.

Best for:

  • Batch jobs
  • CI/CD
  • Testing

30. What is Dedicated Host?

Answer

Physical server dedicated only to one customer.

No other AWS customers share that hardware.

Used for:

  • Compliance
  • Licensing requirements

31. What is Security Group?

Answer

Virtual firewall for EC2.

Example:

Allow:

22 SSH
80 HTTP
443 HTTPS
Enter fullscreen mode Exit fullscreen mode

Deny everything else.


32. What is VPC?

Answer

Virtual network in AWS.

Contains:

  • Subnets
  • Route tables
  • Security groups
  • EC2

33. What is NAT Gateway?

Answer

Allows private instances to access internet.

Internet cannot initiate connections to them.


34. What is Route Table?

Answer

Network map telling traffic where to go.

Example:

0.0.0.0/0
→ Internet Gateway
Enter fullscreen mode Exit fullscreen mode

35. What is Internet Gateway?

Answer

Allows public subnet resources to access internet.


36. Production Troubleshooting Question

Interviewer:

Application is down. What do you check?

Answer

Step 1

Check DNS

nslookup app.company.com
Enter fullscreen mode Exit fullscreen mode

Step 2

Check Load Balancer

Target healthy?

Step 3

Check EC2

systemctl status nginx
Enter fullscreen mode Exit fullscreen mode

Step 4

Check Ports

ss -tulpn
Enter fullscreen mode Exit fullscreen mode

Step 5

Check Logs

journalctl -xe
Enter fullscreen mode Exit fullscreen mode
tail -f /var/log/nginx/error.log
Enter fullscreen mode Exit fullscreen mode

Step 6

Check Resources

top
free -h
df -h
Enter fullscreen mode Exit fullscreen mode

Step 7

Check Network

ping
curl
traceroute
Enter fullscreen mode Exit fullscreen mode

37. Top Linux Commands Every DevOps Engineer Must Know

pwd
ls
cd
mkdir
rm
cp
mv
cat
less
head
tail
grep
find
chmod
chown
ps
top
htop
kill
df -h
du -sh
free -h
ip a
ip route
ping
curl
wget
dig
nslookup
systemctl
journalctl
ssh
scp
tar
gzip
unzip
Enter fullscreen mode Exit fullscreen mode

These cover roughly 80–90% of the Linux, AWS, networking, and troubleshooting questions commonly asked in DevOps, SRE, Platform Engineer, and Cloud Engineer interviews.

Top comments (0)