All fields

“Threading” in Information Technology

79 questions across 9 technologies.

Information Technology

79 questions in 9 technologies

#QuestionTechnologyTopicLevel
1What 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
2How do you create and run a basic thread using the threading module? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
3How 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
4How do you correctly implement a producer-consumer pattern using System.Threading.Channels for asynchronous data pipelines? C# › Asynchronous ProgrammingC#Asynchronous ProgrammingAdvanced
5How 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
6How 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
7How do the threading models of Redis and Memcached differ, and what performance implications does this have? Redis › Redis vs MemcachedRedisRedis vs MemcachedIntermediate
8What are the differences between Redis's threading model in older versions versus improvements introduced in more recent versions for handling input and output operations? Redis › Redis Architecture & InstallationRedisRedis Architecture & InstallationAdvanced
9What is the UI thread and why must UI updates happen on it? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingBeginner
10What is the UI thread and why must UI updates happen on it? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingBeginner
11How do you run CPU-bound work without blocking the UI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
12What are common async/await pitfalls in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
13How do you run CPU-bound work without blocking the UI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
14What are common async/await pitfalls in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
15How do you cancel long-running operations in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
16How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
17How do you cancel long-running operations in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
18How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
19What is the basic pattern for running an async function using asyncio.run()? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
20What is an isolate in Dart, and how does it fundamentally differ from a traditional operating system thread used for genuine concurrent execution in many other programming languages? Flutter › Flutter Isolates & MultithreadingFlutterFlutter Isolates & MultithreadingBeginner
21What is the main isolate in a Flutter app, and why should genuinely expensive, computationally intensive work generally be avoided from running directly on it? Flutter › Flutter Isolates & MultithreadingFlutterFlutter Isolates & MultithreadingBeginner
22How 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
23How do you run multiple coroutines concurrently using asyncio.gather()? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
24How does multiprocessing.Pool let you parallelize a CPU-bound function across multiple worker processes? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
25What is a race condition, and how does it differ from a deadlock? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
26How does Dart's simple compute function provide a genuinely convenient, considerably simplified shortcut for running a specific function on a completely separate isolate, without needing to manually manage the full underlying isolate lifecycle yourself? Flutter › Flutter Isolates & MultithreadingFlutterFlutter Isolates & MultithreadingIntermediate
27How do you properly establish genuine ongoing bidirectional communication between the main isolate and a manually spawned separate isolate using SendPort and ReceivePort, for a scenario requiring more than just a single one off request and response? Flutter › Flutter Isolates & MultithreadingFlutterFlutter Isolates & MultithreadingIntermediate
28What specific types of data can actually be sent as a message between two separate isolates in Dart, and why can an arbitrary complex object, such as one containing an active network connection, genuinely not simply be passed directly between them? Flutter › Flutter Isolates & MultithreadingFlutterFlutter Isolates & MultithreadingIntermediate
29How 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
30How 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
31How 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
32How 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
33How 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
34How 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
35How 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
36How does Dart's newer Isolate.run API simplify the process of running a specific one off computation on a separate isolate compared to the older, considerably more manual Isolate.spawn combined with ReceivePort approach? Flutter › Flutter Isolates & MultithreadingFlutterFlutter Isolates & MultithreadingAdvanced
37What are isolate groups and Dart's newer experimental shared memory capabilities, and how might these genuinely eventually reduce the current overhead of passing genuinely very large amounts of data between two separate isolates? Flutter › Flutter Isolates & MultithreadingFlutterFlutter Isolates & MultithreadingAdvanced
38Is JavaScript single-threaded, and what does that mean in practice? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyBeginner
39How do you implement a thread-safe Singleton pattern in modern C# using Lazy<T>? C# › Design Patterns in C#C#Design Patterns in C#Beginner
40What is an async generator, and how does it differ from a regular generator? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
41How do you consume an async generator using 'async for'? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
42What is an async context manager, and which two dunder methods does it require? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
43What 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
44What 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
45What is the purpose of the ServerCallContext parameter present in every gRPC server method, and what information does it expose? .NET › gRPC Services.NETgRPC ServicesBeginner
46What is a background task in a Flutter app, and why can this kind of work not always simply be handled the exact same way as regular code running while the app is actively open and visible on screen? Flutter › Flutter Background Tasks & WorkManagerFlutterFlutter Background Tasks & WorkManagerBeginner
47How do you keep API calls off the UI thread and update the UI safely? .NET MAUI › Networking & APIs.NET MAUINetworking & APIsIntermediate
48How do you keep API calls off the UI thread and update the UI safely? .NET MAUI › Networking & APIs.NET MAUINetworking & APIsIntermediate
49How do you include structured context (like a request ID) in every log message using LoggerAdapter or extra? Python › LoggingPythonLoggingIntermediate
50How does Python's generational garbage collector work, and why generations? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
51What 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
52How do you implement server-streaming gRPC using C#'s IAsyncEnumerable<T> or IServerStreamWriter<T>? .NET › gRPC Services.NETgRPC ServicesIntermediate
53What is the difference between microtasks and the event queue in Dart's event loop, and how does this affect the precise order in which asynchronous code actually executes? Flutter › Dart Asynchronous Programming (Future & async/await)FlutterDart Asynchronous Programming (Future & async/await)Intermediate
54How does a background task's callback function actually run in a separate isolate, and what practical implications does this actually have for accessing shared app state or plugins from within that specific background task? Flutter › Flutter Background Tasks & WorkManagerFlutterFlutter Background Tasks & WorkManagerIntermediate
55How do you share an ArrayBuffer between a Web Worker and the main thread without copying it? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataAdvanced
56What is the performance and thread-safety difference between ConcurrentDictionary<TKey,TValue> and a regular Dictionary<TKey,TValue> guarded by a manual lock? C# › CollectionsC#CollectionsAdvanced
57How does AggregateException work with Task.WhenAll() when multiple concurrent tasks throw exceptions? C# › Exception HandlingC#Exception HandlingAdvanced
58How do you use FileSystemWatcher to monitor a directory for file changes, and what are its common reliability pitfalls? C# › File I/O & StreamsC#File I/O & StreamsAdvanced
59How does the difference between the Server GC and Workstation GC modes affect a .NET application's throughput and latency characteristics? C# › Memory & Garbage CollectionC#Memory & Garbage CollectionAdvanced
60How 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
61How 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
62How 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
63How 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
64How would you implement a thread-safe caching decorator that correctly handles concurrent calls from multiple threads? Python › DecoratorsPythonDecoratorsAdvanced
65How does Python 3.11's exception groups (ExceptionGroup) and the 'except*' syntax let you handle MULTIPLE unrelated exceptions raised together? Python › Exception HandlingPythonException HandlingAdvanced
66How would you implement a circuit breaker pattern using exception handling, to stop repeatedly calling a service that's consistently failing? Python › Exception HandlingPythonException HandlingAdvanced
67How would you implement a lazy, chainable iterator pipeline (like filter-then-map) from scratch? Python › Iterators & the Iterator ProtocolPythonIterators & the Iterator ProtocolAdvanced
68Why is logging generally considered thread-safe, and what should you still be careful about in multiprocessing? Python › LoggingPythonLoggingAdvanced
69What are common patterns for implementing a producer-consumer background processing pipeline using Channel<T> with a BackgroundService? .NET › Background Services.NETBackground ServicesAdvanced
70What 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
71How would you diagnose a thread pool starvation issue in a production ASP.NET Core application? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
72How does async/await performance compare to synchronous code, and what overhead does the async state machine introduce? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
73What 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
74How 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
75What 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
76How 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
77What strategies help manage memory usage effectively when a Flutter app needs to display many images at once, such as within a large scrolling photo gallery? Flutter › Camera & Media Handling in FlutterFlutterCamera & Media Handling in FlutterAdvanced
78How can heavy image processing tasks, such as applying a filter or resizing a very large image, be moved off the main UI thread using isolates to avoid causing the app's interface to freeze or stutter? Flutter › Camera & Media Handling in FlutterFlutterCamera & Media Handling in FlutterAdvanced
79What are the practical performance considerations of parsing a genuinely very large JSON response, and how does moving that particular parsing work onto a genuinely separate isolate help meaningfully avoid causing your app's own visible interface to freeze? Flutter › JSON Serialization & DeserializationFlutterJSON Serialization & DeserializationAdvanced