wget interview questions appear in Linux sysadmin, DevOps, SRE, and backend screens whenever teams pull packages, logs, or artifacts from HTTP, HTTPS, or FTP without a browser. Interviewers care less about memorizing every flag and more about whether you can resume a broken ISO download, script a quiet cron fetch, mirror a docs site safely, and explain when curl is the better tool.
Below are 31 questions grouped by topic. Many hands-on answers include runnable commands or clearly labeled illustrative examples for a Linux host with GNU Wget installed. Pair this guide with the wget command cheat sheet for day-to-day syntax, curl when the task is API-shaped, and Linux interview questions for experienced users for broader admin scenarios.
Interview context and how to prepare
What do wget interview questions actually test?
wget interviews check whether you can download files reliably on servers that have no GUI—and whether you understand the flags that make downloads safe in scripts and cron jobs.
| Area | What interviewers probe |
|---|---|
| Basics | Fetch a URL, rename output, target a directory |
| Reliability | Resume (-c), retries (-t), rate limits |
| Automation | Quiet mode, background jobs, batch URL lists |
| Mirroring | Recursive download, depth limits, staying in one path |
| Security | HTTP auth, custom headers, TLS pitfalls |
| Comparison | wget vs curl for downloads vs API work |
| Role | Emphasis |
|---|---|
| Junior Linux admin | Basic wget URL, -O, -P, checking exit codes |
| DevOps / SRE | Resume, mirrors, bandwidth caps, idempotent cron fetches |
| Backend developer | Authenticated downloads, headers, piping to other tools |
A strong answer is:
"wget interviews test non-interactive downloading—resume, batch lists, quiet automation, and knowing when curl is better for APIs. I explain the command and the production reason behind each flag."
How do interviewers compare wget and curl?
Both tools speak HTTP and HTTPS, but they optimize for different jobs.
| Use case | Prefer wget | Prefer curl |
|---|---|---|
| Simple file download | Built-in recursion, mirroring, timestamping | Works, but more flags to assemble |
| Resume partial file | -c / --continue |
-C - / --continue-at |
| Mirror a static site | -m, -k, -p workflow |
Not designed for site mirrors |
| REST API / POST / PUT | Awkward | Native -X, -d, header control |
| Pipe body to another command | Possible with -O - |
Natural default (curl URL | jq) |
| Upload or multipart forms | Limited | Strong |
A strong answer is:
"I use wget when I need dependable bulk or recursive downloads—ISOs, vendor bundles, offline doc mirrors. I reach for curl when I am calling APIs, sending custom verbs, or piping JSON into jq. The choice is about the workflow."
What is a realistic 1–2 week wget prep plan?
wget prep is hands-on—run downloads on a lab VM and break them on purpose.
| Week | Focus | Hands-on drill |
|---|---|---|
| 1 | Basics: fetch, -O, -P, --spider, exit codes |
Download https://example.com, rename output, spider-check a URL |
| 1 | Reliability: -c, -t, --limit-rate |
Truncate a partial file, resume it, cap speed at 100k |
| 2 | Automation: -q, -o, -i, -b |
Cron-style quiet fetch; batch file with two URLs |
| 2 | Mirror + auth | Recursive fetch with -l 1 -np; HTTP authentication on a test endpoint |
Work through the wget command cheat sheet while you drill—each example maps to a common interview follow-up.
A strong answer is:
"I'd spend a week downloading real files on a VM—practice resume after killing a transfer, write a two-URL batch file, and mirror a small docs path with depth and no-parent limits. That covers most wget screens I've seen."
How do beginner and advanced wget interview expectations differ?
Beginner questions ask for a working one-liner. Advanced questions add constraints: bandwidth, idempotency, not hammering the remote server, or recovering from a half-finished mirror.
| Topic | Beginner | Advanced |
|---|---|---|
| Download | wget https://example.com/file |
-N to skip unchanged files in sync jobs |
| Output path | -O filename |
-P plus predictable names in Ansible/cron |
| Failures | "Run wget again" | -c resume, -t retries, reading wget-log |
| Recursive | "wget can mirror sites" | -l, -np, --wait, robots/exclusion behavior and crawl boundaries |
| Security | --user / --password |
Prefer --ask-password, vault-stored creds, never plaintext in shell history |
| TLS | Download over HTTPS | Know --no-check-certificate is lab-only; fix CA trust in production |
A strong answer is:
"Junior answers get the file onto disk. Senior answers mention resume, rate limits, not overwriting production artifacts, and choosing curl when the work is API-shaped instead of file-shaped."
wget fundamentals
What is wget?
What interviewers are testing: whether you describe wget as a non-interactive HTTP/HTTPS/FTP downloader built for scripts, cron, and mirrors—not an interactive browser.
GNU Wget is a free, non-interactive command-line utility for retrieving files over HTTP, HTTPS, and FTP. It is designed for scripts, cron jobs, and SSH sessions where no browser is available.
Key properties interviewers expect you to name:
- Non-interactive — no prompts unless you ask for a password
- Resumable — continues partial downloads when the server supports ranges
- Retriable — automatic retries on transient network errors
- Recursive — can follow links to mirror static content (use carefully)
On the lab host, Wget identifies itself as:
wget --version | head -1GNU Wget 1.24.5 built on linux-gnu.A strong answer is:
"wget is GNU's non-interactive network downloader for HTTP, HTTPS, and FTP. It is built for automation—resume, retries, batch URL lists, and optional recursive mirroring—on servers without a GUI."
Which protocols does wget support?
What interviewers are testing: whether you list wget's supported protocols and know when HTTPS certificate handling matters.
GNU Wget supports:
- HTTP and HTTPS (most interview scenarios)
- FTP and FTPS capabilities (see GNU Wget's FTPS options for explicit and implicit modes)
- Retrieval through HTTP/HTTPS/FTP proxies (
http_proxy,https_proxy, or-e use_proxy=on)
It does not replace SSH file copy—use scp or rsync for host-to-host sync over SSH.
A strong answer is:
"GNU Wget supports HTTP, HTTPS, FTP, and FTPS, plus retrieval through HTTP/HTTPS/FTP proxies. HTTP/HTTPS are the dominant modern interview use cases; for host-to-server sync over SSH I use scp or rsync."
Why is wget called non-interactive?
What interviewers are testing: Whether you understand why Wget is suitable for unattended cron, CI, SSH, and background downloads—not whether you confuse "non-interactive" with a unique advantage over curl.
Non-interactive means wget does not open a terminal UI or browser window and does not block waiting for you to click Save. Once started, it follows redirects, retries on failure, and writes files according to flags you passed on the command line.
That behavior matters in:
- cron and systemd timers — no TTY for prompts
- CI pipelines — artifacts must download unattended
- Configuration management — Ansible shell tasks expect exit codes, not dialogs
Avoid passwords directly in command history. Depending on the authentication mechanism, use --ask-password, a permission-restricted Wget configuration or netrc-style credential source where appropriate, or have automation retrieve credentials securely and pass them without logging them.
A strong answer is:
"Non-interactive means wget runs start-to-finish without human clicks—ideal for cron and CI. I avoid plaintext passwords on the command line; I use --ask-password or a restricted credential source, and I do not treat environment variables as a built-in Wget auth mechanism unless my script passes them safely."
How do you check if wget is installed on Linux?
What interviewers are testing: Whether you can distinguish command discovery from package verification and confirm which Wget implementation/version is actually installed.
Ask the package manager or run wget --version:
command -v wget
wget --version | head -1On RHEL-family systems the package name is wget:
rpm -q wgetSample output from the lab host:
/usr/bin/wget
GNU Wget 1.24.5 built on linux-gnu.
wget-1.24.5-5.el10.x86_64On Debian or Ubuntu you would use dpkg -l wget or apt install wget if missing.
A strong answer is:
"I use
command -v wgetto find it on PATH andwget --versionto verify the installed implementation/version. If it is missing, I install the distro package."
What is the basic wget command syntax?
What interviewers are testing: whether you define the basic wget command syntax accurately and tie it to a real workflow—not acronym trivia.
Synopsis from GNU Wget:
wget [OPTION]... [URL]...- Basic syntax is
wget [OPTION]... [URL].... GNU Wget allows options and URLs to be interspersed, although putting options first is usually clearer in scripts - Use
-i FILEfor a URL list; use-i -to read URLs from standard input - Multiple URLs on one line download sequentially
Example tested on the lab host:
wget -q -O /tmp/example.html https://example.com
wc -c /tmp/example.html559 /tmp/example.htmlA strong answer is:
"The basic form is
wget [options] [URLs...]. I normally put options first for readability, but GNU Wget also accepts options after URLs.-i filereads a URL list, and-i -reads it from stdin."
Basic downloads
How do you download a file with wget?
What interviewers are testing: Whether you know Wget's default destination behavior and when automation should pin the filename or destination directory explicitly.
The simplest form stores the remote filename in the current working directory:
wget https://example.comThat creates index.html when the server serves the default page. In scripts, pin the destination explicitly with -O or -P so paths are predictable.
Tested fetch:
wget -q -O /tmp/wget-demo.html https://example.com
wc -c /tmp/wget-demo.html559 /tmp/wget-demo.htmlA strong answer is:
"Bare
wget URLsaves using the remote name in the current directory. In production scripts I set-Oor-Pso automation always knows where the file landed."
How do you save a download under a different filename?
What interviewers are testing: Whether you understand that -O redirects all downloaded content into one output document rather than merely renaming each remote file.
Use -O / --output-document:
wget -O /var/tmp/release.tar.gz https://vendor.example.com/app/release.tar.gzImportant details:
-O -writes the body to stdout (pipe totar,sha256sum, etc.)-Owith multiple URLs concatenates every response into one file—usually not what you want for a batch- Think of
-Oas redirecting Wget's downloaded content into one output document, not merely renaming a remote file - Pair
-Owith-qin cron when you only care about success or failure
A strong answer is:
"
-O pathdirects downloaded content into that file;-O -sends it to stdout. I don't use one-Ofor a multi-URL batch because all responses would be concatenated."
How do you download into a specific directory?
What interviewers are testing: Whether you distinguish -P directory placement from -O output-document semantics and choose the right one for automation.
Use -P / --directory-prefix:
mkdir -p /tmp/wget-dl
wget -P /tmp/wget-dl https://example.com
ls /tmp/wget-dl/index.htmlwget creates the directory if it does not exist. The remote basename (index.html here) is preserved under that prefix.
A strong answer is:
"
-P /pathsets the destination directory and keeps the remote filename. I use it in playbooks when the directory is fixed but the artifact name comes from the URL."
What does wget --spider do?
What interviewers are testing: whether you use --spider to validate URLs and HTTP status without writing files—common in health checks.
--spider checks whether a URL is reachable without saving the response body—useful for health checks and "does this artifact exist?" probes.
wget --spider -q https://example.com
echo "exit code: $?"exit code: 0Exit code 0 means wget completed the spider check successfully; a non-zero status indicates an error. Wget documents its own exit-status categories separately from HTTP response codes—it may follow redirects, so treat $? as the overall operation result, not a direct map to one HTTP status class.
To inspect headers without downloading the body, add -S:
wget -S --spider https://example.com 2>&1 | head -6Spider mode enabled. Check if remote file exists.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Content-Type: text/htmlA strong answer is:
"
--spideris an existence check—no file on disk. Exit code 0 means success. I use it in monitoring scripts; for API JSON work I'd still pick curl."
How do you download quietly for scripts and cron?
What interviewers are testing: Whether you suppress noisy progress output without also losing failure detection and diagnostics needed by cron or CI.
Use -q / --quiet to suppress progress meters and most messages:
wget -q -O /tmp/quiet.html https://example.com
wc -c /tmp/quiet.html559 /tmp/quiet.htmlWhen you still need diagnostics, log to a file with -o instead of printing to the terminal:
wget -o /tmp/wget.log -O /tmp/logged.html https://example.com
tail -1 /tmp/wget.logCheck $? after quiet runs—cron will not show you the progress bar, only the exit status.
A strong answer is:
"
-qkeeps cron mail clean. I always check the exit code, and if I need a trail I add-o /var/log/wget-artifact.loginstead of running verbose in production."
Resume, retries, and rate limits
How do you resume an interrupted wget download?
What interviewers are testing: whether you use -c only when the server supports Range requests and the local partial file matches the intended target—not with -O as your normal resume pattern.
Use -c / --continue on a partial file left from an earlier Wget invocation with normal filename handling:
mkdir -p /tmp/wget-resume
cd /tmp/wget-resume
wget https://example.com/path/large-file.iso
# Interrupt the transfer with Ctrl+C.
wget -c https://example.com/path/large-file.iso-O truncates its destination immediately, so it defeats a partial-file resume demonstration. Let Wget retain the local filename when continuing an existing partial download.
-c applies when resuming a file left by a previous Wget run. Within the same invocation, Wget already retries after an interruption; -c is specifically for continuing a partial file from a prior run—GNU documents this distinction explicitly.
A strong answer is:
"
-cresumes a partial file from a previous run when the server supports byte ranges and the local prefix still matches the remote object. I don't pair-cwith-Ofor resume; I let Wget use its normal filename handling for large ISOs and vendor bundles."
When does wget -c fail to resume?
What interviewers are testing: Whether you understand that continuation depends on the existing local prefix and server range support—and why a changed remote object can corrupt a resumed artifact.
Resume is not guaranteed. Common failure cases:
- The server does not support continued retrieval—Wget may restart from the beginning and overwrite the partial file rather than append to it
- The local file is not the same partial transfer (wrong file, corrupted header)
- The remote file changed (new version on the server; bytes no longer match)—if the remote file is larger but changed rather than merely appended,
wget -ccan append the new tail to the old local prefix and produce a garbled file. Wget cannot verify that your partial file is truly a prefix of the current remote object. - The resume workflow used
-O; prefer normal filename handling when continuing an existing partial file
When -c cannot continue, wget may restart from scratch or error—read the message and verify with ls -l before assuming the download is complete.
A strong answer is:
"I resume only when I'm confident the remote artifact hasn't been replaced. For release artifacts I verify checksum/signature after resuming; if the remote object changed, I delete the partial and restart."
How do you limit wget download speed?
What interviewers are testing: whether you can explain how to limit wget download speed with the right steps, tools, and common failure modes.
Use --limit-rate:
wget --limit-rate=100k -O /tmp/rate.html https://example.comSuffix k or m sets kilobytes or megabytes per second (see wget --help). Tested on the lab host the file still completes at 559 bytes—the flag matters on large transfers where you protect shared links or production egress.
A strong answer is:
"
--limit-rate=500kcaps throughput so a big mirror does not saturate a WAN link. I pair it with--waiton recursive jobs so we are polite to small vendor servers."
How do you control wget retry behavior?
What interviewers are testing: Whether you can bound retries and timeouts for transient failures without creating a retry storm or an automation job that never terminates.
Key options:
| Flag | Purpose |
|---|---|
-t N |
Try at most N times (0 or inf = unlimited) |
--waitretry=SECONDS |
Pause between retries after errors |
-T SECONDS |
Set DNS, connect, and read timeout values |
--read-timeout=SECONDS |
Read timeout only (when you need to split it from connect/DNS) |
--retry-on-http-error=429,503 |
Retry specific HTTP status codes—use carefully; blind retries can worsen server load |
Example:
wget -t 5 --waitretry=10 -O /tmp/retry.html https://example.comThe default number of tries is 20. Wget retries certain transient failures, while fatal errors such as many HTTP client errors cause it to stop—wget exits so your script can alert.
A strong answer is:
"
-tcontrols the number of attempts, while--waitretrycontrols retry backoff. I use a bounded retry count and sensible timeouts for automation, and only opt into retries for HTTP errors such as 429/503 when the remote service's retry policy supports it."
Batch jobs, background, and automation
How do you download multiple URLs from a file?
What interviewers are testing: Whether you can feed URL inventories into Wget safely and understand how output naming behaves across a multi-URL batch.
Put one URL per line in a text file and pass -i / --input-file:
printf '%s\n' 'https://example.com' > /tmp/urls.txt
wget -i /tmp/urls.txt -P /tmp/batch-out
ls /tmp/batch-out/index.htmlAdd -B URL / --base=URL when the list contains relative paths. Use -x to create host-style directories if you need separation per site.
A strong answer is:
"
-i urls.txtwalks the list sequentially. I generate the list from inventory or a release manifest, then wget into a staging directory before checksum verification."
How do you run wget in the background?
What interviewers are testing: whether you can explain how to run wget in the background with the right steps, tools, and common failure modes.
Use -b / --background:
wget -b -o /tmp/wget-bg.log -O /tmp/bg.html https://example.comContinuing in background, pid 10980.wget detaches and writes progress to the log file you name with -o. Check tail -f /tmp/wget-bg.log or ps for the PID if the job is long.
A strong answer is:
"
-breturns immediately with a PID—good for long ISO pulls from an SSH session. I always set-oso I can tail the log later; for real daemon work I'd still prefer systemd or a proper job queue."
What does wget -N (timestamping) do?
What interviewers are testing: Whether you distinguish timestamp-based conditional retrieval from no-clobber and content-integrity verification.
-N / --timestamping conditionally retrieves a remote file based on its timestamp and size compared with the local copy, where server metadata permits it. Timestamping compares the normal local filename with the server response—it does not apply when you combine -N with -O (GNU Wget documents that timestamping is ineffective in that case).
mkdir -p /tmp/wget-ts
cd /tmp/wget-ts
wget -q https://example.com/
wget -N https://example.com/File ‘index.html’ not modified on server. Omitting download.https://example.com/ serves index.html with a stable Last-Modified header, so the second run issues a conditional request and omits the body when nothing changed—handy for nightly sync scripts that should be idempotent.
A strong answer is:
"
-Nmakes repeated runs cheap when the remote file has not changed. I use it in cron sync jobs; I still verify with checksums when integrity matters more than timestamps."
What does wget -nc do?
What interviewers are testing: Whether you know -nc skips downloads when the default local filename already exists and how that interacts with -O and -N.
-nc / --no-clobber prevents wget from downloading when a file with the same local name already exists. -nc is designed primarily around Wget's normal local filename handling. With -O, current GNU Wget only accepts the combination when the specified output file does not already exist. -nc and -N cannot be used together.
mkdir -p /tmp/wget-nc
cd /tmp/wget-nc
wget -q https://example.com/
wget -nc https://example.com/File ‘index.html’ already there; not retrieving.The second run sees index.html on disk and skips the transfer instead of overwriting it—useful when a verified or hand-placed artifact must not be replaced by a rerun.
A strong answer is:
"
-ncis a safety rail for the default local filename—if the file exists, wget skips the download. I don't pair it with-O; for explicit output paths I rely on timestamping or separate staging directories."
Recursive download and mirroring
What does wget -r do?
What interviewers are testing: whether you answer what does wget -r do with specific, production-grounded detail—not generic recall.
-r / --recursive follows links and downloads linked pages or files, subject to other limits you set.
A cautious interview answer always mentions constraints:
-l DEPTH— maximum recursion depth (default is 5 without-l)-np/--no-parent— stay under the starting directory- Trailing slash matters —
https://example.com/releases/1.4/andhttps://example.com/releases/1.4are not equivalent for directory-based recursion; HTTP recursion relies on the trailing slash to treat the start URL as a directory hierarchy when applying--no-parent --wait=SECONDS— pause between requests (be polite)-e robots=off— deliberately ignores robots exclusions; use only for content you own or where you have explicit authorization—not a normal mirroring optimization
Example shape (do not run against third-party sites without authorization):
wget -r -l 1 -np --wait=1 https://example.com/docs/A strong answer is:
"
-renables recursive fetching, but I never run bare-ragainst production internet sites. I set depth, no-parent, wait times, and I use-e robots=offonly for content I own or am explicitly authorized to mirror—not as a routine optimization."
How do you mirror a website with wget?
What interviewers are testing: whether you combine -m/-r with -np and rate limits to mirror without crawling parent directories or overloading hosts.
-m / --mirror enables mirror-oriented settings, including recursive retrieval and timestamping. Because mirror mode can recurse deeply, add explicit scope, rate, and request-frequency controls for internet-facing sites (infinite depth by default unless you add -l).
A common offline-docs pattern:
wget -m -k -p -np --wait=1 https://example.com/manual/| Flag | Role |
|---|---|
-m |
Mirror mode |
-k |
Convert links for local viewing |
-p |
Fetch page requisites (images, CSS) |
-np |
Do not climb to parent directories |
Mirroring can generate heavy load. Use --limit-rate, --wait, and a tight -l in real environments.
A strong answer is:
"
-m -k -p -npbuilds an offline-friendly copy. I cap depth and rate, and I only mirror sites I own or have explicit permission to copy."
Why use wget -np (--no-parent)?
What interviewers are testing: whether you use -np to stop recursive downloads from climbing to parent directories during mirrors.
--no-parent stops wget from following links above the starting URL path.
If you start at https://example.com/releases/1.4/, -np prevents climbing to /releases/ or / when a page links upward. Include the trailing slash when you intend to treat the URL as a directory. Pair it with -nH / --no-host-directories or --cut-dirs=N when you want a flatter local tree.
A strong answer is:
"
-npkeeps the mirror inside the subtree I intend—critical when a page links to/or sibling directories I do not want to pull."
Authentication, headers, and HTTPS
How do you download from a password-protected HTTP URL?
What interviewers are testing: Whether you can perform HTTP authentication without exposing long-lived credentials in command history, process listings, or source control.
For HTTP authentication, use HTTP-specific credential flags:
wget --http-user='USERNAME' --ask-password \
https://protected.example.com/file.zipGNU Wget also searches .netrc by default when credentials were not passed directly.
Prefer --ask-password over --password= on the command line—passwords in ps output are a common interview trap. For interactive use, --ask-password avoids putting the password directly on the command line. For unattended automation, use an approved secret mechanism or tightly protected .netrc/Wget configuration, understanding that these files still contain sensitive credentials.
A strong answer is:
"For HTTP I use
--http-userwith--ask-password, or a restricted netrc file. I never embed production passwords in a shared script repo."
How do you pass custom HTTP headers with wget?
What interviewers are testing: Whether you know when adding an HTTP header is sufficient and when the workflow has become API-oriented enough that curl is the clearer tool.
Use --header:
# Illustrative only: do not place production tokens in shell history
wget --header="Authorization: Bearer TOKEN" \
-O /tmp/api.json https://api.example.com/v1/dataYou can repeat --header for multiple lines. Avoid putting production bearer tokens directly in an interactive command or shared script—command lines can be exposed through shell history and process inspection. Inject secrets through an approved secret mechanism for the environment.
For cookie-based sessions, --load-cookies and --save-cookies help replay browser sessions in lab tests.
When the interview shifts to REST verbs or JSON POST bodies, mention that curl is usually simpler—see curl.
A strong answer is:
"
--headeradds Authorization or custom tokens. For tokenized APIs I often use curl instead; wget shines when the goal is still 'save this URL to disk' with one extra header."
How do you handle HTTPS certificate errors with wget?
What interviewers are testing: whether you fix HTTPS failures with --ca-certificate or proper trust stores—not blind --no-check-certificate in production.
By default wget verifies the server certificate using its TLS implementation and exposes CA-specific configuration options. When verification fails you see an error about unable to establish SSL connection.
Point Wget at a specific CA bundle when needed:
wget --ca-certificate=/path/to/company-ca.pem \
https://internal.example.com/filePrefer installing the organization's CA in the system trust store when it should be trusted host-wide. Use --ca-certificate when Wget needs a specific CA bundle for that invocation.
Lab-only bypass (insecure—do not use in production):
wget --no-check-certificate https://selfsigned.lab.local/fileThe production fix is to install the correct CA or add the corporate root to the system trust store—not to disable verification globally.
For deeper TLS work on downloads, see wget ignore certificate error when that matches your lab scenario.
A strong answer is:
"I install the CA in the system trust store when appropriate, or pass
--ca-certificatefor a specific bundle.--no-check-certificateis a lab shortcut only; disabling verification in production invites MITM risk."
wget vs curl, exit codes, and scenarios
How do you set a custom User-Agent with wget?
What interviewers are testing: whether you can explain how to set a custom user-agent with wget with the right steps, tools, and common failure modes.
Some servers block the default Wget/x.x agent. Override with --user-agent:
wget --user-agent="MyDeployBot/1.0" -O /tmp/ua.html https://example.com
wc -c /tmp/ua.html559 /tmp/ua.htmlUse a descriptive agent string when your operations team owns the traffic—vendors can allowlist it. Spoofing a browser user-agent to evade restrictions is an ethics and policy red flag in interviews.
A strong answer is:
"I set
--user-agentto an identifiable bot name our team controls. If a vendor blocks wget entirely, I ask for an allowlist or API token rather than disguising the client."
Scenario: a cron wget job silently stopped updating a file. What do you check?
What interviewers are testing: whether you check wget exit codes, cron mail, -N timestamping, and server-side changes when scheduled downloads stop updating.
Walk interviewers through an ordered checklist:
- Exit code — wrap cron with
wget … || logger -t wget-fetch "failed"or mail on non-zero$? - Log file — add
-o /var/log/wget-artifact.logeven when using-q - Disk space —
df -hon the target filesystem - Permissions — can the cron user write
-O/-Ppaths? - URL still valid —
wget --spider -S URLfor 404/403 changes - Timestamping —
-Nmay skip download when the remote reports unchanged; confirm that is still desired - Proxy / TLS — corporate proxy env vars or expired CA after a middleware change
A strong answer is:
"I start with exit code and logs, then disk and permissions, then spider the URL for 404 or auth changes. If we use
-N, I confirm the remote actually published a newer file. Silent cron failures almost always mean we were not logging or alerting on$?."
How do you verify a downloaded artifact?
What interviewers are testing: Whether you separate transfer success, content integrity, and publisher authenticity instead of treating a zero Wget exit code as supply-chain verification.
Download success only means the transfer completed—not that the file is intact or authentically published.
wget -O /tmp/release.tar.gz https://vendor.example.com/release.tar.gz
printf '%s %s\n' \
'EXPECTED_SHA256_HERE' \
'/tmp/release.tar.gz' |
sha256sum -c -A checksum from a trusted source verifies integrity. A cryptographic package/repository or detached signature can additionally verify publisher authenticity, assuming you trust and validate the signing key.
When the vendor publishes them:
- Compare against the expected SHA-256 checksum from a trusted source
- Verify a detached signature or package/repository signature where supported
A strong answer is:
"After downloading a release artifact, I verify its checksum against a trusted published value and verify the publisher's signature when available. A successful HTTP transfer alone is not an integrity or authenticity check."

