InterviewStack.io LogoInterviewStack.io

Command Line and Shell Scripting Questions

Practical skills using command line interfaces and writing simple shell scripts for automation and system administration across operating systems. For Linux this includes navigation and file operations, file permissions, process and service inspection, log viewing, package and systemctl management, common text processing and search utilities such as grep, find, sed, and awk, piping and redirection, environment variables, command substitution, and interactive use of editors and remote access tools. Shell scripting fundamentals include variables, conditionals, loops, functions, argument handling, basic debugging, and using bash to automate repetitive tasks. The scope also covers essential Windows command line and shell basics where relevant, including interactive commands, simple PowerShell cmdlets for process and service management, file and permission commands, and differences in syntax and environment when performing equivalent administrative tasks on Windows. Candidates may be evaluated on writing short scripts, composing command pipelines to accomplish tasks, and explaining tradeoffs between interactive commands and scripted automation.

HardTechnical
0 practiced
Implement an exponential backoff with jitter function in bash that retries a network POST via `curl` up to a configurable max attempts, supports per-attempt logging, uses capped exponential backoff with jitter, and exits non-zero after exhausting retries. Provide the code and explain how jitter prevents thundering herd.
MediumTechnical
0 practiced
Write a robust shell-compatible solution to extract the 'user_email' column from a CSV file that uses quoted fields and may contain commas inside quotes. You may use standard Unix tools or a small Python one-liner. Explain trade-offs of using awk/sed vs a CSV-aware parser for large or malformed files.
MediumTechnical
0 practiced
Describe best practices for managing secrets accessed by shell scripts in a data engineering environment. Compare using environment variables, files with restricted permissions, OS-level secret stores, and cloud secret managers (AWS SSM Parameter Store, AWS Secrets Manager, GCP Secret Manager). Provide an example command showing secure retrieval and use of a secret in a script.
MediumTechnical
0 practiced
Write a bash pipeline to read many gzipped JSON Lines files in /data/incoming, extract fields `id`, `timestamp`, and `value` using `jq`, ensure a CSV header is present, remove duplicate records (based on id), and write a single compressed output `/data/processed/out.csv.gz`. Provide the commands and explain streaming considerations.
MediumTechnical
0 practiced
Design a resilient file transfer workflow to move daily batch files from an on-prem server to an S3 staging bucket through a bastion host: use rsync over SSH to transfer to a staging host, verify checksums, then use `aws s3` with retries to upload. Include retry logic, checksum verification, and how to resume partial transfers.

Unlock Full Question Bank

Get access to hundreds of Command Line and Shell Scripting interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.