Google interview question

dsa , time complexity, space complexity