All fields

“Profiling” in Information Technology

127 questions across 6 technologies.

Information Technology

127 questions in 6 technologies

#QuestionTechnologyTopicLevel
1How would you use jstat to monitor GC activity and heap generation sizes for a running JVM process in real time, without needing a full profiling tool? Java › Garbage CollectionJavaGarbage CollectionIntermediate
2How do you use the timeit module to accurately measure a small code snippet's execution time? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
3How do you use cProfile to identify which functions are consuming the most time in a larger program? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
4How would you use the 'faulthandler' module to diagnose a program that crashes with a segmentation fault, typically from a C extension? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
5How would you use line_profiler (a third-party tool) to get LINE-BY-LINE timing information within a specific function, more granular than cProfile's function-level data? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
6How would you use py-spy (a sampling profiler) to profile a running Python process in PRODUCTION without restarting it or adding any code changes? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
7How do you use the built-in pdb debugger to pause execution at a specific line? Python › Debugging & ProfilingPythonDebugging & ProfilingBeginner
8How do you use print statements effectively for debugging, including showing variable names alongside values? Python › Debugging & ProfilingPythonDebugging & ProfilingBeginner
9How do you use the traceback module to capture and format a full exception traceback as a string, useful for logging? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
10How do assert statements work for debugging, and why should they NOT be relied upon for production input validation? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
11How do you use Python's built-in 'warnings' module to surface deprecated or risky code paths during debugging? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
12How 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
13What is load testing, and how would you use a tool like autocannon or k6 to benchmark a Node.js API's throughput and latency? Node.js › Performance Optimization & ProfilingNode.jsPerformance Optimization & ProfilingIntermediate
14What is the difference between vertical and horizontal performance optimization strategies for a Node.js application, and how do you decide which to pursue first? Node.js › Performance Optimization & ProfilingNode.jsPerformance Optimization & ProfilingIntermediate
15How 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
16How would you use the 'logging' module's exception logging (logger.exception()) INSIDE an except block to automatically capture the full traceback? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
17How do you use pdb's post-mortem debugging mode to inspect a program's state exactly at the point where an unhandled exception occurred? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
18How 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
19How do you use conditional breakpoints in pdb to pause execution only when a specific condition is met, avoiding manually stepping through many unrelated iterations? Python › Debugging & ProfilingPythonDebugging & ProfilingAdvanced
20What 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
21How would you optimize a Node.js application's JSON serialization performance for API responses with very large or very frequent payloads? Node.js › Performance Optimization & ProfilingNode.jsPerformance Optimization & ProfilingAdvanced
22Why is a bare 'except:' clause (catching everything with no type specified) generally discouraged? Python › Exception HandlingPythonException HandlingBeginner
23Why should you use the logging module instead of print() for diagnostic output? Python › LoggingPythonLoggingBeginner
24What are Python's five standard logging severity levels, from lowest to highest? Python › LoggingPythonLoggingBeginner
25How do you format log output to include the timestamp, logger name, level, and message? Python › LoggingPythonLoggingBeginner
26What is the difference between __str__ and __repr__? Python › Magic Methods & Operator OverloadingPythonMagic Methods & Operator OverloadingBeginner
27How does __repr__ help with debugging when printing a list of custom objects? Python › Magic Methods & Operator OverloadingPythonMagic Methods & Operator OverloadingBeginner
28What 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
29What is caching, and why is it commonly used to improve the performance of a Node.js application? Node.js › CachingNode.jsCachingBeginner
30What is the difference between fs.readFile() and fs.createReadStream() for reading a file in Node.js? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingBeginner
31What is a race condition, and how does it differ from a deadlock? Python › Concurrency (asyncio/threading/multiprocessing)PythonConcurrency (asyncio/threading/multiprocessing)Intermediate
32What is the difference between 'raise' and 'raise ... from ...' for exception chaining? Python › Exception HandlingPythonException HandlingIntermediate
33How do you access details about the exception currently being handled, like its type, value, and traceback, using sys.exc_info()? Python › Exception HandlingPythonException HandlingIntermediate
34How does the 'else' clause on a try statement work, and what's its purpose compared to just putting that code at the end of 'try'? Python › Exception HandlingPythonException HandlingIntermediate
35What is the relationship between Logger, Handler, Formatter, and Filter in the logging module? Python › LoggingPythonLoggingIntermediate
36What's the danger of using %-style, f-string, or .format() interpolation directly in a log call's message argument versus lazy % substitution? Python › LoggingPythonLoggingIntermediate
37How does Python's generational garbage collector work, and why generations? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
38What is the sys.getsizeof() function, and what are its limitations for measuring memory usage? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
39How does the gc module let you inspect and debug memory leaks caused by uncollectable objects? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
40How do mutable default arguments create a subtle memory and correctness pitfall related to object lifetime? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
41How does the tracemalloc module help track where memory is being allocated in a running program? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionIntermediate
42How do you troubleshoot a CORS error reported in browser developer tools, and what does the error message typically indicate? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingIntermediate
43What is the difference between running async operations sequentially with multiple awaits versus concurrently with Promise.all()? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
44What is job concurrency in a worker process, and how do you configure it safely in BullMQ? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesIntermediate
45How would you track and expose the progress of a long-running background job to the client that requested it? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesIntermediate
46What HTTP caching headers (Cache-Control, ETag) can a Node.js/Express API use to let clients and CDNs cache responses? Node.js › CachingNode.jsCachingIntermediate
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
48What is memoization, and how does it differ from a general-purpose external cache like Redis? Node.js › CachingNode.jsCachingIntermediate
49Why does Node.js provide a cluster module, given that a single Node.js process is single-threaded? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
50What is the difference between the number of CPU cores and the optimal number of cluster workers for a given Node.js application? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
51How do you gracefully terminate a worker thread, and what's the difference between worker.terminate() and letting it exit naturally? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
52What does the node:zlib module provide, and how would you use it to compress an HTTP response? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesIntermediate
53What is a database connection pool, and why does a Node.js application need one rather than opening a new connection per request? Node.js › DatabasesNode.jsDatabasesIntermediate
54What is database normalization, and what specific problems can over-normalization or under-normalization cause? Node.js › DatabasesNode.jsDatabasesIntermediate
55What is the N+1 query problem, and how does it commonly arise in a Node.js application using an ORM? Node.js › DatabasesNode.jsDatabasesIntermediate
56What is a multi-stage Docker build, and why is it commonly used for Node.js applications? Node.js › Docker & DeploymentNode.jsDocker & DeploymentIntermediate
57What is the purpose of setting explicit CPU and memory resource requests and limits for a Node.js container in Kubernetes? Node.js › Docker & DeploymentNode.jsDocker & DeploymentIntermediate
58What does 'non-blocking I/O' mean, and how does a Node.js function like fs.readFile() achieve it compared to fs.readFileSync()? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
59How does setImmediate() differ from process.nextTick() in terms of timing and typical use cases? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
60How does the event loop handle a large synchronous loop (like processing a huge array with a for loop), and what problem does this cause? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
61How would you measure how 'busy' the event loop is in a running Node.js process using a simple technique? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
62What is the difference between fs.appendFile() and opening a file with the 'a' flag and writing to it manually? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingIntermediate
63How would you copy a large file efficiently in Node.js, and what's the difference between fs.copyFile() and manually piping streams? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingIntermediate
64What is the difference between npm, Yarn, and pnpm as Node.js package managers, and what specific advantage does pnpm offer regarding disk space? Node.js › Git & Project ManagementNode.jsGit & Project ManagementIntermediate
65What is the difference between HTTP/1.1 and HTTP/2, and how does Node.js support HTTP/2 via the node:http2 module? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersIntermediate
66What is HTTP keep-alive, and how does it improve performance for a Node.js server handling many requests from the same client? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersIntermediate
67What is the purpose of the Content-Length and Transfer-Encoding: chunked headers, and why can't a response use both simultaneously? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersIntermediate
68What Redis data structures beyond simple string values are useful for a Node.js application, and what are they typically used for? Node.js › Caching with RedisNode.jsCaching with RedisIntermediate
69How would you read a large file efficiently using a stream rather than loading it entirely into memory with fs.readFile()? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleIntermediate
70What is over-fetching and under-fetching in REST APIs, and how does GraphQL specifically address both? Node.js › GraphQL with Node.jsNode.jsGraphQL with Node.jsIntermediate
71What is HTTP keep-alive, and how does Node's http.Agent manage connection reuse for outgoing requests? Node.js › HTTP & HTTPS ModulesNode.jsHTTP & HTTPS ModulesIntermediate
72What is an APM (Application Performance Monitoring) tool, and what capabilities does it typically add beyond basic logging? Node.js › Logging & MonitoringNode.jsLogging & MonitoringIntermediate
73What is the V8 JavaScript engine, and what role does it play within the Node.js runtime? Node.js › Node.js Fundamentals & Runtime ArchitectureNode.jsNode.js Fundamentals & Runtime ArchitectureIntermediate
74How do you profile a MAUI app to find performance bottlenecks? .NET MAUI › Performance & Optimization.NET MAUIPerformance & OptimizationAdvanced
75How do you profile a MAUI app to find performance bottlenecks? .NET MAUI › Performance & Optimization.NET MAUIPerformance & OptimizationAdvanced
76How would you profile whether a generator expression is actually providing a measurable memory or performance benefit over a list comprehension in a specific use case? Python › Comprehensions & GeneratorsPythonComprehensions & GeneratorsAdvanced
77How would you choose between a list, a set, a dict, and a specialized structure like heapq for efficiently finding the K smallest/largest elements in a large dataset? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
78How do you implement a descriptor-based ORM-style field that lazily loads related data only when actually accessed? Python › Descriptors & PropertiesPythonDescriptors & PropertiesAdvanced
79How does exception performance (raising/catching) compare to normal control flow, and why does Python's EAFP style still encourage using exceptions for routine control flow, unlike some other languages? Python › Exception HandlingPythonException HandlingAdvanced
80How do you correctly handle character encoding when reading text files that might not be UTF-8, and what error occurs if you guess wrong? Python › File I/O & Context ManagersPythonFile I/O & Context ManagersAdvanced
81Why is using a mutable default argument (like an empty list) a classic Python bug, and how do you avoid it? Python › Functions & ScopePythonFunctions & ScopeAdvanced
82How do you clear or inspect the cache of an lru_cache-decorated function? Python › functools & Functional Programming ToolsPythonfunctools & Functional Programming ToolsAdvanced
83How does itertools.groupby depend on input order, and what's a common mistake when using it? Python › Iterators & the Iterator ProtocolPythonIterators & the Iterator ProtocolAdvanced
84How does logger.exception() differ from logger.error(), and when should you use it? Python › LoggingPythonLoggingAdvanced
85How would you write a custom logging.Filter to redact sensitive data like passwords from log messages? Python › LoggingPythonLoggingAdvanced
86How does object interning (like small integer caching and string interning) affect memory and identity comparisons? Python › Memory Management & Garbage CollectionPythonMemory Management & Garbage CollectionAdvanced
87What 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
88How 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
89How does Python locate modules during import, and what is sys.path's role? Python › Modules & PackagingPythonModules & PackagingAdvanced
90Why does Python sometimes raise 'TypeError: Cannot create a consistent method resolution order'? Python › Multiple Inheritance & MROPythonMultiple Inheritance & MROAdvanced
91What is the libuv library, and what specific role does it play inside Node.js? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
92How do you use the --inspect flag and Chrome DevTools to profile a running Node.js application in production? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
93What 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
94What is backpressure in Node.js streams, and how do you handle it correctly when piping data? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
95What is monkey-patching in the context of Node.js APM (Application Performance Monitoring) tools, and what are its risks? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
96How 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
97How do you implement job prioritization in a Node.js queue system, and when is it necessary? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesAdvanced
98What is cache stampede (thundering herd), and how do you prevent it in a high-traffic Node.js service? Node.js › CachingNode.jsCachingAdvanced
99What is the 'stale-while-revalidate' caching strategy, and how would you implement it for an API response? Node.js › CachingNode.jsCachingAdvanced
100What is multi-tier caching (combining an in-memory L1 cache with a distributed L2 cache), and what problem does it solve? Node.js › CachingNode.jsCachingAdvanced
101How would you implement a write-behind (write-back) caching strategy, and what durability risk does it introduce? Node.js › CachingNode.jsCachingAdvanced
102What is auto-scaling, and what metrics commonly trigger scaling decisions for a Node.js service running in the cloud? Node.js › Cloud & DevOpsNode.jsCloud & DevOpsAdvanced
103How do you use SharedArrayBuffer to share memory directly between Node.js worker threads, and what are the safety considerations? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
104What is a worker thread pool, and why would you build one rather than creating a new Worker for every task? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
105What does the node:perf_hooks module provide, and how would you use it to measure precise execution time of a code block? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesAdvanced
106What is database indexing, and how does an index improve query performance in a Node.js application's database layer? Node.js › DatabasesNode.jsDatabasesAdvanced
107What is database replication, and how does a Node.js application typically route reads to replicas while sending writes to a primary? Node.js › DatabasesNode.jsDatabasesAdvanced
108What is database sharding, and what problem does it solve that replication alone doesn't address? Node.js › DatabasesNode.jsDatabasesAdvanced
109What is a database connection leak in a Node.js application, and how does it typically happen when using a connection pool? Node.js › DatabasesNode.jsDatabasesAdvanced
110How would you optimize Docker layer caching in a Node.js Dockerfile to speed up repeated builds during development? Node.js › Docker & DeploymentNode.jsDocker & DeploymentAdvanced
111What is 'event loop lag' (or 'event loop delay'), and how would you monitor it in a production Node.js application? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
112What is the poll phase of the event loop, and under what specific conditions does it block waiting versus move on immediately? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
113How would you implement a request-logging middleware in Express that captures method, path, status code, and response time for every request? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareAdvanced
114How would you implement conditional middleware in Express that only applies to certain requests based on a runtime condition? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareAdvanced
115How would you implement a global request timeout middleware in Express to prevent a slow request from hanging indefinitely? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareAdvanced
116How would you implement a directory-size calculator in Node.js that recursively sums the size of all files within a directory tree? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingAdvanced
117What is the N+1 query problem in GraphQL specifically, and how does DataLoader solve it? Node.js › GraphQLNode.jsGraphQLAdvanced
118How would you implement query complexity analysis or depth limiting in a GraphQL API to prevent a maliciously deep or expensive query from overwhelming the server? Node.js › GraphQLNode.jsGraphQLAdvanced
119How would you implement HTTP/2 server push in Node.js, and why has server push become less commonly recommended over time? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersAdvanced
120How would you implement HTTP/2 or HTTP/1.1 connection pooling on the client side in Node.js when making many outgoing requests to the same downstream API? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersAdvanced
121How would you implement HTTP response streaming in Node.js to begin sending data to a client before the entire response is ready, such as for a large report? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersAdvanced
122What is the N+1 query problem in the context of an ORM like Mongoose or Sequelize, and how do you avoid it? Node.js › Databases & ORMs (MongoDB/Mongoose, SQL/Sequelize)Node.jsDatabases & ORMs (MongoDB/Mongoose, SQL/Sequelize)Advanced
123How would you use the 'clinic.js' toolset (clinic doctor, clinic flame) to diagnose a Node.js performance problem? Node.js › Debugging & DiagnosticsNode.jsDebugging & DiagnosticsAdvanced
124What does PM2's built-in monitoring dashboard (pm2 monit, or PM2 Plus) show, and what metrics are most useful for production operations? Node.js › Deployment & Process Managers (PM2)Node.jsDeployment & Process Managers (PM2)Advanced
125What are Node.js file descriptor limits, and how might a Node.js application unintentionally exhaust them? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleAdvanced
126What is the N+1 query problem specific to GraphQL, and how does DataLoader solve it? Node.js › GraphQL with Node.jsNode.jsGraphQL with Node.jsAdvanced
127How would you implement HTTP/2 server push or basic HTTP/2 support in Node.js using the node:http2 module? Node.js › HTTP & HTTPS ModulesNode.jsHTTP & HTTPS ModulesAdvanced