Loading...

The Bracket Validator

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
senior

Problem

Before deploying a config template, the CI pipeline validates that all bracket pairs are properly matched. Mismatched brackets in JSON or YAML templates have caused production outages before. Write a function that checks whether all parentheses, square brackets, and curly braces in a string are properly balanced and nested, ignoring all other characters.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.