KatInterview

Designing Business Logic and Evolving Public APIs

BehavioralModel answer
HardModel answerBehavioralobject-oriented-designapi-designbackward-compatibility

Last updated

Design extensible object-oriented backend logic and safely modify production APIs with versioning, compatibility, and rollout strategies.

You're working on a mature backend system that serves external clients. This problem has two parts:

Part 1: Implementing New Business Logic

Your team needs to add a feature to an existing service. Describe your approach to designing this using object-oriented principles. Address:

  • How you identify which domain objects to create
  • How you assign responsibilities across classes
  • How you keep orchestration separate from core business rules
  • How you ensure the design is testable and can accommodate future changes

Part 2: Modifying a Production API

You must change an endpoint that external clients already depend on. Outline the process you'd follow to ship this change without breaking existing integrations. Cover:

  • Evaluating backward compatibility
  • Choosing an appropriate versioning strategy
  • Testing approach before deployment
  • Rollout methodology
  • Monitoring and observability
  • Client communication plan

Use a concrete example to ground your answer. Explain your reasoning and the tradeoffs involved.

Hints

Hint 1

Start with a specific business scenario and use it throughout both parts to keep your answer concrete

Hint 2

Consider the difference between adding optional fields versus removing or changing existing behavior

Hint 3

Think about where business rules should live versus where coordination logic belongs