InterviewLegend

Design a Calculator in OOP

Sometimes asked
Alex Chen20 min readGuide updated

This one comes from India campus loops between 2020 and 2023. In July 2023 a Pune campus candidate for a full-time SDE role got it in the Pro-Fit round, with the percentage and mod follow-up. In a 2020 virtual campus drive, a technical round asked for a calculator implementation in code. That candidate couldn't cover every case and the interviewer still liked the approach. A third 2023 round didn't ask for a calculator but shows what these rounds want. The interviewer gave a problem statement and asked for it as classes. The candidate reached for inheritance and more. Afterwards the interviewer described the approach he'd have used, and it was "just a very basic single class."

So the prompt is easy, and what separates answers is taste. Anyone can add two numbers. A strong answer is a model you can write by hand in ten minutes that still reads as object-oriented, shaped so the follow-up costs a couple of lines.

The Deutsche Bank angle
The July 2023 version came in the Pro-Fit round, which is mostly projects and situational questions. Expect less interest in algorithms and more in whether you think in objects. The code goes on paper, so keep every method short enough to write cleanly by hand.

Deutsche BankPremium lesson · System design round

The Deutsche Bank design, worked end to end.

  1. Requirements and scopeSystem design
  2. The design, drawn out1 diagram
  3. 5 deep divesWith the tradeoffs
Get the Deutsche Bank questions

$49 a year · all 107 companies · instant access

20,000+ candidate reports

Deutsche Bank interview guide

Know what Deutsche Bank asks before you walk in.

28 coding · 5 system design · 29 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Had your Deutsche Bank interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.