A common table expression is a named result set defined with WITH at the top of a query and referenced like a table further down. CTEs let a long query be written as a sequence of readable steps instead of nested subqueries, and a recursive CTE can walk a hierarchy or generate a series of dates. In interviews they are usually the difference between an answer a reviewer can follow and one they have to unpick from the inside out.