All fields

“Memory Management” in Information Technology

116 questions across 13 technologies.

Information Technology

116 questions in 13 technologies

#QuestionTechnologyTopicLevel
1What is RAII and how does it relate to memory management? C++ › Memory ManagementC++Memory ManagementIntermediate
2What 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
3What is a memory leak? C++ › Memory ManagementC++Memory ManagementBeginner
4What is the difference between shallow copy and deep copy in memory terms? C++ › Memory ManagementC++Memory ManagementAdvanced
5What is memory alignment and why does it matter? C++ › Memory ManagementC++Memory ManagementAdvanced
6What is the difference between a memory leak and a resource leak? C++ › Memory ManagementC++Memory ManagementAdvanced
7What tools help detect memory errors in C++? C++ › Memory ManagementC++Memory ManagementAdvanced
8What is the difference between the stack and the heap in .NET memory management? C# › Memory & Garbage CollectionC#Memory & Garbage CollectionBeginner
9What is the difference between the stack and the heap? C++ › Memory ManagementC++Memory ManagementBeginner
10What do new and delete do? C++ › Memory ManagementC++Memory ManagementBeginner
11What is a dangling pointer and how does it arise? C++ › Memory ManagementC++Memory ManagementIntermediate
12What is the difference between malloc/free and new/delete? C++ › Memory ManagementC++Memory ManagementIntermediate
13What is placement new? C++ › Memory ManagementC++Memory ManagementIntermediate
14What causes a stack overflow? C++ › Memory ManagementC++Memory ManagementIntermediate
15What is garbage collection in the JVM, and what fundamental problem does it solve compared to manual memory management (like in C/C++)? Java › Garbage CollectionJavaGarbage CollectionBeginner
16What memory management considerations apply specifically to long running PHP CLI scripts, such as queue workers, that might process thousands of jobs without ever restarting? PHP › PHP CLI ScriptingPHPPHP CLI ScriptingAdvanced
17How does Python primarily manage memory for objects? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionBeginner
18How does JavaScript decide when to free memory used by an object? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionBeginner
19What is a memory leak in JavaScript, given that it has automatic garbage collection? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionBeginner
20How can an unremoved event listener cause a memory leak? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionIntermediate
21What is the sys.getsizeof() function, and what are its limitations for measuring memory usage? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
22How do context managers and the `del` statement relate to timely memory cleanup versus relying on garbage collection? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
23How does the gc module let you inspect and debug memory leaks caused by uncollectable objects? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
24How do mutable default arguments create a subtle memory and correctness pitfall related to object lifetime? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
25How does the tracemalloc module help track where memory is being allocated in a running program? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
26How can a growing array used as a cache with no eviction policy become a memory leak? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionAdvanced
27Why can setInterval() be a subtle source of memory leaks, and how do you avoid it? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionAdvanced
28How does using WeakMap/WeakSet as a design choice actively prevent certain classes of memory leaks? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionAdvanced
29How does the weakref module help avoid reference cycles and memory leaks? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
30How does object interning (like small integer caching and string interning) affect memory and identity comparisons? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
31How can generators and iterators help reduce peak memory usage compared to building full lists? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
32What is memory fragmentation in the context of Python's object allocator, and how does pymalloc address it for small objects? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
33What is a reference cycle, and why can't simple reference counting free it? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
34How do closures unintentionally keep large objects alive longer than expected? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionIntermediate
35What is the difference between the generational garbage collection strategy's 'young' and 'old' generations? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionIntermediate
36How does Python's generational garbage collector work, and why generations? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
37How does mark-and-sweep garbage collection actually determine which objects are reachable? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionAdvanced
38How would you use Chrome DevTools' heap snapshot comparison to find a leak's source? JavaScript › Memory Management & Garbage CollectionJavaScriptMemory Management & Garbage CollectionAdvanced
39Why is __del__ (the finalizer method) discouraged for critical cleanup logic, and what problems can it cause? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
40How do circular references between objects with __del__ methods behave differently in Python 3.4+ compared to earlier versions? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
41How do you diagnose and fix memory leaks in MAUI? .NET MAUI › Performance & Optimization.NET MAUIPerformance & OptimizationIntermediate
42How do you diagnose and fix memory leaks in MAUI? .NET MAUI › Performance & Optimization.NET MAUIPerformance & OptimizationIntermediate
43How does std::string manage memory and what is SSO? C++ › Strings & string_viewC++Strings & string_viewIntermediate
44What is a memory dump, and how do you capture and analyze one for a .NET application experiencing high memory usage or a crash? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceIntermediate
45How do you configure a .NET container to respect memory and CPU limits set by the container orchestrator (like Kubernetes resource limits)? .NET › Docker & Containerization.NETDocker & ContainerizationIntermediate
46Why is buffering an entire large file upload in memory (via IFormFile) problematic, and how does streaming avoid this issue? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesIntermediate
47How would you implement a Least Recently Used (LRU) cache in Node.js, and why is eviction necessary for an in-memory cache? Node.js › CachingNode.jsCachingIntermediate
48How do you use Node's built-in heap snapshot capability to diagnose a suspected memory leak? Node.js › Debugging & DiagnosticsNode.jsDebugging & DiagnosticsIntermediate
49What is process.memoryUsage(), and how would you use it to monitor a Node.js application's memory consumption? Node.js › Global Objects & the process ObjectNode.jsGlobal Objects & the process ObjectIntermediate
50What are the performance and memory considerations of coroutines? C++ › CoroutinesC++CoroutinesAdvanced
51How do you properly clean up event listeners to avoid memory leaks? JavaScript › DOM & EventsJavaScriptDOM & EventsAdvanced
52How do you use memory_profiler (or tracemalloc from the standard library) to identify a memory leak's source in a Python application? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
53How would you profile memory allocations specifically (not just CPU time) to find which objects are consuming the most memory in a running process? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
54How does the CLR ensure type safety and memory safety, and what categories of bugs does this prevent compared to unmanaged languages like C++? .NET › CLR & Runtime.NETCLR & RuntimeAdvanced
55How does the dotnet-gcdump tool help diagnose managed memory leaks, and how do you analyze the resulting heap snapshot? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
56How does the DI container's disposal behavior work for IDisposable services registered as Transient, and why can this cause unexpected memory retention? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionAdvanced
57What is a memory leak in the context of a long-running Node.js server, and what are the most common causes? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
58How does resource sizing work for a Fargate task, and what CPU and memory combinations are supported? AWS › AWS FargateAWSAWS FargateIntermediate
59What is a 'circuit' in Blazor Server, and how does server-side state management work across it? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Advanced
60What are the practical performance considerations of reading from SharedPreferences repeatedly throughout your app, and how does properly caching those particular values in memory help meaningfully avoid genuinely unnecessary repeated disk access? Flutter › Local Data Storage with SharedPreferencesFlutterLocal Data Storage with SharedPreferencesAdvanced
61What is std::string and how does it differ from a C-string? C++ › Strings & string_viewC++Strings & string_viewBeginner
62What is undefined behavior (UB) in C++? C++ › Undefined BehaviorC++Undefined BehaviorBeginner
63Why is reading an uninitialized variable undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorBeginner
64What is the difference between reading a file with .read(), .readline(), and .readlines()? Python › File I/O & Context ManagersPythonFile I/O & Context ManagersBeginner
65What is the difference between functools.cache and functools.lru_cache? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsBeginner
66What is the CLR (Common Language Runtime), and what are its core responsibilities? .NET › CLR & Runtime.NETCLR & RuntimeBeginner
67What tools does .NET provide for basic application diagnostics, and what is dotnet-trace used for? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceBeginner
68How do you specify the underlying type of an enum? C++ › Enums & Enum ClassesC++Enums & Enum ClassesIntermediate
69What are the dangers of std::string_view? C++ › Strings & string_viewC++Strings & string_viewIntermediate
70How do you efficiently build up a large string? C++ › Strings & string_viewC++Strings & string_viewIntermediate
71Why should you avoid returning std::string_view to local data? C++ › Strings & string_viewC++Strings & string_viewIntermediate
72What is the difference between a coroutine and a regular function? C++ › CoroutinesC++CoroutinesIntermediate
73What are common pitfalls when using coroutines? C++ › CoroutinesC++CoroutinesIntermediate
74What are common causes of undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorIntermediate
75How do you detect and prevent undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorIntermediate
76What's the difference between slice() and subarray() on a TypedArray? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataIntermediate
77What are the size limits of localStorage compared to IndexedDB? JavaScript › Browser Storage & Web APIsJavaScriptBrowser Storage & Web APIsIntermediate
78What is a WeakMap and why can't you iterate over its keys? JavaScript › Map, Set, WeakMap & WeakSetJavaScriptMap, Set, WeakMap & WeakSetIntermediate
79When would you choose a WeakSet over a Set? JavaScript › Map, Set, WeakMap & WeakSetJavaScriptMap, Set, WeakMap & WeakSetIntermediate
80What is a generator expression, and how does it differ syntactically and behaviorally from a list comprehension? Python › Comprehensions & GeneratorsPythonComprehensions & GeneratorsIntermediate
81How 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
82What's the difference between shallow copy and deep copy for a nested data structure, and which functions perform each? Python › Data Types & StructuresPythonData Types & StructuresIntermediate
83How does Python's module import system avoid re-executing a module multiple times when imported from different places? Python › Modules & PackagingPythonModules & PackagingIntermediate
84How does the CLR's type system distinguish between value types and reference types, and where is each typically allocated? .NET › CLR & Runtime.NETCLR & RuntimeIntermediate
85What does the `unsafe` keyword and pointer usage in C# allow, and why would a developer opt into it? .NET › CLR & Runtime.NETCLR & RuntimeIntermediate
86What is the difference between the CLR's Server GC and Workstation GC modes, and how do you choose between them? .NET › CLR & Runtime.NETCLR & RuntimeIntermediate
87What is BenchmarkDotNet, and why is it preferred over manual Stopwatch-based timing for measuring code performance? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceIntermediate
88What is the Large Object Heap (LOH), and why do objects larger than 85,000 bytes behave differently in the garbage collector? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceIntermediate
89How would you generate and interpret a CPU profile for a Node.js application using the built-in --prof flag? Node.js › Performance Optimization & ProfilingNode.jsPerformance Optimization & ProfilingIntermediate
90How do you optimize image loading and caching in MAUI? .NET MAUI › Performance & Optimization.NET MAUIPerformance & OptimizationAdvanced
91How do you optimize image loading and caching in MAUI? .NET MAUI › Performance & Optimization.NET MAUIPerformance & OptimizationAdvanced
92How can undefined behavior cause 'impossible' optimizations and bugs? C++ › Undefined BehaviorC++Undefined BehaviorAdvanced
93How can you grow an ArrayBuffer after it's been created? JavaScript › ArrayBuffer, TypedArrays & Binary DataJavaScriptArrayBuffer, TypedArrays & Binary DataAdvanced
94How do you convert a Node.js Readable stream into an async iterable? JavaScript › Async Iterators & StreamsJavaScriptAsync Iterators & StreamsAdvanced
95How do you check available and used storage quota in a browser? JavaScript › Browser Storage & Web APIsJavaScriptBrowser Storage & Web APIsAdvanced
96How do WeakRef and FinalizationRegistry extend the weak-reference capabilities beyond WeakMap/WeakSet? JavaScript › Map, Set, WeakMap & WeakSetJavaScriptMap, Set, WeakMap & WeakSetAdvanced
97How does lazy evaluation in a chained sequence of generator expressions actually process elements, one at a time end-to-end, without intermediate lists? Python › Comprehensions & GeneratorsPythonComprehensions & GeneratorsAdvanced
98How 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
99How does Python's small integer caching (interning) affect identity comparisons ('is') versus equality comparisons ('==') for integers? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
100How does Python's list implementation achieve amortized O(1) append performance despite lists being dynamically resizable arrays under the hood? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
101How would you implement a lazy, cached property using a custom descriptor (or functools.cached_property) that only computes its value once? Python › Descriptors & PropertiesPythonDescriptors & PropertiesAdvanced
102How would you use a WeakKeyDictionary inside a descriptor to store per-instance data without relying on the instance's own __dict__ or requiring a dedicated __slots__ entry? Python › Descriptors & PropertiesPythonDescriptors & PropertiesAdvanced
103What is functools.cached_property and how does it differ from @property combined with manual caching? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
104Why is caution needed when applying @lru_cache directly to instance methods? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
105How does itertools.tee let you iterate over the same iterator multiple times independently? Python › Iterators & the Iterator ProtocolPythonIterators & the Iterator ProtocolAdvanced
106How do RotatingFileHandler and TimedRotatingFileHandler prevent log files from growing unbounded? Python › LoggingPythonLoggingAdvanced
107How do __iadd__ and other in-place operator methods (__isub__, __imul__) differ from their non-in-place counterparts? Python › Magic Methods & Operator OverloadingPythonMagic Methods & Operator OverloadingAdvanced
108How does __slots__ interact with magic methods and instance attribute storage? Python › Magic Methods & Operator OverloadingPythonMagic Methods & Operator OverloadingAdvanced
109How does Span<T> improve performance for buffer and array manipulation compared to traditional array slicing? .NET › CLR & Runtime.NETCLR & RuntimeAdvanced
110How does the DI container's disposal behavior work for IDisposable and IAsyncDisposable services across different lifetimes? .NET › Dependency Injection.NETDependency InjectionAdvanced
111How does async/await performance compare to synchronous code, and what overhead does the async state machine introduce? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
112How would you profile and reduce excessive garbage collection pauses affecting application latency? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceAdvanced
113How does EF Core's change tracking work, and what is the difference between tracked and no-tracking queries? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessAdvanced
114What is V8's hidden class mechanism, and why does it matter for writing performant Node.js code? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
115What is the default maximum listener limit on an EventEmitter, and why does Node.js warn when it's exceeded? Node.js › Events & EventEmitterNode.jsEvents & EventEmitterAdvanced
116What is JIT (Just-In-Time) compilation deoptimization in V8, and how can you detect when it's hurting a hot function's performance? Node.js › Performance Optimization & ProfilingNode.jsPerformance Optimization & ProfilingAdvanced