Advanced Cloudflare Interview Questions (2027)

34 architect-level Cloudflare interview questions: Workers CPU and memory limits, Durable Objects, Cache Rules, cache keys, Tunnel and Zero Trust design.

Sep 30, 2025 - 14:35
Nov 10, 2026 - 18:23
 0  51
Advanced Cloudflare Interview Questions (2027)

Advanced Cloudflare interview questions test whether you can design on the edge, not just configure it: how Workers behave under CPU and memory limits, when state belongs in a Durable Object, how cache keys and Cache Rules shape hit ratio, and how Cloudflare Tunnel and Access replace open inbound ports for private apps. This page is written for senior and architect rounds.

If you need the fundamentals first, start with our Cloudflare engineer interview questions, which cover DNS, proxying, SSL modes and the basic WAF. The questions below assume you already know that material and focus on design trade-offs, platform limits and failure analysis. Limits quoted here were checked against the Cloudflare developer documentation in November 2026.

Key takeaways

  • On the Workers Free plan a request gets 10 ms of CPU time. On Workers Paid the default is 30 seconds and you can raise it to 5 minutes. Wall-clock duration for an HTTP request has no limit.
  • Each Worker isolate has 128 MB of memory on both plans, and a Worker script can be up to 64 MiB uncompressed.
  • Durable Objects give one globally unique, single-threaded instance per name, with private transactional storage, which makes them the answer for coordination problems such as rate counters, rooms and locks.
  • Cache Rules control what is cached, for how long and with which cache key. Plan limits on the number of rules run from 10 on Free to 300 on Enterprise.
  • Cloudflare Tunnel uses outbound-only connections from cloudflared, so the origin needs no inbound listener and no public IP.
  • Senior answers are judged on trade-offs: say what you would measure, what could break and how you would roll back.

How senior Cloudflare interviews differ

Junior rounds ask "what does this feature do". Senior and architect rounds ask "which feature would you choose, and what does it cost you". Expect a whiteboard prompt such as "move this API to the edge" or "put an internal admin tool behind Zero Trust" and follow-up questions that probe limits. Interviewers listen for three things: whether you know where code runs (edge versus origin), where state lives, and how you would observe the system once it is live.

AreaWhat a mid-level answer coversWhat a senior answer adds
WorkersWriting a fetch handlerCPU limits, subrequest budgets, isolate memory, when to keep logic at the origin
StateKV for configConsistency needs, Durable Objects for coordination, storage per object
CachingPurging a URLCache key design, purge behaviour with custom keys, hit ratio as a cost lever
Zero TrustAdding an Access policyTunnel replicas, removing inbound firewall rules, identity provider design
OperationsReading the dashboardRules as code with Terraform, versioning, staged rollout and rollback

Workers and edge compute (questions 1 to 9)

1. What CPU time does a Worker get per request?

On the Workers Free plan, 10 ms of CPU time per HTTP request. On Workers Paid the default is 30 seconds and the maximum you can configure is 5 minutes. CPU time counts work the isolate does, not time spent waiting on network I/O, which is why a Worker that mostly awaits fetches can run far longer in wall-clock terms. Cloudflare documents no wall-clock limit for HTTP requests.

2. How much memory does an isolate have, and why does it matter for design?

128 MB per isolate on both plans. That rules out loading large datasets or big ML models into memory per request. A senior answer moves large reference data into KV, R2 or a database and streams responses instead of buffering them. If you parse a large upload, stream it through rather than reading the whole body into a string.

3. What are subrequest limits and when do they bite?

A Worker on the Free plan can make 50 subrequests per invocation. On Paid the default is 10,000, configurable up to 10 million. Fan-out patterns, such as calling one backend per item in a list, hit this first. The fix is batching, moving fan-out into a Queue consumer, or doing the aggregation at the origin.

4. How large can a Worker be?

64 MiB uncompressed on both plans, with no separate compressed limit. Large bundles also slow cold starts and deploys, so tree-shaking dependencies is still good practice even if you are under the cap.

5. When would you keep logic at the origin instead of in a Worker?

When the logic needs heavy CPU per request, long-lived connections to a database that is far from the edge, or large in-memory state. Running code at the edge only helps latency if the data it needs is also near the edge. A Worker that makes three round trips to a database in one region can be slower than a single call to an origin in that region.

6. How do Cron Triggers differ from request handling?

A Cron Trigger on the Paid plan gets 30 seconds of CPU when the interval is under an hour and 15 minutes when it is an hour or longer, and its wall-clock duration is capped at 15 minutes. On Free it gets 10 ms. Use Cron Triggers for scheduled cleanup or cache warming, and move anything larger into Queues or an external job runner.

7. How would you cache an expensive API response inside a Worker?

Use the Workers Cache API with a request object as the key, store the response with explicit cache headers, and return the cached copy on later requests. Keep the cache key deterministic and strip query parameters that do not change the response.

