All fields

“Concurrency” in Information Technology

132 questions across 12 technologies.

Information Technology

132 questions in 12 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
2What is a race condition, and how does it differ conceptually from a deadlock as two distinct categories of concurrency bugs? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
3How does Java's virtual threads feature (Project Loom, finalized in Java 21) fundamentally change the thread-per-task model for high-concurrency applications, and how do they differ from traditional platform threads? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
4What is the difference between concurrency and parallelism, and which one does Node.js's event loop actually provide by default? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOBeginner
5What is job concurrency in a worker process, and how do you configure it safely in BullMQ? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesIntermediate
6How does the concurrency model of In-Memory OLTP differ from traditional disk based tables, and why does this improve performance? SQL Server › In-Memory OLTP (Memory-Optimized Tables)SQL ServerIn-Memory OLTP (Memory-Optimized Tables)Intermediate
7What is the difference between an optimistic and a pessimistic approach to handling concurrency, and where does SQL Server's snapshot isolation fit into this? SQL Server › Isolation & LockingSQL ServerIsolation & LockingIntermediate
8How does Lambda concurrency work, and what is the difference between reserved concurrency and the account level concurrency limit? AWS › Lambda & ServerlessAWSLambda & ServerlessIntermediate
9How do you handle optimistic concurrency conflicts in EF Core using a concurrency token (like RowVersion)? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessAdvanced
10How would you configure Kestrel's connection limits and thread pool behavior to handle high-concurrency production traffic without exhausting server resources? ASP.NET Core › Hosting Models: Kestrel, IIS & Reverse ProxiesASP.NET CoreHosting Models: Kestrel, IIS & Reverse ProxiesAdvanced
11How would you implement a concurrency-limited task queue in Node.js to process many async tasks without overwhelming a downstream resource? Node.js › Async PatternsNode.jsAsync PatternsAdvanced
12What is optimistic concurrency control, and how would you implement it to prevent lost updates when two users edit the same record simultaneously? Node.js › DatabasesNode.jsDatabasesAdvanced
13What is the difference between how Node.js handles I/O-bound concurrency versus CPU-bound work, and why does this distinction shape Node.js's ideal use cases? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
14How does Node.js achieve high concurrency for I/O-bound workloads despite running JavaScript on a single main thread? Node.js › Node.js Fundamentals & Runtime ArchitectureNode.jsNode.js Fundamentals & Runtime ArchitectureAdvanced
15What is Redshift Concurrency Scaling, and how does it handle sudden spikes in query load? AWS › Amazon Redshift & Data WarehousingAWSAmazon Redshift & Data WarehousingAdvanced
16What is the UI thread and why must UI updates happen on it? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingBeginner
17What is the UI thread and why must UI updates happen on it? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingBeginner
18How do you run CPU-bound work without blocking the UI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
19What are common async/await pitfalls in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
20How do you run CPU-bound work without blocking the UI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
21What are common async/await pitfalls in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingIntermediate
22How do you cancel long-running operations in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
23How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
24How do you cancel long-running operations in MAUI? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
25How do you safely update collections bound to the UI from background threads? .NET MAUI › Concurrency & Threading.NET MAUIConcurrency & ThreadingAdvanced
26Is JavaScript single-threaded, and what does that mean in practice? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyBeginner
27What is the call stack? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyBeginner
28How do you create and run a basic thread using the threading module? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
29What is the basic pattern for running an async function using asyncio.run()? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Beginner
30What 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
31What 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
32What is the difference between the microtask queue and the macrotask (task) queue? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyIntermediate
33How does the event loop decide what to run next? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyIntermediate
34Why does a long synchronous function block UI updates and event handling? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyIntermediate
35How 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
36How do you run multiple coroutines concurrently using asyncio.gather()? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
37How 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
38How does multiprocessing.Pool let you parallelize a CPU-bound function across multiple worker processes? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
39What is a race condition, and how does it differ from a deadlock? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
40What is the synchronized keyword, and how does it use Java's intrinsic (monitor) locks to prevent race conditions on shared mutable state? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
41What is the ExecutorService framework, and why is it generally preferred over manually creating and managing individual Thread objects? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
42What causes a deadlock in multithreaded Java code, and what is the classic "lock ordering" strategy for preventing it? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
43What are the atomic classes in java.util.concurrent.atomic (AtomicInteger, AtomicLong, AtomicReference), and how do they achieve thread-safe operations without traditional locking? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
44What is thread starvation, and how can thread priority misuse or unfair lock scheduling contribute to it? Java › Concurrency & ThreadsJavaConcurrency & ThreadsIntermediate
45What 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
46Why does Promise.resolve().then(cb) run before setTimeout(cb, 0), even with a 0ms delay? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyAdvanced
47How would you break a large synchronous task into chunks to keep the UI responsive? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyAdvanced
48What is 'starvation' of the macrotask queue, and how can recursive microtasks cause it? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyAdvanced
49How does async/await map onto the microtask queue under the hood? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyAdvanced
50What's the relationship between requestAnimationFrame and the event loop's rendering step? JavaScript › Event Loop & ConcurrencyJavaScriptEvent Loop & ConcurrencyAdvanced
51How 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
52How 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
53How 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
54How 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
55How 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
56How 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
57How 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
58How 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
59How 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
60How does the Java Memory Model's happens-before relationship formally define when changes made by one thread are guaranteed to be visible to another thread, and what role does the volatile keyword play? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
61How would you use CountDownLatch, CyclicBarrier, and Semaphore for different thread coordination scenarios, and what distinguishes their use cases? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
62How would you diagnose a suspected thread deadlock in a running production JVM using a thread dump, and what specific information in the dump reveals the deadlock? Java › Concurrency & ThreadsJavaConcurrency & ThreadsAdvanced
63Where are lambdas most commonly used? C++ › Lambda ExpressionsC++Lambda ExpressionsBeginner
64What is a coroutine in C++20? C++ › CoroutinesC++CoroutinesBeginner
65What do co_await, co_yield, and co_return do? C++ › CoroutinesC++CoroutinesBeginner
66What are typical use cases for coroutines? C++ › CoroutinesC++CoroutinesBeginner
67How do coroutines differ from threads? C++ › CoroutinesC++CoroutinesBeginner
68What is an async generator, and how does it differ from a regular generator? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
69How do you consume an async generator using 'async for'? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
70What is an async context manager, and which two dunder methods does it require? Python › Async Generators & Async Context ManagersPythonAsync Generators & Async Context ManagersBeginner
71What 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
72What 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
73What is the purpose of the ServerCallContext parameter present in every gRPC server method, and what information does it expose? .NET › gRPC Services.NETgRPC ServicesBeginner
74What is the Singleton pattern, and how would you implement a thread-safe Singleton in Java? Java › Design Patterns in JavaJavaDesign Patterns in JavaBeginner
75Why was the modern java.time API (introduced in Java 8) created to replace the legacy Date and Calendar classes, and what specific problems did the old classes have? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Beginner
76What is the difference between the async and await keywords in C#, and how do they work together? C# › Asynchronous ProgrammingC#Asynchronous ProgrammingBeginner
77What is the difference between a coroutine and a regular function? C++ › CoroutinesC++CoroutinesIntermediate
78What are common causes of undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorIntermediate
79How do you include structured context (like a request ID) in every log message using LoggerAdapter or extra? Python › LoggingPythonLoggingIntermediate
80How does Python's generational garbage collector work, and why generations? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
81What 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
82How do you implement server-streaming gRPC using C#'s IAsyncEnumerable<T> or IServerStreamWriter<T>? .NET › gRPC Services.NETgRPC ServicesIntermediate
83What are the phases of class loading (loading, linking, initialization), and what specifically happens during each? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
84What is the difference between fail-fast and fail-safe iterators in the Collections Framework, and which collections use each? Java › Collections FrameworkJavaCollections FrameworkIntermediate
85What is the purpose of the Deque interface, and how does it unify both stack (LIFO) and queue (FIFO) behavior in a single interface? Java › Collections FrameworkJavaCollections FrameworkIntermediate
86What is the purpose of the Collections utility class's synchronization wrappers (Collections.synchronizedList(), etc.), and how do they differ from genuinely concurrent collections like ConcurrentHashMap? Java › Collections FrameworkJavaCollections FrameworkIntermediate
87What is the difference between a stop-the-world (STW) GC pause and a concurrent GC phase, and why can't garbage collection be made entirely concurrent with zero pauses? Java › Garbage CollectionJavaGarbage CollectionIntermediate
88What is a local class's access to effectively-final local variables, and how does this same rule (and the underlying reason for it) apply identically to anonymous classes and lambdas? Java › Inner Classes & Anonymous ClassesJavaInner Classes & Anonymous ClassesIntermediate
89How do you parse and format date/time values using DateTimeFormatter, and how does this replace the older, notoriously thread-unsafe SimpleDateFormat class? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Intermediate
90How 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
91What is the relationship between const and thread safety? C++ › Const CorrectnessC++Const CorrectnessAdvanced
92What are the performance and memory considerations of coroutines? C++ › CoroutinesC++CoroutinesAdvanced
93What is a data race and why is it undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorAdvanced
94How do you run multiple async iterators concurrently and merge their results? JavaScript › Async Iterators & StreamsJavaScriptAsync Iterators & StreamsAdvanced
95Why can errors thrown inside a setTimeout callback NOT be caught by a surrounding try/catch? JavaScript › Error HandlingJavaScriptError HandlingAdvanced
96Why can setInterval() be a subtle source of memory leaks, and how do you avoid it? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionAdvanced
97How does a WebSocket connection differ fundamentally from repeated fetch() requests? JavaScript › Networking: Fetch, XHR, WebSockets & CORSJavaScriptNetworking: Fetch, XHR, WebSockets & CORSAdvanced
98How 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
99How 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
100How 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
101How 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
102How would you implement a thread-safe caching decorator that correctly handles concurrent calls from multiple threads? Python › DecoratorsPythonDecoratorsAdvanced
103How does Python 3.11's exception groups (ExceptionGroup) and the 'except*' syntax let you handle MULTIPLE unrelated exceptions raised together? Python › Exception HandlingPythonException HandlingAdvanced
104How would you implement a circuit breaker pattern using exception handling, to stop repeatedly calling a service that's consistently failing? Python › Exception HandlingPythonException HandlingAdvanced
105How 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
106How would you implement a lazy, chainable iterator pipeline (like filter-then-map) from scratch? Python › Iterators & the Iterator ProtocolPythonIterators & the Iterator ProtocolAdvanced
107Why is logging generally considered thread-safe, and what should you still be careful about in multiprocessing? Python › LoggingPythonLoggingAdvanced
108What are common patterns for implementing a producer-consumer background processing pipeline using Channel<T> with a BackgroundService? .NET › Background Services.NETBackground ServicesAdvanced
109What 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
110How would you diagnose a thread pool starvation issue in a production ASP.NET Core application? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
111How does async/await performance compare to synchronous code, and what overhead does the async state machine introduce? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
112What 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
113How 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
114How 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
115What 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
116How 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
117How would you efficiently copy, resize, or merge large arrays in Java, and what are the performance trade-offs between System.arraycopy(), Arrays.copyOf(), and manual loops? Java › Arrays & Multidimensional ArraysJavaArrays & Multidimensional ArraysAdvanced
118How does a thread context ClassLoader (Thread.currentThread().getContextClassLoader()) solve the problem of a core JDK class needing to load an application-provided implementation class, given parent delegation normally prevents this? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
119How does the Collections Framework's fail-fast modCount mechanism actually work internally, and why is it described as "best-effort" rather than a strict guarantee? Java › Collections FrameworkJavaCollections FrameworkAdvanced
120How would you implement the Observer pattern in Java, and how does it compare to using the built-in PropertyChangeSupport or a reactive streams library? Java › Design Patterns in JavaJavaDesign Patterns in JavaAdvanced
121How does Java implement enums under the hood at the bytecode level (extending java.lang.Enum), and what makes them inherently thread-safe and serialization-safe as singletons? Java › EnumsJavaEnumsAdvanced
122How does a lambda expression capture variables from its enclosing scope, and why must captured local variables be effectively final? Java › Functional Interfaces & Method ReferencesJavaFunctional Interfaces & Method ReferencesAdvanced
123How would you implement memoization (caching function results) as a higher-order function wrapping an existing Function, and what thread-safety considerations apply for a memoized function used concurrently? Java › Functional Interfaces & Method ReferencesJavaFunctional Interfaces & Method ReferencesAdvanced
124How would you diagnose a memory leak in a Java application (where memory usage grows unboundedly despite garbage collection running) using heap dump analysis, and what common patterns cause 'leaks' in a garbage-collected language? Java › Garbage CollectionJavaGarbage CollectionAdvanced
125How does the JVM's tri-color marking algorithm (used by concurrent garbage collectors like G1) work to identify reachable objects while application threads continue running concurrently, and what problem does a write barrier solve in this context? Java › Garbage CollectionJavaGarbage CollectionAdvanced
126How does java.nio's Channel and Buffer abstraction differ fundamentally from the classic java.io Stream model, and what specific capability does this enable for non-blocking I/O? Java › I/O & NIOJavaI/O & NIOAdvanced
127How 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
128How 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
129How does the Instant class represent a point in time, and how does it differ fundamentally from ZonedDateTime in terms of what it actually represents and how it should be used? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Advanced
130What is the difference between Task and Thread in C#, and when would you deliberately choose one over the other? C# › Asynchronous ProgrammingC#Asynchronous ProgrammingAdvanced
131What is ValueTask<T> in C#, and when does it actually provide a meaningful performance benefit over Task<T>? C# › Asynchronous ProgrammingC#Asynchronous ProgrammingAdvanced
132How does async/await work under the hood in C#, and what specifically happens when execution reaches an 'await'? C# › Asynchronous ProgrammingC#Asynchronous ProgrammingAdvanced