Goldman Sachs Interview Question

there were two behavior questions. Two coding questions, Find if the array has a cycle. Another was related to Sub String.