export default {
  async fetch(request, env, ctx) {
    const cache = caches.default;
    const cached = await cache.match(request);
    if (cached) return cached;

    const upstream = await fetch(request);
    const response = new Response(upstream.body, upstream);
    response.headers.set("Cache-Control", "public, max-age=300");
    ctx.waitUntil(cache.put(request, response.clone()));
    return response;
  }
};

Point out that ctx.waitUntil lets the cache write finish after the response goes back to the client, so the user does not wait on it.

8. How do you deploy Workers safely across environments?

Keep the Worker code and its configuration in Git, deploy with Wrangler from CI, and use separate environments or separate Workers for staging and production. Gradual deployments let you send a share of traffic to a new version first. A good answer also says how you would roll back: redeploy the previous version from CI rather than editing in the dashboard.

9. How do you observe a Worker in production?

Use Workers logs and tail sessions for live debugging, and send structured logs to a log sink for retention. Track error rate, CPU time per request and subrequest counts, because those are the numbers that tell you a limit is coming. Alert on rising CPU time before it reaches the plan limit.

State, storage and Durable Objects (questions 10 to 15)

10. What is a Durable Object in one sentence?

A Worker paired with its own storage, addressed by a globally unique name so every client reaches the same single instance. Cloudflare describes Durable Objects as single-threaded and cooperatively multi-tasked, so code inside one object does not race with itself.

11. When would you choose a Durable Object over KV?

When you need coordination or strong consistency for one entity: a chat room, a per-user rate limiter, a booking lock or a collaborative document. KV suits read-heavy configuration and content that can tolerate propagation delay. If two clients writing at the same moment must see one ordered result, that is a Durable Object problem.

12. What storage does a Durable Object have?

Private, persistent, transactional storage. Newer objects can use a SQL API backed by SQLite alongside the key-value API. The documentation lists per-object SQLite storage at 1 GB, so design one object per entity rather than one object for the whole application.

13. Where does a Durable Object run?

Cloudflare provisions it close to where it is first requested, and you can pass a location hint. That has a design consequence: if the first request for a global object comes from one region, later users elsewhere pay the extra latency. For per-user objects this is usually fine because users tend to stay in one region.

14. How do you handle many idle WebSocket connections?

Use the WebSocket Hibernation API, which lets the object sleep while connections stay open so you are not billed for idle time. Without hibernation, a room with long idle periods keeps the object alive and costs more.

15. How do you run delayed work from a Durable Object?

Set an alarm. The Alarms API wakes the object at a scheduled time, and an alarm handler has a 15 minute wall-clock limit. Typical uses are expiring a reservation, flushing aggregated counters or retrying a failed webhook.

Caching and performance (questions 16 to 21)

16. What do Cache Rules control?

What is eligible for caching, how long it is cached and where, and how a matching request interacts with the cache and other Rules products. You can manage them in the dashboard, through the API or with Terraform, and the DNS records must be proxied through Cloudflare for them to apply.

17. How many Cache Rules can you have?

10 on Free, 25 on Pro, 50 on Business and 300 on Enterprise. A senior answer notes that hitting the limit usually means the rules are too specific; group paths with expressions instead of writing one rule per URL.

18. Why does a custom cache key affect purging?

Cloudflare documents that keys which only change query string handling generally still work with single-file purge from the dashboard. Keys that include headers, cookies or other request properties do not, so you need an API purge by URL or a broader purge. Mention this before you propose a cookie-based cache key, because it changes the release process.

19. How would you raise a low cache hit ratio?

Find out why requests miss. Common causes are query strings that vary per user, cookies that make responses uncacheable, short origin TTLs and HTML that is never cached. Fix the cache key, set explicit edge TTLs with a Cache Rule, and cache HTML for anonymous users only. Measure hit ratio and origin egress before and after so the change shows up in numbers.

20. How do you test whether a rule matches?

Use the Rules simulator in the dashboard to check a URL against your rules before you rely on production traffic. In CI, keep rules in Terraform and review the plan output.

21. How do you cache content that differs by device or language?

Add only the attribute that really changes the response to the cache key, and normalise it first. Caching per full User-Agent string fragments the cache into thousands of variants; caching per device class keeps it to a handful.

Zero Trust, Tunnel and security design (questions 22 to 27)

22. How does Cloudflare Tunnel remove the need for inbound ports?

cloudflared opens outbound connections from your network to Cloudflare, and traffic then flows both ways over that tunnel. The origin has no inbound listener, so you can block all inbound traffic at the firewall and the origin does not need a public IP address.

23. How do you make a tunnel highly available?

Run more than one cloudflared connector for the same tunnel, on separate hosts or nodes. Cloudflare's documentation says you can run as many connectors as needed and each one sends traffic to the nearest Cloudflare data center. In Kubernetes, run it as a Deployment with more than one replica and a PodDisruptionBudget.

