58 questions for “Debugging & Profiling”

Found in 1 field. Select a question to see its full answer.

Information Technology

58 questions in 3 technologies

#QuestionTechnologyTopicLevel
1How do you use print statements effectively for debugging, including showing variable names alongside values? Python › Debugging & ProfilingPythonDebugging & ProfilingBeginner
2How do assert statements work for debugging, and why should they NOT be relied upon for production input validation? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
3How do you use Python's built-in 'warnings' module to surface deprecated or risky code paths during debugging? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
4How 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
5How do you use the timeit module to accurately measure a small code snippet's execution time? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
6How do you use cProfile to identify which functions are consuming the most time in a larger program? Python › Debugging & ProfilingPythonDebugging & ProfilingIntermediate
7How 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
8How 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
9How 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
10How do you use the built-in pdb debugger to pause execution at a specific line? Python › Debugging & ProfilingPythonDebugging & ProfilingBeginner