All fields

“Concurrency & Threading” in Information Technology

55 questions across 6 technologies.

Information Technology

55 questions in 6 technologies

#QuestionTechnologyTopicLevel
1What is the UI thread and why must UI updates happen on it? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingBeginner
2What is the UI thread and why must UI updates happen on it? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingBeginner
3How do you run CPU-bound work without blocking the UI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
4What are common async/await pitfalls in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
5How do you run CPU-bound work without blocking the UI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
6What are common async/await pitfalls in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
7How do you cancel long-running operations in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
8How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
9How do you cancel long-running operations in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
10How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
11What is the fundamental difference between concurrency and parallelism, and how does this map to Python's threading versus multiprocessing modules? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
12How do you create and run a basic thread using the threading module? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
13How do you protect shared mutable state from race conditions when using multiple threads, using threading.Lock? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
14What is the basic pattern for running an async function using asyncio.run()? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
15How does the Global Interpreter Lock (GIL) affect CPU-bound versus I/O-bound multithreaded programs differently? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
16How do you run multiple coroutines concurrently using asyncio.gather()? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
17How does multiprocessing.Pool let you parallelize a CPU-bound function across multiple worker processes? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
18What is a race condition, and how does it differ from a deadlock? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
19How does asyncio's event loop schedule and switch between multiple coroutines, and what makes this cooperative rather than preemptive? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
20How do you safely run a blocking, synchronous function from within an asyncio coroutine without freezing the event loop? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
21How do you share data between processes using multiprocessing, given that separate processes don't share memory the way threads do? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
22How would you implement a producer-consumer pattern combining a thread-safe queue.Queue with multiple worker threads? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
23How do you correctly cancel a running asyncio task, and how should the task itself handle the resulting CancelledError? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
24How would you use concurrent.futures.ProcessPoolExecutor together with asyncio to run CPU-bound work without blocking the event loop? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
25How would you design a robust worker pool that handles both graceful shutdown (finishing in-flight work) and immediate cancellation (dropping everything), using asyncio? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Advanced
26Is JavaScript single-threaded, and what does that mean in practice? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyBeginner
27How would you implement a context manager for managing a lock (like threading.Lock) while ALSO adding a timeout, raising an error if the lock can't be acquired quickly enough? Python › File I/O & Context ManagersPythonFile I/O & Context ManagersAdvanced
28How 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
29What is an async generator, and how does it differ from a regular generator? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
30How do you consume an async generator using 'async for'? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
31What is an async context manager, and which two dunder methods does it require? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
32What does it mean that Python has 'automatic' memory management, and what's the trade-off compared to manual memory management in languages like C? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionBeginner
33What is a DbContext, and why should it generally not be shared across multiple concurrent operations? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessBeginner
34What is the purpose of the ServerCallContext parameter present in every gRPC server method, and what information does it expose? .NET › gRPC Services.NETgRPC ServicesBeginner
35How do you include structured context (like a request ID) in every log message using LoggerAdapter or extra? Python › LoggingPythonLoggingIntermediate
36How does Python's generational garbage collector work, and why generations? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
37What is the difference between SaveChanges() and SaveChangesAsync(), and why does it matter for a web application's scalability? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessIntermediate
38How do you implement server-streaming gRPC using C#'s IAsyncEnumerable<T> or IServerStreamWriter<T>? .NET › gRPC Services.NETgRPC ServicesIntermediate
39How do you handle backpressure when an async generator produces items faster than the consumer can process them? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersAdvanced
40How do async generators interact with asyncio.Queue to implement a producer-consumer pattern across separate tasks? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersAdvanced
41How would you implement a 'fan-out, fan-in' pattern using multiple async generators consumed concurrently and merged into one stream? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersAdvanced
42How would you implement a coroutine-style generator-based pipeline (the classic pre-async/await pattern) using multiple chained 'send()'-driven generators? Python › Comprehensions & GeneratorsPythonComprehensions & GeneratorsAdvanced
43How would you implement a thread-safe caching decorator that correctly handles concurrent calls from multiple threads? Python › DecoratorsPythonDecoratorsAdvanced
44How does Python 3.11's exception groups (ExceptionGroup) and the 'except*' syntax let you handle MULTIPLE unrelated exceptions raised together? Python › Exception HandlingPythonException HandlingAdvanced
45How would you implement a circuit breaker pattern using exception handling, to stop repeatedly calling a service that's consistently failing? Python › Exception HandlingPythonException HandlingAdvanced
46How would you implement a lazy, chainable iterator pipeline (like filter-then-map) from scratch? Python › Iterators & the Iterator ProtocolPythonIterators & the Iterator ProtocolAdvanced
47Why is logging generally considered thread-safe, and what should you still be careful about in multiprocessing? Python › LoggingPythonLoggingAdvanced
48What are common patterns for implementing a producer-consumer background processing pipeline using Channel<T> with a BackgroundService? .NET › Background Services.NETBackground ServicesAdvanced
49What is the 'cache stampede' (thundering herd) problem, and how can you mitigate it? .NET › Caching (In-Memory, Distributed & Redis).NETCaching (In-Memory, Distributed & Redis)Advanced
50How would you diagnose a thread pool starvation issue in a production ASP.NET Core application? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
51How does async/await performance compare to synchronous code, and what overhead does the async state machine introduce? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
52What are the four types of gRPC service methods (unary, server streaming, client streaming, bidirectional streaming), and when is each appropriate? .NET › gRPC Services.NETgRPC ServicesAdvanced
53How 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
54What is the 'cache stampede' (thundering herd) problem, and how would you mitigate it in an ASP.NET Core application? ASP.NET Core › CachingASP.NET CoreCachingAdvanced
55How does an IAsyncActionFilter differ from the synchronous IActionFilter, and why is the async version generally preferred for filters doing I/O work? ASP.NET Core › FiltersASP.NET CoreFiltersAdvanced