GlobalLogic interview question

String manipulation question, rectangle overlapping and multithreading concept.