principal engineer interview questions shared by candidates
Complete functions within an application. Build a staircase, find a sub-list within a list. convert long to string in base 7. Look and say sequence. Control robot arm.
Thanks for sharing. Do you still remember the details of those questions, e.s.p the 1st and last ones ?
Implement a method 'find' that will find the starting index (zero based) where the second list occurs as a sub-list in the first list. It should return -1 if the sub-list cannot be found. Arguments are always given, not empty. Sample Input 1 list1 = (1, 2, 3) list2 = (2, 3) Sample Output 1 1 Explanation As second list (2, 3) is sub-list in first list (1, 2, 3) at index 1 Sample Input 2 list1 = (1, 2, 3) list2 = (3, 2) Sample Output 2 -1