From my experience in job interviews that question usually takes you to implements a solution with one type of data-structure.

A good implementation will be using a stack that load each '(' bracket and unloads each ')' bracket. In that way you can iterate over the text and if you encounter ') bracket beforehand you add to the result.

In Python you can use list type object as a Stack, [reference][1].

Implementation example using stack in python3:

    def bracket_match(text):
    	pairs = {'(': ')'}  # Using dictionary for O1 get
    	sk = []
    	res = 0
    	for c in text:
    		if c in pairs:
    			sk.append(pairs[c])
    		elif sk and c == sk[-1]:
    			sk.pop()
    		else:
    			res += 1
    	return res

  [1]: https://docs.python.org/3.6/tutorial/datastructures.html