24. How would you protect an internal admin app with Zero Trust?

Publish the app through a tunnel, put a Cloudflare Access application in front of it, and write policies that require identity from your identity provider plus device posture where you have it. Remove the old VPN or IP allow-list only after logs show users reaching the app through Access.

25. How do you protect an API that mobile apps call?

Combine WAF managed rules, rate limiting rules keyed on something stable such as an API key header, and schema validation where you publish an API schema. Mutual TLS suits partner integrations that can hold a client certificate. Avoid IP-based allow-lists for mobile clients because their IPs change.

26. How should the origin trust Cloudflare?

Use Full (strict) SSL with a valid origin certificate, and make sure the origin only accepts traffic that comes through Cloudflare, either through a tunnel or by restricting to Cloudflare IP ranges and validating authenticated origin pulls. Otherwise attackers can skip the WAF by hitting the origin IP directly.

27. How do you manage Cloudflare configuration at scale?

Keep DNS, rules, Access applications and Workers in Git and apply them with Terraform and Wrangler from a pipeline. Dashboard edits should be rare and followed by an import into code, otherwise the next apply undoes them.

Scenario questions (questions 28 to 34)

28. A Worker starts returning errors after a new feature ships. How do you investigate?

Check whether the errors are CPU limit errors, exceptions or upstream failures. Tail the Worker, compare CPU time per request before and after the deploy, and look at subrequest counts. If CPU time jumped, look for synchronous work added to the hot path, such as parsing large JSON. Roll back first if users are affected, then fix.

29. Origin traffic doubled overnight with no traffic growth. What do you check?

Cache hit ratio and recent rule changes. A new query parameter from a marketing campaign, a Cache Rule edit or a change to Cache-Control headers at the origin are the usual causes. Compare the cache status breakdown in analytics for the two days.

30. A rate limiter built on KV lets bursts through. Why?

KV is eventually consistent, so two edge locations can read the same old counter and both allow the request. Move the counter into a Durable Object per key so one instance serialises the increments.

31. Users in one region report slow responses from a real-time feature.

Check where the Durable Object for that feature lives. If it was created by a request from another continent, every user pays the round trip. Shard by region or user, or use a location hint when you create the object.

32. A tunnel-backed app goes down during node maintenance.

There was probably a single connector. Run at least two replicas on different nodes, add a disruption budget and drain nodes one at a time.

33. After enabling a custom cache key, a purge from the dashboard no longer clears a page.

The key now includes a header or cookie, so single-file purge from the dashboard does not match. Purge through the API by URL or use a broader purge such as by tag or prefix where your plan supports it, and update the runbook.

34. Security asks you to prove the origin cannot be reached directly.

Show the firewall rules that block inbound traffic, run a scan against the origin IP from outside, and show that traffic only arrives through the tunnel or with an authenticated origin pull certificate. Keep that evidence in the audit record.

How to prepare for an architect-level round

Build one project end to end: a Worker in front of a small API, a Durable Object for a counter or room, a Cache Rule tuned for the static paths, and an internal page published through a tunnel behind Access. Put all of it in Terraform and Wrangler config in one repository. When you can explain each choice and its limit, the questions above become easy to answer from experience.

For practice with incident-style questions, use our scenario-based Cloudflare questions and real-time Cloudflare questions. If you have less time, the most asked Cloudflare questions list is shorter, and the Cloudflare interview preparation guide gives a study plan. For the wider DevOps rounds that come with these jobs, see the 200 DevOps interview questions guide.

Edge security work overlaps heavily with DevSecOps. Our DevSecOps training runs in the classroom in Kharadi, Pune and live online across India.

Frequently asked questions

What is the CPU time limit for Cloudflare Workers?

10 ms per request on Workers Free. On Workers Paid the default is 30 seconds and you can configure up to 5 minutes. HTTP requests have no wall-clock duration limit.

How much memory does a Cloudflare Worker get?

128 MB per isolate on both the Free and Paid plans.

When should I use Durable Objects instead of Workers KV?

Use Durable Objects when one entity needs coordination or strong consistency, such as counters, locks or chat rooms. Use KV for read-heavy data that can tolerate propagation delay.

Does Cloudflare Tunnel need open inbound ports?

No. cloudflared makes outbound connections to Cloudflare, so you can block all inbound traffic and the origin needs no public IP.

How many Cache Rules can I create?

10 on Free, 25 on Pro, 50 on Business and 300 on Enterprise.

Why does single-file purge fail with my custom cache key?

Keys that include headers, cookies or other request properties do not work with dashboard single-file purge. Purge by URL through the API or use a broader purge method.

Are these questions enough for a Cloudflare architect interview?

They cover the design areas most senior rounds probe. Pair them with a hands-on project and the fundamentals in our Cloudflare engineer questions.

Official references

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.