Module 4 challenge: Debug and solve software problems :Troubleshooting and Debugging Techniques (Google IT Automation with Python Professional Certificate) Answers 2025
1. Elements involved in generating the report (select all that apply)
✔️ Generating output based on the start date
❌ Handling TypeError for date inputs
❌ Processing hourly data
✔️ Parsing date inputs from user
2. Type of error that caused the crash
❌ ValueError
❌ FileNotFoundError
✔️ TypeError
❌ SyntaxError
3. Importance of reproducing the TypeError
✔️ To verify that the error consistently occurs under the same conditions
❌ To test script performance
✔️ To understand the circumstances leading to the error
❌ To ensure the script is completely error-free
4. Key indicator that a script has been optimized
❌ Ability to process larger files only
✔️ Reduced execution time to a few seconds for report generation
❌ Enhanced graphical user interface
❌ Increased complexity for better accuracy
5. Cast the data type of year, month, and day to
✔️ integers
❌ revise call parameters
❌ concatenating strings
❌ text and use print()
6. Primary role of get_same_or_newer()
❌ Calculates total employees starting on a date
❌ Sorts data by start dates
❌ Generates graphical representations
✔️ Filters and processes employee data based on start dates
7. How preprocessing addresses slow report generation
❌ Cleans and sanitizes data
✔️ Organizes data by start dates for efficient access
❌ Indexes the file for faster search
❌ Compresses the file
8. Effective strategy for dealing with complex debugging
❌ Consult online forums only
✔️ Break down the problem into smaller, manageable parts
❌ Implement automated testing to identify all issues at once
❌ Completely rewrite sections of the script
9. Benefit of sorting data by start_date before processing
❌ Ensures data integrity only
❌ Reduces file size
✔️ Enhances performance by allowing quicker access to relevant records
❌ Aligns with standard database practices
10. Why get_same_or_newer() was inefficient originally
❌ Generated unnecessary intermediate files
❌ Used a computationally expensive sorting algorithm
❌ Relied on external network resources
✔️ Downloaded and processed the entire data file for each date queried
📌 Summary Table
| Q# | Correct Answer(s) |
|---|---|
| 1 | Generating output ✔️, Parsing date inputs ✔️ |
| 2 | TypeError ✔️ |
| 3 | Verify error ✔️, Understand circumstances ✔️ |
| 4 | Reduced execution time ✔️ |
| 5 | Integers ✔️ |
| 6 | Filters/process employee data ✔️ |
| 7 | Organizes data by start dates ✔️ |
| 8 | Break down problem ✔️ |
| 9 | Enhances performance ✔️ |
| 10 | Downloaded/processed entire data for each query ✔️ |