CS-OA cs-vo Faang

Circle 最新 OA – 一亩三分地 – Circle OA – Circle OA 2024 – OA代写 – VO辅助

下面是 circle 近期的OA 问题:

  1. goodTuples
  2. deleteMinimalPeaks
  3. scheduleCalendarInvite
  4. obtainUniqueSequence
  5. checkOperations
  6. equallyRearranging
  7. figureUnderGravity
  8. Suffix pairs

Q1.goodTuples

Give an array and find the count of a pair number and a single number combination in a row of this array. Target array is a[​i - 1], a[​ i], a[​ i + 1]

Input: a = [1, 1, 2, 1, 5, 3, 2, 3]

Output: 3

Explain:

[1, 1, 2] -> two 1 and one 2(O)

[1, 2, 1] -> two 1 and one 2(O)

[2, 1, 5] -> one 2, one 1 and one five(X)

[1, 5, 3] -> (X)

[5, 3, 2] -> (X)

[3, 2, 3] -> (O)

Time: O(n)

题意:给定一组 array,要求找出一对 pair 和另一个单独数字的组合。

这道题题意应该很直观,因为已经指定了要求的 array 必须是三个连续的数字



Q2.题目:deleteMinimalPeaks

    给一个 array,要求找出 minimal peak,然后把 minimal peak 放到新的
    array 重新排一次

    对 minimal peak 定义:(A[i]>A[i+] 或 A[i+1]不存在)(A[i]>A[i-1] 或 A[i-1] 不存在

    input : 4 2 5 3 7 9

    output : 第一步找出最小 peak 是 4,然后把 4 移出,新的 array 变成
    2 5 3 7 9,result 的 array 第一个数字是 4.

    input : 1 4 5 3 8 6
    [1,4,5,3,8,6], Min peak = 5, resultant = [1,4,3,8,6]
    [1,4,3,8,6], Min peak = 4, resultant = [1,3,8,6]
    [1,3,8,6], Min peak = 8, resultant = [1,3,6]
    [1,3,6], Min peak = 6, resultant = [1,3]
    [1,3], Min peak = 3, resultant = [1]
    [1], min peak = 1
    Output = [5,4,8,6,3,1]

    如此循环一直到 sort 完一整个 input array



    Q3.关于 MeetingSchedule ,可能是下面这个相似的问题:

      https://leetcode.com/discuss/interview-question/490962/Design-Meeting-Scheduler

      Q4.关于 obtainUniqueSequence 就是 LC 945
      Minimum Increment to Make Array Unique


        Q5.关于 Check operations 应该是这道题:

          You are given three arrays of integers a , b , and c 
          and an array of characters signs consisting of '+' and signs. 
          
          All of these arrays have the same length. 
          
          1.1 Your task is to return a boolean array output of the same length, where output[i] = true if the result of applying signs[i] to a[i] and b[i] is equal to c[i] , and false otherwise.
          
          In other words, for each index i, check if a[i] signs[i] b[i] c[i]. Example 
          
          For a = [3, 2, -1, 4], 
          signs = ['+','-', '-', '+'], 
          b = [2, 7, -5, 2] , 
          and c = [5, 5 4, 2] , 
          
          the output should be checkoperations(a, signs, b, c) [true, false, true, false]

          这道题应该挺直观的…

          
          
          Q6.关于 Equally Rearranging 应该是下面这道题:

          这里有一个解法:https://github.com/mehrotrasan16/bits-n-pieces/blob/master/square-equallyrearranging-codesignal.py



          Q7.Figure under gravity 应该是下面这道题:

            grid 上有一个不规则形状的图形,上面有三种格子:
            # 表示障碍
            . 表示空
            F 表示图形上的一个像素

            在重力作用下,图形从当前位置掉落后,新生成的 Grid 是什么样?

            You are given a rectangular matrix of characters matrix, which represents a 2-dimensional field where each cell is either empty ('.'), contains an obstacle (#), or corresponds to a cell of a connected figure ('F').
            Gravity makes the figure fall through the field, until one of its cells reaches the ground, or meets an obstacle. Your task is to return the state of the field after the figure has fallen.
            Note that it is guaranteed that the figure is connected, ie. between any two cells of the figure there exists a path which goes through the cells' sides (not through corners).

            假设 input 为:

            [
            ['F','F','F'],
            ['.','F','.'],
            ['.','F','F'],
            ['#','F','.'],
            ['F','F','.'],
            ['.','.','.'],
            ['.','.','#'],
            ['.','.','.']
            ]

            那么希望 Output 为:

            [
            ['.','.','.'],
            ['.','.','.'],
            ['F','F','F'],
            ['#','F','.'],
            ['.','F','F'],
            ['.','F','.'],
            ['F','F','#'],
            ['.','.','.']
            ]

            有一个讨论在这里:
            https://leetcode.com/discuss/interview-question/1202083/Databricksor-Online-Assessment-or-FigureUnderGravity

            Q8.Suffix Pairs :

              题目如下:

              Given an array of Strings,your task is to find the number
              of pairs which one is a suffix of other string

              比如 input=["cba","a","a","b","ba","ca"]

              output =
              [cba,a] // a 是 cba 的一个 suffix
              [cba,a]
              [cba,ba]
              [a,a]
              [ba,a]
              [ca,a]
              [a,ba]
              [a,ca] // > 这里是怎么得出来的

              cba,a
              cba,a
              cba,ba
              a,a
              ba,a
              ca,a
              ba,a
              ca,a

              参考:https://leetcode.com/discuss/interview-question/1301919/Robinhood-or-OA-or-Suffix-pairs

              如果你也对Brevan Howard感兴趣,欢迎联系我们。查看我们的服务价格,代面试,面试辅助,简历编写和算法私教等等,应有尽有。

              Leave a Reply

              Your email address will not be published. Required fields are marked *