Nextdoor OA

My OA had 4 coding questions in 70 mins.

  1. Given a list of integers, count the number of ‘good tuples’ that can be created. A ‘good tuple’ is defined as connectutive triplets having exactly 2 duplicate elements.
  2. 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 lexographically less than t?
  3. 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.
  4. 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 artimetic sequence.
1 Like

我是这4道

  1. variation of https://leetcode.com/problems/add-strings/
  2. some other really easy string manipulation
  3. https://leetcode.com/discuss/interview-question/354854/facebook-phone-screen-cut-wood
  4. another string manipulation question: given a string, you can create another string by switching the index of characters and swapping the frequencies. Check if two strings are identical. So “aab” = “bab” true
1 Like