Testing·Intermediate·Conceptual·1 min read
How does snapshot testing differ from visual regression testing?
Short interview answer
Snapshot testing serializes output — usually a DOM tree or a data structure — to text and diffs that; visual regression captures an actual rendered image and diffs pixels. Snapshots are cheaper and run anywhere, but only catch structural changes, not purely visual ones like a color or spacing shift.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.