Blog

MCQs

Disclaimer:

Educational Use Only:

The website links provided are to be used strictly for educational and knowledge-gaining purposes only.

No Misuse:

Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.

Respect for Websites and Businesses:

Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.

Acknowledge Value of Knowledge:

Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.

No Endorsement:

The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.

User Responsibility:

By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.


  1. What does cURL stand for?
    a. Client URL
    b. Client Utility for Remote Links
    c. Common URL Retriever
    d. Command URL Library
    Answer: a. Client URL — cURL is short for “Client URL” utility. (InterviewPrep)
  2. Which library is used by cURL to perform its underlying data transfer?
    a. OpenSSL
    b. libcurl
    c. cTransform
    d. netlib
    Answer: b. libcurl — cURL uses libcurl as its underlying library. (onlineinterviewquestions.com)
  3. Which protocols are supported by cURL?
    a. HTTP, HTTPS, FTP only
    b. HTTP, HTTPS, FTP, SCP, SFTP, LDAP, etc.
    c. Only HTTP and HTTPS
    d. Only FTP and SFTP
    Answer: b. HTTP, HTTPS, FTP, SCP, SFTP, LDAP, etc. — cURL supports many protocols via libcurl. (InterviewPrep)
  4. To disable SSL certificate verification in cURL (not recommended for production), which option is used?
    a. –ssl-noverify
    b. -k / –insecure
    c. –no-ssl-check
    d. -x noverify
    Answer: b. -k / –insecure — this option disables certificate validation. (InterviewPrep)
  5. Which of the following cURL options allows you to set a custom HTTP header?
    a. -H
    b. -C
    c. -D
    d. -X
    Answer: a. -H — use -H “Header: value” to add custom headers. (InterviewPrep)
  6. In cURL, which option is used to send a POST request?
    a. -G
    b. -X POST
    c. -F
    d. -T
    Answer: b. -X POST — you explicitly set the method to POST. (InterviewPrep)
  7. Which cURL option is used to upload a file to a remote server?
    a. -u
    b. -F
    c. -U
    d. -A
    Answer: b. -F — for multipart/form upload or file upload. (InterviewPrep)
  8. What is the effect of using –limit-rate option in cURL?
    a. Limits upload bandwidth
    b. Limits download bandwidth
    c. Limits both upload and download rate
    d. Limits connection count
    Answer: c. Limits both upload and download rate — it constrains the transfer rate. (InterviewPrep)
  9. Which cURL option can be used to resume a previously interrupted download?
    a. –continue
    b. -r
    c. -C –
    d. –resume
    Answer: c. -C – — “-C –” tells cURL to resume from where it left off. (InterviewPrep)
  10. What does curl -I http://example.com do?
    a. Fetches the full HTML of the page
    b. Fetches only headers of the response
    c. Downloads images only
    d. Fetches response body and headers
    Answer: b. Fetches only headers of the response — -I (uppercase i) sends HTTP HEAD request. (InterviewPrep)
  11. Which cURL option follows HTTP redirects automatically?
    a. –redirect
    b. -L
    c. –follow
    d. -R
    Answer: b. -L — tells cURL to follow redirects (HTTP 3xx). (InterviewPrep)
  12. In context of security, what risk does using -k / –insecure pose?
    a. It disables HTTP (only allows HTTPS)
    b. It allows man-in-the-middle attacks by not verifying certificates
    c. It forces usage of weak ciphers
    d. It disables authentication
    Answer: b. It allows man-in-the-middle attacks by not verifying certificates — skipping certificate checks undermines TLS trust. (InterviewPrep)
  13. Which option in cURL allows basic HTTP authentication (username:password)?
    a. -u user:pass
    b. –auth user:pass
    c. -A user:pass
    d. -U user:pass
    Answer: a. -u user:pass — basic authentication is provided with -u. (InterviewPrep)
  14. Which cURL option is used to set a timeout for connection?
    a. –connect-timeout
    b. –conn-time
    c. –timeout
    d. –wait
    Answer: a. –connect-timeout — sets the time limit for the connection phase. (InterviewPrep)
  15. Which cURL option sets a maximum total time for the request (all phases)?
    a. –max-time
    b. –timeout-total
    c. –total-time
    d. –tlimit
    Answer: a. –max-time — this limits the entire operation time. (InterviewPrep)
  16. What does curl -v do?
    a. Validates SSL certificates
    b. Gives verbose output (headers, etc.)
    c. Validates URLs
    d. Verifies redirections
    Answer: b. Gives verbose output (headers, etc.) — verbose mode prints request/response details. (InterviewPrep)
  17. Which cURL flag makes it silent (no progress meter or messages)?
    a. –quiet
    b. -q
    c. -s
    d. –silent-mode
    Answer: c. -s — silent mode suppresses progress meter and informational messages. (InterviewPrep)
  18. Which cURL option allows sending data in the request body (for POST)?
    a. -d
    b. -D
    c. -X
    d. -p
    Answer: a. -d — curl -d “data” sends POST data. (InterviewPrep)
  19. In cURL, which option writes output to a file instead of stdout?
    a. -w
    b. -o
    c. -O
    d. –out
    Answer: b. -o — use -o filename to direct output. (InterviewPrep)
  20. What is the difference between -o and -O in cURL?
    a. -o writes to given name; -O writes to remote filename
    b. -o writes uppercase; -O writes lowercase
    c. -o is for headers; -O is for body
    d. No difference
    Answer: a. -o writes to given name; -O writes to remote filename — -O uses remote file name from URL. (InterviewPrep)
  21. Which cURL option shows only HTTP response code?
    a. –code
    b. –status
    c. -w “%{http_code}”
    d. -s
    Answer: c. -w “%{http_code}” — using -w with variable outputs the HTTP code. (InterviewPrep)
  22. To reuse a previous connection (TCP) in multiple cURL requests, which option is useful?
    a. –keepalive
    b. –reuse
    c. –keep-alive
    d. libcurl handles it internally via keep-alive by default
    Answer: d. libcurl handles it internally via keep-alive by default — cURL and libcurl may reuse connections when supported. (InterviewPrep)
  23. What does –cookie option in cURL do?
    a. Clears cookies
    b. Sends cookies provided from string/file
    c. Disables cookie support
    d. Encrypts cookies
    Answer: b. Sends cookies provided from string/file — you can pass cookie header or file. (InterviewPrep)
  24. Which cURL option can store cookies received from server to a file?
    a. –cookie-file
    b. -c
    c. -C
    d. –cookie-save
    Answer: b. -c — curl -c cookies.txt writes cookies to file. (InterviewPrep)
  25. If you want to load cookies from a file into your request in cURL, which option do you use?
    a. -c
    b. -b
    c. –load-cookies
    d. –cookie-load
    Answer: b. -b — curl -b cookies.txt loads cookies from file. (InterviewPrep)
  26. Which option forces IPv4 in cURL?
    a. -4
    b. –ipv4
    c. -v4
    d. –force-ipv4
    Answer: a. -4 — curl -4 forces using IPv4. (InterviewPrep)
  27. Which option forces IPv6 in cURL?
    a. -6
    b. –ipv6
    c. -v6
    d. –force-ipv6
    Answer: a. -6 — curl -6 forces IPv6. (InterviewPrep)
  28. What does –head do in cURL?
    a. Perform HEAD request (same as -I)
    b. Combine headers in output
    c. Display only headers and body
    d. Strip body
    Answer: a. Perform HEAD request (same as -I) — –head issues a HEAD. (InterviewPrep)
  29. Which cURL option limits number of redirects to follow?
    a. –max-redirect
    b. –redir-limit
    c. –limit-redirect
    d. -R
    Answer: a. –max-redirect — sets maximum redirects count. (InterviewPrep)
  30. To provide a client SSL certificate for mutual TLS authentication in cURL, which option is used?
    a. –cert
    b. –client-cert
    c. –ssl-cert
    d. –tls-cert
    Answer: a. –cert — you pass client certificate with –cert. (InterviewPrep)
  31. Which cURL option allows specifying the private key file along with the certificate?
    a. –key
    b. –private
    c. –pkey
    d. –ssl-key
    Answer: a. –key — –key keyfile used to specify private key associated with cert. (InterviewPrep)
  32. What is the purpose of –cacert in cURL?
    a. To specify a CA certificate file to verify server certificate
    b. To disable CA checks
    c. To generate CA file
    d. To use default CA only
    Answer: a. To specify a CA certificate file to verify server certificate — you can point to a CA cert bundle. (InterviewPrep)
  33. Which cURL option allows you to use a specific TLS version (for example TLS 1.2)?
    a. –tls1.2
    b. –tlsv1.2
    c. –tlsver 1.2
    d. –tls-version
    Answer: b. –tlsv1.2 — you can force usage of TLS 1.2 with –tlsv1.2. (InterviewPrep)
  34. Which option is used to suppress certificate hostname mismatch check (not secure)?
    a. –insecure
    b. –no-hostname-check
    c. –skip-hostname
    d. -k already suppresses both certificate and hostname checks
    Answer: d. -k already suppresses both certificate and hostname checks — -k disables peer and host verification. (InterviewPrep)
  35. How can you make cURL output only the response body, suppressing headers?
    a. -i
    b. -s
    c. –no-header
    d. -sS (with no -i)
    Answer: b. -s (silent) in combination with not using -i ensures only body is printed. (InterviewPrep)
  36. Which cURL option displays error messages even when in silent mode?
    a. -S
    b. –show-error
    c. –error
    d. -e
    Answer: a. -S — when used with -s, -S makes error messages still visible. (InterviewPrep)
  37. In context of APIs and cybersecurity, why is it important to always verify SSL/TLS certificates when using cURL?
    a. To improve performance
    b. To validate server identity and prevent MITM attacks
    c. To avoid rate limiting
    d. To enable caching
    Answer: b. To validate server identity and prevent MITM attacks — verifying certificates ensures secure channel. (InterviewPrep)
  38. What happens if you use –http2 in cURL when the server supports HTTP/2?
    a. It forces fallback to HTTP/1.1
    b. It enables HTTP/2 usage
    c. It disables HTTPS
    d. It errors out
    Answer: b. It enables HTTP/2 usage — if both client and server support, cURL negotiates HTTP/2. (InterviewPrep)
  39. Which cURL option allows you to retry failed transfers automatically?
    a. –retry
    b. –auto-retry
    c. –retry-on-fail
    d. –retries
    Answer: a. –retry — you can specify the number of retries. (InterviewPrep)
  40. What does –retry-delay do in cURL?
    a. Sets delay between retries
    b. Sets total timeout for retries
    c. Sets maximum number of retries
    d. Cancels retry if delay exceeded
    Answer: a. Sets delay between retries — controls pause between retry attempts. (InterviewPrep)
  41. What is the purpose of –url option in cURL?
    a. To specify the URL explicitly
    b. To show URL in output
    c. To validate URL
    d. To restrict URL length
    Answer: a. To specify the URL explicitly (useful in scripts) — curl –url http://… is equivalent to passing the URL argument. (InterviewPrep)
  42. If you want to upload raw data (non-multipart) via PUT method, which cURL option is appropriate?
    a. -d with -X PUT
    b. -F
    c. -T
    d. –upload-data
    Answer: c. -T — curl -T file sends file via PUT. (InterviewPrep)
  43. In a security test, you want to throttle connection speed to simulate a slow client using cURL; which option is best?
    a. –limit-rate
    b. –speed-limit
    c. –throttle
    d. –slow
    Answer: a. –limit-rate — you can artificially restrict bandwidth. (InterviewPrep)
  44. Which cURL option instructs it to resolve the host name to a specific IP address (overriding DNS)?
    a. –resolve
    b. –host-ip
    c. –dns-override
    d. –force-ip
    Answer: a. –resolve — allows specifying “host:port:address”. (InterviewPrep)
  45. Which option lets you pass data from standard input (stdin)?
    a. -d @-
    b. -F @-
    c. –data @-
    d. All of the above depending on context
    Answer: a. -d @- — @- reads data from stdin for -d. (InterviewPrep)
  46. What does –upload-file do in cURL?
    a. Uploads file via FTP
    b. Upload file via PUT or SCP depending on URL
    c. Sends file as part of POST body
    d. Downloads file
    Answer: b. Upload file via PUT or SCP depending on URL — –upload-file is alias for -T. (InterviewPrep)
  47. Which option tells cURL to fail on HTTP errors (e.g. status 400/500) instead of outputting body?
    a. –fail
    b. –error-on-fail
    c. –fail-on-error
    d. –exit-on-error
    Answer: a. –fail — –fail (or -f) makes cURL fail silently on HTTP errors. (InterviewPrep)
  48. In a security audit, you want to test for TLS renegotiation issues; which cURL option can help?
    a. –no-renegotiation
    b. –tls-renegotiation
    c. –renegotiate
    d. –disable-reneg
    Answer: a. –no-renegotiation — disables TLS renegotiation if supported. (InterviewPrep)
  49. Which option can make cURL show timing information about different phases (DNS, connect, etc.)?
    a. –time-info
    b. -w
    c. –stats
    d. –timing
    Answer: b. -w — using -w with format variables, you can show detailed timing (e.g. %{time_connect}, %{time_total}). (InterviewPrep)
  50. For debugging TLS, which cURL option gives verbose info about SSL handshake?
    a. –ssl-debug
    b. –tls-debug
    c. -v or –verbose (with SSL output)
    d. –ssl-verbose
    Answer: c. -v or –verbose (with SSL output) — verbose mode shows SSL handshake details if compiled with debug symbols. (InterviewPrep)

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!