Qualcomm Interview Question

How do you check if the brackets are balanced, how do you know if two rectangles overlap, write a code to read from a file and find the first capitol letter, almost all OS concepts.