0% found this document useful (0 votes)
4 views3 pages

Tutorial 7

The document outlines a tutorial focused on improving an E-commerce Order Processing Module by addressing production issues such as incorrect order totals and system crashes. It includes tasks for creating a code checklist, performing a code review, refactoring code for better readability and modularity, and building a recommendation engine with optimized algorithms. Additionally, it discusses optimizing a payment processing system using design patterns to enhance extensibility and maintainability.

Uploaded by

Aryan Vasishta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Tutorial 7

The document outlines a tutorial focused on improving an E-commerce Order Processing Module by addressing production issues such as incorrect order totals and system crashes. It includes tasks for creating a code checklist, performing a code review, refactoring code for better readability and modularity, and building a recommendation engine with optimized algorithms. Additionally, it discusses optimizing a payment processing system using design patterns to enhance extensibility and maintainability.

Uploaded by

Aryan Vasishta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Tutorial-7

Question1: You joined a team maintaining an E-commerce Order Processing Module. Recently
reported production issues:

• Orders sometimes created with wrong total amount


• System crashes when cart is empty
• Code is hard to maintain and extend
• Payment logic repeated in multiple places
• Performance slow for large cart sizes

You are given the following existing code.

Existing Production Code


PART A: Create a Code Checklist and identify at least 8 checklist violations in the given code.

PART B: Perform Code Review and answer:

• Find logical bugs


• Find performance improvement scope
• Suggest design improvements
• Suggest test cases

PART C: Refactor code to:

• Improve readability
• Improve modularity
• Make payment logic extensible

Question 2: You are building a recommendation engine. Need to check if any two prices sum to
target.

• Find time complexity


• Optimize using better data structure
• Write optimized code
• Compare time complexity

Question 3: The following question shows payment processing system which gives bad code,
optimization task, design pattern task
Bad Code

Optimization Task

• Remove repeated printing logic


• Improve extensibility

Design Pattern Task

Apply Strategy Pattern:

• Create base Payment interface


• Create derived payment classes

You might also like