Python data engineering interview problem. Difficulty: intermediate. Pattern: Strings. About 15 minutes. Part of the Pro drill bank.
A templating engine emits opening and closing tags. A linter should reject a fragment where tags nest incorrectly, the same way brackets must balance in code.
Return whether opening and closing tags are correctly matched and nested.
Input: tags_balanced('<a><b></b></a>') Output: True This input follows the stated rules and produces this output.
Topics: lakebench, python, stack.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Validate whether a simplified markup string has properly nested and matched tags.
Return whether opening and closing tags are correctly matched and nested.