All fields

“Background Services” in Information Technology

78 questions across 5 technologies.

Information Technology

78 questions in 5 technologies

#QuestionTechnologyTopicLevel
1How do background services interact with health checks to signal their operational status? .NET › Background Services.NETBackground ServicesAdvanced
2How do background services interact with health checks to signal their operational status to an orchestrator like Kubernetes? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
3How do you register and run multiple independent BackgroundServices within the same application? .NET › Background Services.NETBackground ServicesIntermediate
4How do you safely access scoped services (like a DbContext) from within a BackgroundService, which itself is registered as a singleton? .NET › Background Services.NETBackground ServicesAdvanced
5What is a BackgroundService in ASP.NET Core, and what does it provide out of the box? .NET › Background Services.NETBackground ServicesBeginner
6What is the difference between IHostedService and BackgroundService, and when would you implement IHostedService directly? .NET › Background Services.NETBackground ServicesBeginner
7How do you implement retry logic with exponential backoff for a background service processing potentially-failing external calls? .NET › Background Services.NETBackground ServicesAdvanced
8How does graceful shutdown work for a BackgroundService, and what role does CancellationToken play? .NET › Background Services.NETBackground ServicesIntermediate
9How should exceptions be handled inside a BackgroundService's ExecuteAsync loop to prevent the entire service from crashing silently? .NET › Background Services.NETBackground ServicesIntermediate
10How does a BackgroundService differ from a Worker Service project template, and how do they relate? .NET › Background Services.NETBackground ServicesIntermediate
11How would you implement a scheduled (cron-like) background job in .NET without a third-party library? .NET › Background Services.NETBackground ServicesIntermediate
12How should a BackgroundService handle a fatal startup dependency failure, such as being unable to connect to a required message queue at launch? .NET › Background Services.NETBackground ServicesIntermediate
13How would you implement a periodic timer-based background task more precisely than Task.Delay, avoiding cumulative drift? .NET › Background Services.NETBackground ServicesAdvanced
14What are common patterns for implementing a producer-consumer background processing pipeline using Channel<T> with a BackgroundService? .NET › Background Services.NETBackground ServicesAdvanced
15What is the significance of the order of AddHostedService registrations relative to StartAsync execution, and can you control it? .NET › Background Services.NETBackground ServicesIntermediate
16What is IHostedLifecycleService, and how does it provide more granular hooks than IHostedService's StartAsync/StopAsync? .NET › Background Services.NETBackground ServicesAdvanced
17How do you safely access scoped services like a DbContext from within a BackgroundService, which is registered as a singleton? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
18How do multiple independently-registered BackgroundServices coexist within the same application, and does registration order matter? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
19How would you implement retry logic with exponential backoff for a background service that calls a potentially-flaky external API? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
20What is a BackgroundService in ASP.NET Core, and how do you register one to run alongside a web application? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesBeginner
21How should exceptions be handled inside a BackgroundService's work loop to prevent one failure from silently stopping all future processing? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
22What is the difference between IHostedService and the BackgroundService convenience base class? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
23How does IHostApplicationLifetime let a BackgroundService react to application startup and shutdown events? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
24How would you configure a BackgroundService to fail fast and crash the host if a critical startup dependency (like a message broker) is unreachable? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
25How does graceful shutdown work for a BackgroundService, and how should ExecuteAsync respect the CancellationToken? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
26How would you implement a producer-consumer background processing pipeline using System.Threading.Channels alongside a BackgroundService? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
27How would you implement a cron-like scheduled background job (e.g., 'run daily at 2 AM') without a third-party scheduling library? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
28How would you implement a background task queue accepting ad-hoc work items dynamically at runtime, rather than a fixed polling loop? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
29How do you test a BackgroundService's business logic without waiting for its actual polling interval, keeping tests fast? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
30How do you implement a periodic scheduled task using PeriodicTimer instead of Task.Delay, and what problem does it solve? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
31How do you use IServiceScopeFactory to manually create a DI scope outside the normal per-request pipeline, such as inside a background service? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
32How do the four gRPC method types (unary, server streaming, client streaming, bidirectional streaming) differ, and when would you use each? ASP.NET Core › gRPC ServicesASP.NET CoregRPC ServicesAdvanced
33What is the role of IHostLifetime, and how does it differ across console applications, Windows Services, and containers? .NET › Generic Host.NETGeneric HostIntermediate
34How do you use IServiceScopeFactory to manually create and manage a DI scope outside the normal request pipeline? .NET › Dependency Injection.NETDependency InjectionAdvanced
35How does the Generic Host support hosting multiple independent hosted services with different failure isolation needs? .NET › Generic Host.NETGeneric HostAdvanced
36What is the difference between a message queue (like RabbitMQ) and a job queue (like BullMQ), and when would you choose one over the other? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesAdvanced
37What is the Generic Host in .NET, and what problem does it standardize across different application types? .NET › Generic Host.NETGeneric HostBeginner
38What does calling host.Run() versus host.RunAsync() do, and when would you use each? .NET › Generic Host.NETGeneric HostBeginner
39What is the ASP.NET Core Health Checks middleware, and what problem does it solve? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksBeginner
40What are the two primary ways to create a thread in Java (extending Thread versus implementing Runnable), and which is generally preferred? Java › Concurrency & ThreadsJavaConcurrency & ThreadsBeginner
41What is the difference between calling Thread.start() and Thread.run() directly, and why is calling run() directly a common beginner mistake? Java › Concurrency & ThreadsJavaConcurrency & ThreadsBeginner
42What is the difference between the async and await keywords in C#, and how do they work together? C# › Asynchronous ProgrammingC#Asynchronous ProgrammingBeginner
43What is the difference between Singleton, Scoped, and Transient service lifetimes, and how does Scoped specifically map to an HTTP request? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
44How does the Options pattern's IOptions<T>/IOptionsSnapshot<T> relate to and build upon the standard DI container? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
45What is the difference between temporary file storage (during processing) and permanent storage for uploaded files, and why should uploads generally not be saved directly to their final destination? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesIntermediate
46How do health checks interact with dependency injection scoping, particularly for checks that need a scoped service like a DbContext? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksIntermediate
47What is the ASP.NET Core Module (ANCM), and what specific role does it play when hosting under IIS? ASP.NET Core › Hosting Models: Kestrel, IIS & Reverse ProxiesASP.NET CoreHosting Models: Kestrel, IIS & Reverse ProxiesIntermediate
48How do you configure request timeout behavior differently at the Kestrel level versus the reverse proxy level, and why might they need to be coordinated? ASP.NET Core › Hosting Models: Kestrel, IIS & Reverse ProxiesASP.NET CoreHosting Models: Kestrel, IIS & Reverse ProxiesIntermediate
49What is the ExecutorService framework, and why is it generally preferred over manually creating and managing individual Thread objects? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
50What is the difference between wait()/notify()/notifyAll() (Object's intrinsic monitor methods) and the newer java.util.concurrent tools, and why are the older methods considered error-prone? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
51How would you use the WatchService API (java.nio.file) to monitor a directory for file system changes (creation, modification, deletion) in real time? Java › I/O & NIOJavaI/O & NIOIntermediate
52How would you make an asynchronous, non-blocking HTTP request using HttpClient's sendAsync() method, and how does the returned CompletableFuture integrate with the rest of an asynchronous pipeline? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
53How would you publish and consume messages using RabbitMQ in a Node.js application via the amqplib package? Node.js › Message Queues (RabbitMQ & Kafka)Node.jsMessage Queues (RabbitMQ & Kafka)Intermediate
54What is the difference between IOptions<T>, IOptionsSnapshot<T>, and IOptionsMonitor<T>? .NET › Configuration & Options.NETConfiguration & OptionsAdvanced
55How does configuration hot-reload work with reloadOnChange for appsettings.json, and what are its limitations? .NET › Configuration & Options.NETConfiguration & OptionsAdvanced
56What is the 'captive dependency' problem, and how does the DI container help catch it? .NET › Dependency Injection.NETDependency InjectionAdvanced
57What is the Options pattern's relationship to DI, and how does IOptions<T> itself get resolved through the container? .NET › Dependency Injection.NETDependency InjectionAdvanced
58How does the Generic Host manage the application's startup and shutdown lifecycle, including handling OS signals like SIGTERM? .NET › Generic Host.NETGeneric HostAdvanced
59How would you build a console application that supports both interactive command execution and long-running hosted service behavior using the Generic Host? .NET › Generic Host.NETGeneric HostAdvanced
60How would you implement a startup task that must complete successfully before the Generic Host considers the application ready to serve traffic or process work? .NET › Generic Host.NETGeneric HostAdvanced
61How would you implement real-time UI updates in a Blazor Server component in response to a backend event, like a new order being placed elsewhere in the system? ASP.NET Core › Blazor Integration with ASP.NET CoreASP.NET CoreBlazor Integration with ASP.NET CoreAdvanced
62What is the difference between IOptions<T>, IOptionsSnapshot<T>, and IOptionsMonitor<T>, and which is safe to inject into a singleton? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
63How does configuration hot-reload work with reloadOnChange for appsettings.json, and what are its limitations? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
64What is the 'captive dependency' problem, and how does ASP.NET Core's DI container help catch it automatically? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionAdvanced
65How would you implement resumable/chunked file uploads to support very large files over unreliable network connections? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesAdvanced
66How would you implement virus/malware scanning for uploaded files before they're made available for download by other users? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesAdvanced
67How do you differentiate liveness and readiness health checks using tags, and why does Kubernetes treat these two probe types differently? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksAdvanced
68How would you implement a startup-specific health check distinct from ongoing liveness/readiness, useful for slow-starting applications with lengthy initialization (like cache warming or large data loads)? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksAdvanced
69How would you implement graceful shutdown handling in Kestrel/ASP.NET Core to ensure in-flight requests complete before a container or process terminates during a deployment or scale-down event? ASP.NET Core › Hosting Models: Kestrel, IIS & Reverse ProxiesASP.NET CoreHosting Models: Kestrel, IIS & Reverse ProxiesAdvanced
70How would you implement automated, zero-downtime certificate renewal using Let's Encrypt (ACME protocol) for a production ASP.NET Core deployment? ASP.NET Core › HTTPS, Certificates & Transport SecurityASP.NET CoreHTTPS, Certificates & Transport SecurityAdvanced
71How would you write a custom Maven plugin or Gradle task to perform project-specific build automation not covered by existing plugins? Java › Build Tools: Maven & GradleJavaBuild Tools: Maven & GradleAdvanced
72How does java.util.concurrent's ReentrantLock differ from the synchronized keyword, and what additional capabilities does it provide (tryLock, fairness, interruptible locking)? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
73How do CompletableFuture's composition methods (thenApply, thenCompose, thenCombine) enable building asynchronous pipelines, and what's the difference between thenApply and thenCompose? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
74How would you use CountDownLatch, CyclicBarrier, and Semaphore for different thread coordination scenarios, and what distinguishes their use cases? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
75How would you implement asynchronous file I/O using AsynchronousFileChannel, and how does this differ from both the classic blocking java.io model and NIO's Selector-based non-blocking channels? Java › I/O & NIOJavaI/O & NIOAdvanced
76How would you implement file locking (using FileLock) to coordinate exclusive access to a shared file across multiple processes, and what are the platform-specific reliability caveats? Java › I/O & NIOJavaI/O & NIOAdvanced
77How would you implement a recurring event scheduling system that correctly handles both fixed-instant recurrence (every exactly 24 hours) and calendar-based recurrence (every day at 9 AM local time), given these have meaningfully different behavior across DST transitions? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Advanced
78How would you implement a WebSocket client using java.net.http.WebSocket for real-time, bidirectional communication, and how does its event-driven Listener interface work? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced