Oracle | Onsite | Design Calculator Using Composite Pattern

554
Dec 07, 2024
Dec 07, 2024

Description:
I was asked in an Oracle onsite interview to design a calculator using the Composite design pattern. The problem involves creating a system where mathematical expressions like 2 + (3 * 4) can be represented and computed.

Problem Statement:
Design a calculator using the Composite design pattern. The calculator should support operations such as addition, subtraction, multiplication, and division. Nested expressions like (2 + (3 * 4)) should also be supported.

Please UPVOTE if you find helpful.

Comments (1)