profile pic # DevOps @ Google
Upvote 3 Downvote
System monitoring Bash script Sr. Site Reliability Engineer @ Google Difficulty Hard

Write a bash script that monitors system health and sends an alert if any of the following conditions are met:

  • The CPU usage exceeds 80% for more than 5 minutes.
  • The available disk space on the root partition is less than 10%.
  • If any condition is met, the script should output an appropriate message to the standard error (stderr) indicating the issue.

You can use the following template to create your script:

check_cpu() {
    local threshold=80
    #... other variables

    while true; do
        # Check CPU usage
        # Your CPU usage check logic here
    done
}

check_disk_space() {
    local threshold=10
    #... other variables

    # Check disk space
    # Your disk space check logic here
}

check_disk_space
check_cpu  
Solution:

Please sign-in to view the solution

Upvote 1 Downvote
Layer 2 and Layer 3 Networking Sr. Site Reliability Engineer @ Google Difficulty Medium

What are the primary differences between the Data Link Layer (Layer 2) and the Network Layer (Layer 3) in the OSI model, particularly in terms of addressing and device types used at each layer?

Solution:

Please sign-in to view the solution

Upvote 1 Downvote
IP forwarding Sr. Site Reliability Engineer @ Google Difficulty Medium

How can we enable IP forwarding in the Linux kernel, and why is it disabled by default?

Solution:

Please sign-in to view the solution

Upvote -1 Downvote
Container networking Sr. Site Reliability Engineer @ Google Difficulty Medium

For a containerization solution that requires isolated yet connected network environments for each container, which Virtual Network Interface (VNI) type would best suit this need? Provide a command example to create this VNI type in a Linux environment.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Estimating Storage Size for Google Maps-like Service DevOps Engineer @ Google Difficulty Hard

How would you estimate the storage size required for hosting a service similar to Google Maps, considering the volume of global map data, satellite imagery, and street views? Assume the usage of GCP services for storage, and consider factors such as data compression, redundancy, and future scalability.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Key TCP/IP Concepts for Network Maintenance and Troubleshooting DevOps Engineer @ Google Difficulty Medium

Explain key TCP/IP concepts that are crucial for maintaining and troubleshooting a network. Focus on concepts such as IP addressing, subnetting, TCP vs. UDP, and the role of common protocols like HTTP, SSH, and DNS in network communications.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Designing a Monitoring System for Data Center DevOps Engineer @ Google Difficulty Hard

How would you design a comprehensive monitoring system for a data center, utilizing tools like Prometheus for metric collection, Grafana for data visualization, and incorporating alerting mechanisms through Alertmanager? Consider scalability, real-time monitoring, and the ability to monitor various components such as servers, network devices, and applications.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Understanding SETUID in Unix/Linux Systems DevOps Engineer @ Google Difficulty Medium

Explain the purpose and security implications of using SETUID (Set User ID upon execution) in Unix/Linux systems, particularly in the context of file permissions and how it can be used to elevate privileges for executing programs.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Handling NDP Requests in IPv6 Networks DevOps Engineer @ Google Difficulty Medium

Discuss the process and significance of handling a Neighbor Discovery Protocol (NDP) request in IPv6 networks, particularly focusing on how it facilitates address resolution and the detection of other devices on the same network.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Implementing Custom Tail Command in Bash DevOps Engineer @ Google Difficulty Medium

How can one implement a custom script using Bash in a Linux environment to emulate the behavior of the 'tail' command to display the last 10 lines of a specific log file?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Implementing a Cron Job for Database Backup in Linux DevOps Engineer @ Google Difficulty Medium

How can one design and implement a cron job in a Linux environment to automate a script that performs database backup daily at midnight, ensuring the process aligns with DevOps best practices for automation and monitoring?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Determining the BMC IP Address DevOps Engineer @ Google Difficulty Medium

What are the methods to determine the IP address of the Baseboard Management Controller (BMC) on a server, ensuring network security and access controls are adequately considered?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Ethernet (MAC) Address Size DevOps Engineer @ Google Difficulty Easy

What is the size of an Ethernet (MAC) address in terms of bits?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
IPv6 Representation in DNS DevOps Engineer @ Google Difficulty Medium

How is an IPv6 address represented and stored in a DNS system? Explain the record type used for IPv6 addresses.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Understanding ARP Spoofing and Mitigation Techniques DevOps Engineer @ Google Difficulty Hard

Explain the process and implications of ARP spoofing in a network. How can it be mitigated?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
DNS Performance: UDP vs TCP DevOps Engineer @ Google Difficulty Medium

Discuss the performance benefits of DNS using UDP over TCP for query resolution. What are the circumstances under which DNS might use TCP instead?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Understanding Filesystem Inode Structure in Linux DevOps Engineer @ Google Difficulty Medium

How does the filesystem inode structure work, and what are the differences and use cases for directory entries, symbolic links, and hard links in a Linux environment?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Implementing a Traceroute Routine DevOps Engineer @ Google Difficulty Hard

How can you implement a traceroute routine using ICMP and TCP, and what are the specific details and steps involved in creating this network diagnostic tool?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Designing a Read-Intensive API DevOps Engineer @ Google Difficulty Hard

