Testing / Karate Framework Interview questions
Why should you use table-driven Examples instead of hardcoding multiple scenarios?
Copy-pasting a scenario multiple times with slightly different literal values works, but it multiplies maintenance cost: any change to the underlying steps (a renamed field, an extra header, a different assertion) has to be applied identically across every duplicated copy, and it's easy for copies to silently drift apart over time as edits are made inconsistently.
A Scenario Outline with an Examples table keeps the actual test logic defined exactly once; adding, removing, or changing an input case is a one-line change to the table rather than a copy-paste-and-edit of an entire scenario block. It also makes the intent of the test data clearer at a glance, since the table format visually groups related inputs and expected outcomes together in a way that repeated full scenario blocks don't.
The tradeoff worth being aware of is readability at scale: a table with dozens of rows and many columns can become harder to scan than a smaller number of well-named individual scenarios, so table-driven Examples work best when the underlying logic really is identical across cases and only the input values differ, not when each case actually needs meaningfully different steps or assertions.
More Related questions...