Which string functions should I actually know for a SQL interview?
Six families cover almost everything asked. Length and position: LENGTH for character count, INSTR (or POSITION, or CHARINDEX) to find where a substring starts. Slicing: SUBSTR (or SUBSTRING) with a start position and an optional length. Case: UPPER and LOWER. Whitespace: TRIM, plus LTRIM and RTRIM when you want to be specific. Replacement and concatenation: REPLACE, and the || operator — note that CONCAT is not standard, and MySQL's CONCAT() and PostgreSQL's CONCAT() are recent additions that older versions lack.
Two more that get asked: COALESCE for a fallback value, and LIKE for pattern matching with % and _. And on PostgreSQL specifically, split_part and string_agg, which have no direct equivalent elsewhere.
The thing that separates a strong answer from a memorised one is knowing which functions can use an index. A function that wraps the indexed column — LOWER(name), TRIM(email), SUBSTR(description, 1, 10) — makes the predicate non-sargable, so the engine must read every row and compute the function. If you need case-insensitive matching frequently, the fix is a functional index on the lowercased column rather than wrapping the column in every query. In MySQL, a case-insensitive collation on the column itself achieves the same thing without touching the query.
One more practical point: string functions operate on characters, not bytes, so LENGTH of a multi-byte character counts one, not two. But SUBSTRING_INDEX and the various POSITION functions count bytes, which is why slicing in the middle of a multi-byte character can produce invalid text. The functions that respect characters are the ones you usually want for user-facing data.