Scenario-Based Cloudflare Interview Questions (2027)
44 scenario-based Cloudflare interview questions by level: proxied mail, 413 uploads, cache leaks, DNSSEC moves, Worker rollbacks, mTLS, Zero Trust.
Scenario-based Cloudflare interview questions describe a real problem on a site or API behind Cloudflare, such as mail breaking after a DNS move, API clients receiving challenge pages, a cache rule leaking personal pages or a Worker release that broke production, and ask how you would diagnose and fix it. Interviewers listen for the Cloudflare feature involved, the order you check things in and how you prevent a repeat. This page has 44 scenarios grouped by experience level.
Product names, limits and behaviour were checked against developers.cloudflare.com in November 2026. Many Cloudflare features depend on plan; answers say so where it matters.
Key takeaways
- Start every Cloudflare scenario by asking whether the record is proxied, which plan the zone is on and what Security Events or analytics show for the request.
- Many beginner scenarios come from proxying records that are not HTTP, such as mail and SSH hosts.
- Mid-level scenarios involve caching rules, rate limiting, Workers releases, DNSSEC and certificates.
- Senior scenarios cover resilience when Cloudflare itself has a problem, Zero Trust rollouts, mTLS for APIs, logging for compliance and event traffic.
- Security scenarios here are defensive: protect the origin, tune rules and monitor. Interviewers expect you to avoid disabling protection globally to fix one path.
How this page differs from our Cloudflare engineer guide
Our Cloudflare engineer interview questions guide is the main reference. It explains each product and includes the classic error-code scenarios: 521, 522, 524, 525 and 526, redirect loops, Tunnel error 1033 and Workers CPU limits. This page uses different cases, the kind that come up once a team has been running on Cloudflare for a while, and groups them by level.
| Symptom | First place to look | Question |
|---|---|---|
| Mail or SSH broke after moving DNS | Proxy status of the record | 1, 2 |
| Clients get HTML challenge pages | Security Events for the request | 6 |
| Upload fails with 413 | Plan request body limit | 7 |
| Users see someone else's page | Cache Rules on HTML | 13 |
| Domain stops resolving after move | DS record at the registrar | 18 |
| Bad Worker release | Deployments and versions | 20 |
Cloudflare scenarios for freshers
1. You moved a domain's DNS to Cloudflare and incoming email stopped. What happened?
Most likely the A record for the mail host (for example mail.example.com) was imported as proxied. Cloudflare's proxy handles HTTP and HTTPS traffic, not SMTP, so mail servers trying to connect reach Cloudflare instead of the mail server. Set that record to DNS only and check that the MX records point to a hostname whose A record is DNS only. Verify with dig MX example.com and dig mail.example.com.
2. After proxying a record, you cannot SSH to the server by its hostname. Why?
The proxy listens on a set of HTTP and HTTPS ports and does not forward SSH. Use a separate DNS-only hostname for SSH, or better, reach the server through Cloudflare Tunnel with Access so port 22 is not open to the internet. Spectrum can proxy other TCP protocols on supported plans.
3. The site loads over HTTPS but the browser shows mixed content warnings. What do you change?
The page loads some resources over http://. Turn on Automatic HTTPS Rewrites, which rewrites links to HTTPS where it can, and fix the hard-coded URLs in the application or CMS. A Content Security Policy with upgrade-insecure-requests also helps.
4. You deployed new CSS but users still see the old design. What is the right fix?
The old file is cached at the edge and in browsers. A purge of the changed URLs fixes it today. The lasting fix is fingerprinted file names (for example app.3f9a1c.css), so every release has new URLs and you can cache static files for a long time without purging.
5. A new hostname api.eu.example.com shows a certificate error, but api.example.com works. Why?
Universal SSL covers the apex and first-level subdomains (*.example.com). A second-level name such as api.eu.example.com is not covered. Options are Advanced Certificate Manager, which can order a certificate for deeper names, or renaming the host to a first-level subdomain.
6. A mobile app's API calls start receiving an HTML page instead of JSON. What do you check?
Open Security Events and filter by the API path to see which feature issued a challenge: a custom rule, a managed rule, Security Level, Bot Fight Mode or a rate limit. Mobile apps cannot solve browser challenges. Fix the specific cause, for example a custom rule with a Skip action for authenticated API traffic or a tuned rate limit. Some bot features cannot be skipped per path on lower plans, so check the bot product docs before promising a rule-based fix.
7. Users get a 413 error uploading a 150 MB video. Is it the origin?
Probably not. Cloudflare limits the request body size by plan: 100 MB on Free and Pro, 200 MB on Business and 500 MB by default on Enterprise. Options are a direct upload to object storage with a signed URL (for example R2 presigned URLs), chunked uploads, a DNS-only upload hostname, or a higher plan.
8. Your origin logs show requests that did not come through Cloudflare. Why does it matter, and how do you fix it?
If the origin accepts direct traffic, attackers can bypass the WAF and DDoS protection by connecting to the origin IP. Allow inbound HTTP and HTTPS only from Cloudflare's published IP ranges, or use Authenticated Origin Pulls, or put the origin behind Cloudflare Tunnel so it has no public inbound ports. If the origin IP was exposed in old DNS history, consider changing it.
9. A chat feature using WebSockets disconnects occasionally. Is Cloudflare blocking it?
WebSockets are supported on all plans. Long-lived connections can still be closed, for example when Cloudflare restarts services at a data centre, so the client must reconnect with backoff. Check that the origin and any load balancer in between also allow long idle times.
10. Marketing wants to block traffic from a country during a fraud spike. How do you do it, and what is the risk?
Create a WAF custom rule matching ip.src.country with a Block or Managed Challenge action. A managed challenge is usually better than a block because real customers travelling or using VPNs can still pass. Review Security Events after a day and remove the rule when the spike ends.
11. You added a DNS record but dig returns Cloudflare IPs instead of your server's IP. Is that wrong?
No, that is how proxied records work: Cloudflare answers with its own anycast IPs so traffic goes through its network. If you need the real IP in DNS, for example for a non-HTTP service, set the record to DNS only.
12. A colleague turned on "Under Attack" mode last month and never turned it off. What problems does that cause?
Every visitor gets an interstitial challenge, which slows pages, breaks API and mobile clients that cannot run the challenge, and can affect search crawlers. Turn it off and use targeted rules such as rate limits and custom rules for the paths under attack.
Cloudflare scenarios for 2 to 5 years of experience
13. After a "cache everything" rule, logged-in users saw another user's account page. What do you do?
Treat it as a data exposure incident. Remove or fix the rule, purge everything for the zone, and tell the security team. Then cache HTML only for anonymous traffic: a Cache Rule that bypasses cache when a session cookie is present or for paths such as /account, and make the origin send Cache-Control: private for personalised responses. Test with two accounts before enabling HTML caching again.
14. Campaign links with utm_ parameters lower the cache hit ratio. What can you do?
Each distinct query string becomes a separate cache entry. Options are cache key settings that ignore or include only specific query parameters (some cache key options are plan dependent), a Transform Rule or Worker that removes tracking parameters before the cache lookup, or handling tracking in the browser so the page URL stays clean.
15. A new rate limiting rule blocks your whole office. Why?
The rule counts by IP address, and everyone in the office shares one NAT IP. Exempt the office IP range through an IP list in the rule expression, raise the threshold, or on plans with Advanced Rate Limiting count by a header, cookie or API key instead of IP.
16. The staging site appeared in search results. How do you restrict it to employees?
Put the staging hostname behind a Cloudflare Access application with a policy that allows your identity provider's employee group. Unauthenticated users and crawlers then see the login page. Add noindex as well and request removal of indexed URLs in the search console.
17. Someone changed WAF settings in the dashboard and the Terraform plan now wants to undo it. What do you do?
Find out why the change was made, because it may have been an emergency fix. If it should stay, add it to Terraform and apply, so code matches reality. Then agree on a rule: emergency dashboard changes are allowed but must be written back to code within a day, and use account audit logs to see who changed what.
18. After moving DNS to Cloudflare, some resolvers return SERVFAIL for the domain. What is the likely cause?
An old DS record from the previous DNS provider is still at the registrar, so validating resolvers expect signatures Cloudflare does not produce. Remove the old DS record (or disable DNSSEC at the old provider before migrating), wait for the DS TTL, then enable DNSSEC in Cloudflare and add its new DS record at the registrar.
19. Certificate issuance for the zone fails after the security team added CAA records. Why?
CAA records list which certificate authorities may issue for the domain. If they do not include the CAs Cloudflare uses, issuance fails. Cloudflare adds the needed CAA records automatically for Universal SSL when you have CAA records in a zone using its DNS, but manual records or external DNS must include them. Check the CA list in Cloudflare's documentation.
20. A Worker release broke production routes. How do you roll back fast?
Use wrangler rollback or roll back to a previous version from the dashboard's Deployments view. Workers keep versions, so rollback does not need a new build. For the next release, use gradual deployments to send a small percentage of traffic to the new version first, and watch errors in Workers logs before increasing it.
npx wrangler deployments list
npx wrangler rollback
21. A Worker's API key was committed in wrangler.toml. What do you do?
Rotate the key at the provider first. Then store the new value with wrangler secret put API_KEY, which keeps it encrypted and out of the repository, read it from the env object in code, and remove the old value from Git history if your policy requires it. Plain vars in the config are for non-secret values only.
22. You need /blog on example.com served from a separate blog platform. How do you route it?
Use a Worker on the example.com/blog* route that fetches from the blog origin and returns the response, or Origin Rules where your plan supports the required overrides. Check that the blog generates links and canonical tags with example.com/blog, and that caching and cookies behave as expected.
23. Some corporate users say the site is slower since HTTP/3 was enabled. What is going on?
HTTP/3 uses QUIC over UDP port 443. Networks that block or throttle UDP force browsers to try QUIC and fall back to HTTP/2 over TCP, which should be quick but can add delay with some middleboxes. Check with affected users, compare protocols in analytics, and keep HTTP/2 available. Disabling HTTP/3 is a valid choice if the user base is mostly behind such networks.
24. A WAF managed rule creates false positives on a CMS admin editor. How do you tune it without turning off the WAF?
Find the rule ID in Security Events, then add an exception (skip) for that rule only, scoped to the admin path and ideally to authenticated users or your office IPs. Use Log mode while testing. Never disable the whole managed ruleset to fix one form.
25. Analytics shows high bandwidth from origin despite caching. What do you check?
Responses that cannot be cached (Set-Cookie on static files, Cache-Control: no-store), large files above cache limits, query strings creating many variants, and cache misses because traffic is spread across many data centres. Tiered Cache reduces origin fetches by having lower tiers fetch from an upper tier.
26. Load testing from your own servers triggers Cloudflare protections and skews results. What is the right approach?
Tell the security team, add the load generator IPs to an IP list and exempt them with a narrowly scoped rule for the test window, and test the origin directly as well so you know which limits are Cloudflare's and which are yours. Remove the exemption afterwards. Very large tests may need notice to Cloudflare under its terms.
27. The team wants to replace their WordPress login protection plugin with Cloudflare. What do you set up?
A rate limiting rule on /wp-login.php and xmlrpc.php, a custom rule that challenges or blocks login from unexpected countries, Turnstile on the login form if the site can integrate it, and Access in front of /wp-admin for staff. Keep strong passwords and two-factor authentication in WordPress itself.
28. A partner calls your API from fixed IPs and asks for a firewall allow list. How do you implement it on Cloudflare?
Create an IP list with the partner's ranges and a custom rule that skips bot and rate limit checks for those IPs on the API hostname only. Better still, combine it with authentication (API keys, or mTLS with API Shield) because IPs can change and do not prove identity.
Senior Cloudflare scenarios
29. Cloudflare has a global incident and your site is returning errors. What is your plan?
Check the Cloudflare status page and your own monitoring to confirm. Decide in advance whether you will bypass the proxy by switching critical records to DNS only, which exposes the origin and needs the origin to handle traffic and TLS itself. Have that runbook and origin certificates ready before an incident. Cloudflare publishes detailed post-mortems of its own outages on its blog, which are good material for discussing these trade-offs in an interview.
30. How would you replace a company VPN with Cloudflare Zero Trust?
Connect private networks with Cloudflare Tunnel, deploy the WARP client to managed devices, define Access policies per application based on identity provider groups and device posture, and route DNS and HTTP through Gateway for filtering. Migrate one application group at a time, run both systems in parallel, and remove VPN access after each group moves.
31. An API must accept only clients holding certificates you issue. How?
Use API Shield mTLS: create client certificates with the Cloudflare-managed CA (or bring your own CA on supported plans), enable mTLS for the API hostname, and add a rule that blocks requests without a valid client certificate on API paths. Plan certificate rotation and revocation with partners before go-live.
32. Compliance needs every HTTP request logged to the SIEM for a year. What do you set up?
Logpush to the SIEM or to object storage such as R2 or S3, with the fields compliance needs and a retention policy at the destination. Logpush for HTTP request logs is an Enterprise feature, so confirm the plan. Check data protection rules for fields such as client IP.
33. Ten engineers share one Cloudflare account login. How do you fix access?
Invite each person as a member with a role that fits their job, enforce SSO for the account, require two-factor authentication, replace the Global API Key in automation with scoped API tokens, and review the audit log. Remove the shared login once everyone has their own access.
34. A product launch is expected to bring ten times normal traffic to checkout. What do you prepare?
Cache everything that can be cached, check origin capacity behind Cloudflare, add rate limits for abusive patterns, and consider Waiting Room for checkout so the origin receives only the traffic it can handle while others wait in a queue. Run a rehearsal with the team and have a dashboard of origin errors and Cloudflare analytics ready.
35. Login sees a credential stuffing wave. What do you do, defensively?
Turn on leaked credential detection where your plan supports it and act on its signal, add rate limits on the login endpoint by IP and by username where possible, add Turnstile to the form, and challenge suspicious bot scores. Work with the application team to force resets for accounts that were compromised and to add two-factor authentication.
36. A regulator requires that TLS keys and logs for EU customers stay in the EU. What Cloudflare features apply?
The Data Localization Suite, which includes Regional Services to limit where TLS termination happens, Customer Metadata Boundary for where logs and analytics are stored, and Geo Key Manager for where private keys are held. These are Enterprise features. Confirm the exact requirement with legal before designing.
37. You manage 80 zones by hand and they all differ slightly. How do you bring them under control?
Export the current settings (cf-terraforming can generate Terraform from existing resources), define a standard module for zone settings, WAF and cache rules, and apply it zone by zone with reviewed plans. Use account-level rulesets where available so common rules are defined once.
38. How would you design failover between two origin regions behind Cloudflare?
Use Cloudflare Load Balancing with a pool per region, active health checks on a real health endpoint, and a steering policy (failover, or geo or latency based steering on supported plans). Keep data replicated so either region can serve, test failover regularly, and set monitors' thresholds so one slow check does not flip traffic.
Incident drills for all levels
39. All traffic to one hostname returns Error 1016. What does that suggest?
Error 1016 means Cloudflare cannot resolve the origin, usually because a proxied CNAME points to a hostname that no longer resolves, for example a deleted cloud load balancer. Fix the CNAME target or update it to the new origin.
40. Overnight, half the users get Error 1020. What do you check?
Error 1020 means a firewall rule blocked the request. Check Security Events for the rule that matched, which is often a recent custom rule with a broad expression. Switch it to Log, fix the expression, and add change review for security rules.
41. A DDoS alert fires but the site is up. What do you do?
Confirm in analytics that mitigation is working and the origin is healthy, record the attack details for the incident log, and check that alert routing reached the right people. No changes are needed if protections handled it. Afterwards review whether the origin was directly reachable.
42. The marketing site is suddenly serving a defaced page from cache. What steps do you take?
Take the origin offline or to maintenance, purge the cache so the defaced page stops being served, and involve the security team to find how the origin was changed. Restore from a known good build, rotate credentials and only then turn caching back on.
43. An Access application lets in a user who left the company. What went wrong?
Their session was still valid or the identity provider account was not disabled. Revoke the user's sessions in Zero Trust, disable them in the identity provider, and shorten session duration for sensitive apps. Connect offboarding to the identity provider so Access follows automatically.
44. A Terraform apply deleted DNS records in production. How do you recover and prevent it?
Recreate records from the last known good state (Terraform state history, a zone export or audit logs). Then require plan review in CI, add prevent_destroy lifecycle settings for critical records, and keep regular zone file exports as a backup.
How to prepare for a Cloudflare scenario round
- Put a test domain on a free Cloudflare plan and break mail, SSH and SSL on purpose to see the symptoms.
- Write one WAF custom rule, one rate limit and one Cache Rule, then read their effect in Security Events and analytics.
- Deploy a Worker with Wrangler, ship a second version and roll it back.
- Protect a test app with Cloudflare Tunnel and Access.
- Read two of Cloudflare's public post-mortems and summarise the cause and fix in your own words.
Related reading: 14 Zero Trust security tools for DevOps, challenges in implementing Zero Trust networking, the OSI model and the 200+ DevOps interview questions guide. For security engineering practice, see our DevSecOps training, run in our Kharadi, Pune classroom and live online.
FAQs
Why does email break after moving DNS to Cloudflare?
Usually because the mail server's A record is proxied. Cloudflare's proxy does not carry SMTP, so the mail host record must be DNS only.
What is the maximum upload size through Cloudflare?
The request body limit is 100 MB on Free and Pro, 200 MB on Business and 500 MB by default on Enterprise.
Does Universal SSL cover multi-level subdomains?
No. It covers the apex and first-level subdomains. Deeper names need Advanced Certificate Manager or a custom certificate.
How do I roll back a Cloudflare Worker?
Run wrangler rollback or choose a previous version in the dashboard's Deployments view. Gradual deployments reduce the need by testing a new version on a share of traffic first.
What does Error 1020 mean?
A firewall rule blocked the request. Security Events shows which rule matched.
How do I stop attackers bypassing Cloudflare to reach my origin?
Allow inbound web traffic only from Cloudflare IP ranges, use Authenticated Origin Pulls, or use Cloudflare Tunnel so the origin has no public inbound ports.
How is this page different from the Cloudflare engineer questions?
The engineer guide explains each product and covers the common 52x errors. This page uses other real situations and groups them by experience level.
Official references
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0