My OA had 4 coding questions in 70 mins.
Role: SDE New Grad
Location: San Francisco, CA
- Given a list of integers, count the number of 'good tuples' that can be created. A 'good tuple' is defined as consecutive triplets having exactly 2 duplicate elements.
- Given two strings, s and t (consisting of alphanumeric characters), how many ways can you remove 1 digit from either s or t so that s is lexicographically less than t?
- Given a rectangular matrix, m, and an int, k, return the sum of the distinct numbers contained in each k by k submatrix that sums to the maximum value. Similar to this https://www.geeksforgeeks.org/print-maximum-sum-square-sub-matrix-of-given-size/ but you had to sum the unique numbers in each submatrix that summed to the max value.
- Given two arrays of ints, a and b, try to create an arithmetic sequence by adding ints from b into a. Return the maximum length of a or -1 if there does not exist an arthimetic sequence e.g. a = [2, 4, 8], b = [1, 6, 10, 12] -> a = [2, 4, 6, 8, 10, 12] -> return 6