.NET Architecture & System Design Interview

Caching, CDN, Queues & Asynchronous Processing

Questions 26-50: Caching, CDN, Queues & Asynchronous Processing.

25 Questions Filter by level

Interview questions

Open a question for the full answer, code and interview guidance.

25 Results
26
JuniorBeginner

What is caching and why is it used in system design?

Caching stores frequently used or expensive-to-compute data in a faster location so later requests can be served with less latency and less load on the original data source.

27
JuniorBeginner

What is the Cache-Aside pattern?

Cache-Aside is a common caching pattern in which the application first checks the cache. On a miss, it loads the data from the source, stores the result in the cache, and returns it.

28
JuniorBeginner

What is the difference between in-memory cache and distributed cache?

An in-memory cache stores data inside one application process. It is extremely fast but each application instance has its own cache and the data disappears when that process stops.

29
JuniorBeginner

When should you use IMemoryCache in ASP.NET Core?

IMemoryCache is appropriate for data that can be cached independently within each application instance and does not require synchronization across servers. Examples include small reference data, computed values, or short-lived local optimizations.

30
JuniorBeginner

When should you use a distributed cache in ASP.NET Core?

Use a distributed cache when multiple application instances need access to shared cached data or when cached state should survive the replacement of an individual web server.

31
JuniorBeginner

What is cache invalidation?

Cache invalidation is the process of removing or updating cached data when it is no longer valid. It is one of the most difficult parts of caching because incorrect invalidation can return stale information.

32
JuniorBeginner

What is the difference between absolute and sliding cache expiration?

Absolute expiration removes a cache entry after a fixed time measured from creation or a specified timestamp. Sliding expiration extends the lifetime when the entry is accessed, provided it continues to be used.

33
JuniorBeginner

What is cache eviction?

Cache eviction removes entries to free space or because entries are expired or no longer useful. Eviction may be triggered by expiration, explicit invalidation, memory pressure, or a cache replacement policy.

34
JuniorBeginner

What is a cache stampede?

A cache stampede occurs when many requests simultaneously discover that a popular cache entry is missing or expired and all perform the same expensive operation against the backing system.

35
JuniorBeginner

What is cache penetration?

Cache penetration occurs when requests repeatedly ask for data that does not exist, causing every request to miss the cache and reach the database or downstream service.

36
JuniorBeginner

What is cache warming?

Cache warming preloads selected cache entries before normal traffic needs them. It can reduce cold-start latency for predictable, frequently requested data.

37
JuniorBeginner

What is a Content Delivery Network (CDN)?

A CDN is a geographically distributed network that caches and serves content from locations closer to users. It is commonly used for static files such as images, JavaScript, CSS, downloads, and video.

38
JuniorBeginner

What is asynchronous processing?

Asynchronous processing moves work that does not need to finish within the original request into a separate execution path. The request can acknowledge or record the work while a background processor performs it later.

39
JuniorBeginner

What is a message queue?

A message queue stores messages until consumers are able to process them. It decouples producers from consumers in time and can absorb temporary differences between production and processing rates.

40
JuniorBeginner

What are the benefits of using queues between services?

Queues reduce direct temporal coupling because the producer does not require the consumer to be available at exactly the same moment. They can buffer bursts, enable independent scaling, and support retries.

41
JuniorBeginner

What is the difference between a queue and a publish-subscribe model?

A queue commonly represents competing consumers: one logical message is processed by one consumer from a consumer group. Publish-subscribe distributes an event to multiple independent subscribers that each need to react.

42
JuniorBeginner

What is at-most-once message delivery?

At-most-once delivery means a message is delivered zero or one time. The system avoids duplicate delivery, but a message can be lost if a failure occurs before or during processing.

43
JuniorBeginner

What is at-least-once message delivery?

At-least-once delivery retries messages until they are acknowledged or a failure policy is reached. This reduces the risk of message loss but means a consumer may receive the same message multiple times.

44
JuniorBeginner

What does exactly-once processing mean?

Exactly-once processing means the intended business effect occurs once despite failures, retries, or duplicate delivery. Achieving this across distributed components is difficult and often depends on transaction boundaries, idempotency, deduplication, or technology-specific guarantees.

45
JuniorBeginner

What is a dead-letter queue (DLQ)?

A dead-letter queue stores messages that could not be processed successfully after the configured retry or rejection policy. It prevents one repeatedly failing message from blocking normal processing.

46
JuniorBeginner

What is a poison message?

A poison message is a message that repeatedly fails processing because of invalid content, an incompatible schema, an unrecoverable business condition, or a persistent application defect.

47
JuniorBeginner

What is message idempotency?

Message idempotency ensures that processing the same logical message more than once does not create unintended duplicate business effects.

48
JuniorBeginner

How can message ordering affect system design?

Some workflows require messages to be processed in a meaningful order, while others do not. Parallel consumers and partitioned brokers can cause messages to complete in a different order from which they were produced.

49
JuniorBeginner

What is a background service in ASP.NET Core?

ASP.NET Core supports long-running hosted work through IHostedService and BackgroundService. These are useful for tasks such as polling, scheduled maintenance, or consuming messages when the work belongs inside the application host.

50
JuniorBeginner

How should scoped services be used inside a BackgroundService?

BackgroundService is normally registered as a singleton, so it should not capture scoped dependencies such as an EF Core DbContext directly through its constructor.