Skip to content

Latest commit

 

History

History
41 lines (21 loc) · 2.13 KB

File metadata and controls

41 lines (21 loc) · 2.13 KB

💬 Interview Q&A - Lab 31: AI-Driven Refactor with Metrics

1️⃣ What was the primary goal of this lab?

Answer: Measured legacy Python code complexity, refactored the pricing logic into a strategy-based design, and validated the change with metrics, benchmarks, and correctness tests.

2️⃣ Which main tools or components were used?

Answer: The main stack for this lab included Python 3.12, Radon, Pylint, Pytest, along with supporting Linux command-line validation and file-based project structure management.

3️⃣ What role did refactored_calculator.py play in the implementation?

Answer: refactored_calculator.py was one of the key implementation files used to deliver the main workflow for the lab and to keep the logic separated from helper commands and documentation.

4️⃣ How was correctness or successful execution verified?

Answer: Radon metrics, benchmark comparison, and six correctness test cases.

5️⃣ What was the most important operational check in this lab?

Answer: Average cyclomatic complexity reduced from 9.50 to 2.17.

6️⃣ What type of failure or risk was this lab designed to control?

Answer: Metrics-backed refactoring is useful when reducing technical debt without breaking production logic.

7️⃣ How does this lab relate to real production work?

Answer: It maps closely to real operational workflows where automation, validation, and controlled execution are required before changes or outputs can be trusted.

8️⃣ Why were separate commands and output files documented?

Answer: Keeping commands.sh and output.txt separate makes the lab easier to review, reproduce, troubleshoot, and present in a portfolio-friendly format.

9️⃣ How could this implementation be extended in a production environment?

Answer: A practical next step would be to add stronger monitoring, structured logging, automated tests, and integration with surrounding services such as CI/CD systems, webhooks, or dashboards.

10️⃣ What was the biggest learning takeaway from this exercise?

Answer: How to baseline code quality before changing legacy logic.