How would you design a read-intensive API that efficiently handles high volumes of read requests, leveraging cloud technologies and caching mechanisms?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Route tables DevOps Engineer @ Google Difficulty Hard

How can you configure a Linux system to route traffic destined for a specific subnet through a different gateway, while keeping this routing rule isolated from the system's main routing table? Provide the commands necessary to create a custom routing table and add a route to this table that directs traffic for the subnet 192.168.2.0/24 to pass through the gateway at 192.168.1.2 via the eth0 network interface.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Address Resolution Protocol (ARP) DevOps Engineer @ Google Difficulty Hard

You need to verify the MAC address associated with an IP address on your local network. Which command would you use to check the ARP cache and possibly refresh it if the address is not found?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Log Analysis with awk DevOps Engineer @ Google Difficulty Hard

You have a server access log file access.log that follows this format:

10.0.0.1 - - [10/Jul/2023:11:45:07 +0000] "GET /index.html HTTP/1.1" 200 2326
10.0.0.2 - - [10/Jul/2023:11:45:08 +0000] "POST /submit.php HTTP/1.1" 403 182
10.0.0.3 - - [10/Jul/2023:11:45:09 +0000] "GET /about.html HTTP/1.1" 200 478
10.0.0.9 - - [10/Jul/2023:11:45:09 +0000] "GET /login.html HTTP/1.1" 200 223

Write an awk command to:

  • The number of successful (HTTP status code 200) GET requests for each unique resource (e.g., /index.html, /about.html)
  • Displaying the count and the resource path.
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Backup and Archive to tarball DevOps Engineer @ Google Difficulty Hard

Create a script that backs up a specified directory (including all subdirectories) to a tarball, appending the current date to the filename. The script should also delete backups older than 30 days.

You can use the following template to create your backup script:

# Directory to be backed up
backup_source="/path/to/your/directory"

# Backup storage directory
backup_destination="/path/to/your/backup/directory"

# Backup filename format: backup-YYYYMMDD.tar.gz
backup_filename="backup-$(date +%Y%m%d).tar.gz"

# Number of days to keep the backup
days_to_keep=30

# Creating the backup
## Your backup creation command here

# Check if the backup was created successfully
## Success/Failure logic here
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Process Text Files DevOps Engineer @ Google Difficulty Hard

You have a directory full of text files. Write a script to find and display all files that contain a specific keyword, along with the count of how many times that keyword appears in each file.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Video Streaming Service DevOps Engineer @ Google Difficulty Hard

Design a global video streaming service similar to Netflix or YouTube, focusing on scalability, reliability, and low latency. Consider the following:

  • How would you architect the system to support millions of concurrent users globally?
  • What strategies would you employ for content delivery and network efficiency?
  • Discuss how you would handle metadata storage, search functionality, and user personalization at scale.
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Real-time Messaging System DevOps Engineer @ Google Difficulty Hard

Design a scalable real-time messaging system like WhatsApp or Telegram that can support high-volume, low-latency messaging across the globe. Address the following points:

  • Describe the system architecture needed to ensure message delivery with minimal delay.
  • How would you design the data model to store conversations, ensure data consistency, and manage user presence status?
  • Explain the trade-offs between consistency, availability, and partition tolerance (CAP theorem) in your design.
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Implement CDN Service DevOps Engineer @ Google Difficulty Hard

You are tasked by a Cloud Provider to create a CDN Product similar to Cloudflare. Design the architecture for the CDN service, focusing on content caching, load balancing, and global content delivery.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Understanding Threads and Processes DevOps Engineer @ Google Difficulty Hard

Explain the difference between a process and a thread in a Linux operating system. How do threads differ from processes in terms of resource allocation and execution?

Write a command to list all threads of a specific process using the process ID (PID).

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Deadlock and Avoidance DevOps Engineer @ Google Difficulty Hard

Describe a scenario where a deadlock could occur in a system.

Write command to detect and trace a deadlock in a Linux system.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Context Switching and Scheduling DevOps Engineer @ Google Difficulty Hard

Explain the concept of context switching in the Linux operating system. Discuss how context switching impacts system performance and how the scheduler plays a role in managing the execution of processes and threads. Additionally, describe the role of modern concurrency constructs like mutexes and semaphores in minimizing the cost of context switches.

Also describe the steps you would take to diagnose the high context switching rate on the server.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
System Calls in Unix/Linux for Containerization DevOps Engineer @ Google Difficulty Hard

Describe how the clone(), unshare(), and cgroups (control groups) system calls or mechanisms contribute to the underlying functionality of containerization?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Libraries and Linking DevOps Engineer @ Google Difficulty Hard

In Unix/Linux systems, what is the difference between static and dynamic linking? Describe a scenario where you would prefer one over the other.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Memory Management DevOps Engineer @ Google Difficulty Hard

Explain how a Unix/Linux operating system handles memory overcommitment.

What mechanism it uses to decide which processes to terminate when the system runs out of physical memory and swap space (OOM condition)?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Distributed File Storage System DevOps Engineer @ Google Difficulty Hard

Design a distributed file storage system similar to Google Drive or Dropbox, capable of storing and retrieving large amounts of data across a distributed network. Consider the following aspects:

Solution:

Please sign-in to view the solution