Smoke testing is a broad, shallow check that the critical functionalities of a build work and it's stable enough to test further; Sanity testing is a narrow, deeper check that a specific new feature or bug fix works after a minor change.
SMOKE testing (a 'build verification test') runs after each new build to confirm core paths (login, key navigation) work — if smoke fails, the build is REJECTED and not tested further, saving effort. It's wide and shallow, often scripted/automated. SANITY testing is done after receiving a build with minor changes/fixes to verify THOSE specific areas work and reasoning is 'sane' before deeper testing — it's narrow and deep, usually unscripted. Mnemonic: smoke = wide+shallow (whole build stability), sanity = narrow+deep (specific change). Both are subsets of regression and frequently confused in interviews.
After a new build, a smoke test confirms login, search, and checkout all load (build accepted); a sanity test then focuses only on the just-fixed coupon logic before full regression begins.
A build arrives with a bug fix for the coupon module. Would you smoke or sanity test first, and how do they differ?