30 curl interview questions and answers for hiring teams
Thirty curl questions for DevOps, backend and QA hires, with model answers, red flags, a live terminal task and a simple scoring rubric.

These curl interview questions help hiring teams check whether a DevOps, SRE, backend, API or QA candidate can really use curl to send HTTP requests, debug APIs and script health checks. Each question below comes with what a strong answer includes and the red flag to listen for, so interviewers who are not curl experts can still score answers the same way.
TL;DR
- Good curl interview questions test how a candidate reads network behavior, not whether they memorized flags. Ask them to explain
curl -voutput or find where a slow request loses time. - Split questions into basic (requests, headers, output), intermediate (auth, TLS, proxies, timeouts) and advanced (debugging, CI health checks, redirects, security).
- The strongest single question is "what happens when you run curl on an HTTPS URL?" A strong candidate walks through DNS, TCP, TLS, the request and the response.
- A 15-minute live task at a terminal shows more skill than ten verbal questions. Give a broken request and ask the candidate to find the cause.
- Score every answer on a 1 to 4 scale with written evidence, and hire DevOps, SRE and backend engineers who score 3 or above on most questions.
- Run a short curl skills test before the interview so panel time goes only to candidates who already know the basics.

What is curl and why do interviewers ask about it?
curl is a free command-line tool and library (libcurl) for transferring data with URLs over HTTP, HTTPS, FTP, SFTP, SMTP and many other protocols. Interviewers ask about curl because engineers use it every day to call APIs, test endpoints, download files and check whether a service is up, so curl answers show hands-on skill quickly.
curl is everywhere. The curl project says its library is the transfer engine in over twenty billion installations, from phones and cars to routers and TVs, and the latest stable release at the time of writing is 8.23.0 from October 2026. For a plain-English refresher before the interview, the curl glossary entry covers the basics.
Because curl sits on almost every server and laptop, it is a fair, tool-neutral way to test how well a candidate understands HTTP, TLS and networking. A candidate who can read a verbose curl trace usually understands what their code does on the wire.
Which roles need curl interview questions?
Curl interview questions fit any role that builds, tests or runs services that talk over HTTP. The table below shows which question groups to use for each role, so you do not waste a backend interview on file transfer or a QA interview on TLS client certificates.
Role | Focus areas | Questions to start with |
|---|---|---|
DevOps engineer, SRE | Health checks, timeouts, retries, exit codes, TLS, proxies | 16, 18, 20, 21, 22, 23, 24, 28 |
Backend or API developer | Methods, JSON bodies, headers, auth, status codes, redirects | 3, 8, 9, 11, 12, 19, 25, 26 |
QA or API tester | Requests, status codes, cookies, uploads, scripted checks | 2, 4, 8, 13, 14, 19, 23, 30 |
Linux or system administrator | Downloads, proxies, certificates, exit codes, scripting | 3, 6, 16, 18, 20, 27, 28, 29 |
Network or security engineer | DNS, TLS, mTLS, | 16, 17, 21, 22, 27, 29 |
Demand for these roles keeps growing. The US Bureau of Labor Statistics projects employment of software developers, QA analysts and testers to grow 10% from 2025 to 2035, with about 106,100 openings a year and a median pay of $134,040 in May 2025. With that much competition for engineers, a clear and fair technical screen matters.
If you are hiring for one of these roles, pair this list with our API tester interview questions, Linux system administrator interview questions or CI/CD developer interview questions.
What are basic curl interview questions?
Basic curl interview questions cover sending requests, choosing the HTTP method, adding headers and saving or reading the output. Use them in a screening call or as warm-ups. Every working engineer in the roles above should answer all ten with little hesitation.
curl lives in the terminal, so shell skills come with it. The Stack Overflow Developer Survey 2025 found that 48.8% of professional developers used Bash or shell in the past year, so most candidates will be comfortable at a command line.
1. What is curl, and what would you use it for?
curl is a command-line tool and library for sending requests to URLs and transferring data. Engineers use it to call and test APIs, download files, check headers and status codes, and script health checks.
- Strong answer: Names real uses from their own work, such as testing an endpoint after a deploy, and mentions libcurl or the wide protocol support.
- Red flag: Can only say "it downloads web pages" and has no example of using it.
2. What HTTP method does curl use by default, and how do you change it?
curl sends a GET request by default. Sending data with -d switches it to POST, -I sends HEAD, and -X sets any method, such as -X PUT or -X DELETE.
- Strong answer: Knows that
-dalready implies POST, so-X POST -d ...is redundant, and that-Xonly changes the method word, not how curl behaves. - Red flag: Uses
-X GETor-X POSTeverywhere without knowing why.
3. How do you save a response to a file?
The -o filename option writes the response to a file you name, and -O saves it under the file name from the URL. Without either, curl prints the body to standard output.
- Strong answer: Also mentions
-Lfor downloads that redirect and-C -to resume a broken download. - Red flag: Redirects output with
>but cannot explain-oversus-O.
4. What is the difference between -I and -i?
The -I option sends a HEAD request and shows only the response headers. The -i option sends the normal request and includes the response headers above the body in the output.
- Strong answer: Notes that some servers answer HEAD differently from GET, so
-ior-vis safer when checking a real response. - Red flag: Mixes the two up or thinks both only change what is printed.
5. What does -v show, and when would you use it?
The -v (verbose) option shows the connection steps, the TLS handshake, the request headers curl sent (lines starting with >) and the response headers it got back (lines starting with <). Engineers use it as the first step when a request fails.
- Strong answer: Reads a short
-vtrace out loud and spots the status code, theHostheader and the certificate details. Knows--trace-asciigives even more detail. - Red flag: Has never looked at verbose output.
6. How do you make curl follow redirects?
The -L option makes curl follow redirects. Without it, curl stops at the 301, 302, 307 or 308 response and prints that response instead of the final page.
- Strong answer: Mentions
--max-redirsto cap the number of hops and knows redirects can change the method (see question 25). - Red flag: Assumes curl follows redirects on its own like a browser.
7. What do -s and -S do?
The -s (silent) option hides the progress meter and error messages. Adding -S brings error messages back, so -sS gives clean output in scripts while still showing what went wrong.
- Strong answer: Explains why
-salone in a script can hide real failures. - Red flag: Uses
-severywhere and cannot explain why errors vanished.
8. How do you send a POST request with a JSON body?
A JSON POST needs the body and the right content type: curl -H "Content-Type: application/json" -d '{"name":"Ana"}' https://api.example.com/users. Since curl 7.82.0, --json '{"name":"Ana"}' sets the body plus the Content-Type and Accept headers in one step.
- Strong answer: Knows that
-dalone sendsapplication/x-www-form-urlencoded, so many APIs reject the body without the header. Uses-d @body.jsonfor longer payloads. - Red flag: Forgets the header and blames the API when the request fails.
9. How do you add custom headers?
The -H option adds or replaces a request header, for example -H "Accept: application/json" or -H "X-Request-Id: 123". You can repeat -H as many times as you need.
- Strong answer: Knows that
-H "Header;"sends an empty header and-H "Header:"removes one curl would add by default. - Red flag: Puts several headers in one
-Hstring.
10. What is the difference between curl and wget?
curl and wget both fetch URLs, but curl is built for single transfers in many protocols, supports every HTTP method and has a library for code. wget is built for downloading, can mirror whole sites recursively and follows redirects by default.
- Strong answer: Picks the tool for the job: wget to mirror a site, curl to test an API or script a request.
- Red flag: Says they are the same, or cannot name one real difference.
What are intermediate curl interview questions?
Intermediate curl interview questions cover authentication, cookies, uploads, TLS certificates, proxies, status codes and timeouts. Use them in the main technical round. A candidate who answers most of these well can use curl in daily API and infrastructure work without help.
To explain the API ideas behind these questions to non-engineers on the panel, the REST API glossary entry and the HTTP glossary entry are good primers.
11. How do you send a request with basic authentication?
The -u user:password option sends HTTP basic authentication, which curl turns into an Authorization: Basic header with the credentials base64-encoded. Base64 is encoding, not encryption, so basic auth should only travel over HTTPS.
- Strong answer: Avoids typing passwords on the command line, where they land in shell history and the process list. Uses
-u user(curl then prompts), a.netrcfile or a config file instead. - Red flag: Thinks base64 protects the password.
12. How do you call an API that uses a bearer token?
A bearer token goes in a header: -H "Authorization: Bearer $TOKEN". Reading the token from an environment variable or a secrets manager keeps it out of scripts and logs.
- Strong answer: Mentions that
-vprints theAuthorizationheader, so verbose logs from CI jobs can leak tokens. - Red flag: Pastes tokens straight into commands they then share in chat or tickets.
13. How do you keep cookies between requests?
The -c cookies.txt option saves cookies the server sets into a cookie jar file, and -b cookies.txt sends them back on the next request. For a single cookie, -b "session=abc123" works too.
- Strong answer: Walks through a login flow: POST the login form with
-c, then call a protected page with-b. - Red flag: Copies a session cookie by hand into every request without knowing about the cookie jar.
14. How do you upload a file with curl?
The -F "file=@report.pdf" option uploads a file as a multipart form, the same way a browser form does. The -T file option uploads it with PUT, and --data-binary @file sends the file as the raw request body.
- Strong answer: Matches the method to what the API expects and checks the API docs for the field name.
- Red flag: Uses
-d @filefor binary data, which can corrupt it.
15. What is the difference between -d, --data-binary and --data-urlencode?
The -d option sends data as given, but when reading from a file with @ it strips newlines and carriage returns. The --data-binary option sends the data exactly as it is, and --data-urlencode URL-encodes the value first.
- Strong answer: Uses
--data-binaryfor files and--data-urlencodefor form values with spaces or special characters. - Red flag: Treats all three as the same.
16. What does -k (--insecure) do, and when is it acceptable?
The -k option tells curl to skip TLS certificate checks, so the connection is still encrypted but curl no longer confirms who is on the other end. It is only acceptable for a quick local test against a self-signed certificate, never in scripts or production.
- Strong answer: Fixes the real problem with
--cacert(trust a specific CA file) or by adding the company CA to the system store. For more context, our SSL certificate glossary entry explains certificate chains. - Red flag: Adds
-kto every script "because it fixes errors".
17. How do you call a service that needs a client certificate (mutual TLS)?
Mutual TLS needs curl to present its own certificate, using --cert client.pem and --key client.key, plus --cacert when the server uses a private CA. The server then checks the client certificate during the TLS handshake.
- Strong answer: Can read the
-voutput to tell a client certificate failure from a server certificate failure. - Red flag: Has never heard of client certificates in a role that uses them.
18. How does curl use a proxy, and how do you bypass it?
The -x host:port option sends requests through a proxy, and curl also reads the http_proxy, HTTPS_PROXY and NO_PROXY environment variables. The --noproxy option skips the proxy for listed hosts.
- Strong answer: Knows the classic trap: curl works in a shell with proxy variables set, while the app runs without them, so it fails. Checks
env | grep -i proxyfirst. - Red flag: Cannot explain why the same URL behaves differently on two machines.
19. How do you get only the HTTP status code?
The command curl -s -o /dev/null -w "%{http_code}" URL hides the body and progress and prints only the status code. The -w (write-out) option can print many other values too, such as total time or the final URL.
- Strong answer: Uses this in scripts and knows
%{url_effective}shows where redirects ended. - Red flag: Greps the full response for the status text.
20. How do you set timeouts, and why does it matter?
The --connect-timeout option limits how long curl waits to connect, and -m (--max-time) limits the whole transfer. Without --max-time, a curl call to a hung server can wait for a very long time and block a script or deploy.
- Strong answer: Always sets both in scripts and picks values from the service's normal response time.
- Red flag: Has never set a timeout in a script.
What are advanced and scenario-based curl interview questions?
Advanced curl interview questions ask candidates to explain the full request path, debug slow or failing calls, build health checks and handle redirects and secrets safely. Use them for senior DevOps, SRE and backend roles. These questions show judgment, not just flag knowledge, and they work best as open conversations.
21. What happens when you run url https://example.comc?
Running curl on an HTTPS URL starts with parsing the URL and resolving the host name through DNS. curl then opens a TCP connection to port 443, runs the TLS handshake (sending the host name with SNI and checking the server certificate), agrees on HTTP/2 or HTTP/1.1, sends the request headers, and prints the status, headers and body it gets back.
- Strong answer: Covers every stage in order and says how to see each one in
-voutput. Senior candidates add certificate chain checks and connection reuse. - Red flag: Jumps from "it sends a request" to "it gets HTML" with nothing in between.
22. A request is slow. How do you find out where the time goes?
A slow request can be broken down with -w timers: time_namelookup (DNS), time_connect (TCP), time_appconnect (TLS), time_starttransfer (first byte) and time_total. Each timer counts from the start, so subtracting the previous one gives each stage's own time.
- Strong answer: Ties each slow stage to a cause: DNS points to the resolver, connect to the network or firewall, TLS to the certificate chain, first byte to the app or database, and the rest to response size.
- Red flag: Only reruns the request and says "the server is slow".
23. How would you use curl in a health check or deploy gate?
A curl health check should fail loudly: curl -fsS --max-time 5 --retry 3 https://service/health. The -f option makes curl exit with an error (code 22) on HTTP 400 or above, because without it curl exits with 0 even when the server returns 500.
- Strong answer: Knows
--fail-with-bodykeeps the error body for logs, and checks the exit code in the script, not just the output. - Red flag: Writes a deploy gate that passes when the service returns 503.
24. When does --retry actually retry?
The --retry option retries only on errors curl treats as temporary, such as timeouts and HTTP 408, 429, 500, 502, 503 and 504. It does not retry a 404 or a 401, and --retry-all-errors widens it to every failure.
- Strong answer: Warns that retrying a POST that creates something can create it twice, so retries suit safe, repeatable requests.
- Red flag: Expects
--retryto fix a wrong URL.
25. Why does a POST body disappear after a redirect?
A POST body disappears because, with -L, curl changes POST to GET when it follows a 301, 302 or 303 redirect, as browsers do. A 307 or 308 redirect keeps the method and body, and the --post301 and --post302 options keep POST for the older codes.
According to MDN Web Docs, a 307 guarantees the client will not change the method and body, while older clients changed a 302 into a GET.
- Strong answer: Fixes the root cause by calling the final URL or asking the API team to use 307 or 308.
- Red flag: Cannot explain why the server receives an empty request.
26. A request works in the browser but fails in curl. What do you check?
A browser-versus-curl failure usually comes from something the browser adds: cookies or a session, headers such as User-Agent or Accept, a company CA the browser trusts but curl does not, or proxy settings. Comparing both requests side by side finds the difference.
- Strong answer: Uses the browser developer tools "Copy as cURL" option, then removes headers one at a time until the request breaks.
- Red flag: Guesses at random flags without comparing the two requests.
27. How do you test a specific server without changing DNS?
The --resolve example.com:443:10.0.0.5 option makes curl connect to that IP address while still sending the right host name for TLS and the Host header. This is how engineers test one server behind a load balancer or a new server before a DNS change.
- Strong answer: Explains why
-H "Host: example.com"with an IP address breaks HTTPS: the certificate check and SNI still use the IP. - Red flag: Edits
/etc/hostson a shared machine and forgets to undo it.
28. What do curl exit codes tell you?
curl exit codes tell a script what failed: 6 means the host could not be resolved, 7 means the connection failed, 28 means a timeout, 35 is a TLS handshake error, 60 is a certificate problem, and 22 is an HTTP error when -f is set.
- Strong answer: Branches on
$?in scripts and logs the code, so alerts say "DNS failed" instead of "health check failed". - Red flag: Treats any non-zero code as the same failure.
29. What security risks come with curl, and how do you reduce them?
The main curl security risks are leaked secrets and running untrusted code. Passwords and tokens on the command line end up in shell history, process lists and CI logs, and curl ... | bash runs a remote script without review.
- Strong answer: Keeps secrets in files or environment variables, downloads install scripts first, reads them and checks a checksum or signature before running. Never uses
-kto silence certificate errors. - Red flag: Pipes install scripts into a shell with
sudoas a habit.
30. You need to call an API 500 times. How would you do it, and when would you stop using curl?
Calling an API 500 times works with a shell loop, xargs -P or curl's own --parallel option (curl 7.66.0 and later) for a quick check. For real load testing, retries with backoff or complex logic, a script in Python or a load testing tool is a better fit.
- Strong answer: Knows curl's limits and can say when Postman, a script or a load testing tool is the right next step.
- Red flag: Plans a full load test with a bash loop and no rate limit.
How do you run a hands-on curl task in an interview?
A hands-on curl task gives the candidate a terminal, a small test API and a broken request, then asks them to find and fix the problem in 15 minutes. Watching how someone debugs shows more real skill than any verbal answer, and it is hard to fake.
- Set up a test endpoint: Use a small internal service or a local mock that returns JSON, needs a bearer token and redirects once.
- Hand over a broken command: For example, a POST with no
Content-Type, a missing token and no-L. - Ask the candidate to think out loud: Note whether they reach for
-vfirst and read the response. - Add one twist: Make the endpoint slow and ask where the time goes (question 22).
- Allow the man page: Real engineers check
man curl. Score the reasoning, not recall.
Pro tip: Use the same task and the same twist for every candidate in a role. A shared task is the only way panel scores stay comparable across interviewers.
How should you score curl interview answers?
Curl interview answers are easiest to compare when every interviewer uses the same 1 to 4 scale and writes down the evidence behind each score. The rubric below works for verbal questions and the live task alike.
Score | Label | What the answer sounds like |
|---|---|---|
1 | Not yet | Knows curl fetches URLs but cannot explain flags or read |
2 | Basic | Sends GET and POST requests, adds headers, saves output; needs help to debug |
3 | Working | Handles auth, TLS, timeouts and |
4 | Strong | Explains each network stage, picks the right fix quickly and spots security risks |
For most DevOps, SRE and backend roles, look for 3 or above on most questions and on the live task. For QA or support engineering roles, 2 or above on the basic and intermediate questions is often enough.
What red flags show up in curl interviews?
Red flags in curl interviews are habits that cause outages or security issues in real work. One red flag is a coaching point. A pattern of them, especially around TLS and secrets, is a reason to stop.
- Using
-kto fix certificate errors: It hides man-in-the-middle risk instead of solving the trust problem. - No
-fin scripts: Health checks pass while the service returns 500 errors. - No timeouts: Scripts and pipelines hang on a dead endpoint.
- Secrets on the command line: Tokens leak into shell history and CI logs.
- Memorized flags, no reasoning: The candidate lists options but cannot read a
-vtrace. - Blaming the server first: No attempt to split the request into DNS, connect, TLS and server time.
Key takeaway: Weight debugging and security answers above flag recall. A candidate who reads -v output well can look up any flag in seconds.Where do curl questions fit in the hiring process?
Curl questions fit after a short skills test and before the final panel. Testing first filters out candidates who lack the basics, so interview time goes to scenario questions and the live task instead of definitions.
- Skills test: Send the Testlify Curl test with the application. It has 15 questions in 15 minutes at intermediate level and covers syntax, authentication, response parsing, uploads and downloads, scripting and SSL/TLS.
- Screen call: Ask five basic questions (1 to 10) to confirm the test result.
- Technical round: Pick intermediate and advanced questions from the role table above.
- Live task: Run the 15-minute broken-request task.
- Panel score: Compare every candidate on the same 1 to 4 rubric.
For DevOps and platform roles, pair the Curl test with the Linux test or the Bash test. Testlify includes 20+ proctoring checks, such as tab tracking and copy-paste blocking, so remote test results reflect the candidate's own work.
Ready to screen curl skills before the interview?
Testlify lets you send a curl skills test with every application and see a ranked list before you book a single call. Combine it with any of the 3,500+ tests in the Testlify test library to cover Linux, APIs, Docker and more in one assessment. Start a 7-day free trial, no credit card needed.
Frequently asked questions about curl interviews
Content Writer
Yashika Khandelwal is a Content Writer with 3+ years of experience creating research-backed content on hiring, talent assessment, and HR technology. She is a registered Organizational Psychologist and subject matter expert who combines behavioral science with practical recruitment insights to produce accurate, evidence-based content.
LinkedInRelated resources
View all
Interview questions
Attention to detail interview questions: 20 to ask and what to look for

Interview questions
25 casual interview questions to ask candidates

Interview questions
30 Redis interview questions with answers for 2027

Interview questions
40 leadership interview questions to ask candidates (and what to listen for)

Interview questions
45 Informational interview questions to ask with answers

Interview questions
Interesting interview questions to ask candidates (and what each reveals)
Get started.
Hire on proof, not resumes.
Run your first skills-based assessment free — no credit card required.