CS FundamentalsVery hardProduct-company API design interview

A public JSON API is used by many clients that ignore unknown fields. How many of these changes are breaking: (1) adding a new optional response field, (2) renaming a response field, (3) making an optional request parameter required, (4) adding a new endpoint, (5) changing a field's type from integer to string, (6) removing an enum value clients may send?

  1. A. 2
  2. B. 3
  3. C. 5
  4. D. 4

Correct answer: D. 4

Renaming a field, making a parameter required, changing a type and removing an accepted value all break existing clients (4). Adding optional fields or new endpoints is backward compatible when clients tolerate unknown fields.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic