Arista Networks interview question

Algorithm: Check if the parenthesis are matching