algoritms course, social connectivity interview question