mathworks OA

数学题基本都是面经的题目

遇到了一个4位数有多少个不能被11整除的数, 然后假设泊松分布选avenue 和其他简单的概率题

代码题也都是面经题

勒特口 意义伞零 和 意义陆伞

Mathworks 2020 new grad EDG OA

9/5⽹申海投简历秒给OA,8号把OA做了OA⼀共三部分,第⼀部分5个数学题,第⼆部分2道coding,第三部分20道Matlab选择题,其中coding和Matlab⼆选⼀,楼主选了coding
数学题部分:

  1. In a class of 40 students, 12 enrolled for English and German, 22 enrolled for German in total. If the students of the class enrolled for at least one of the two subjects, then how many students enrolled for only English and not German?
    A. 30
    B. 18
    C. 6
    D. Cannot be determined from given information
  2. If there is a room of 400 people, what is the probability of at least 2 of them sharing their birthday?
    A. Can’t be determined
    B. 100%
    C. 91.25%
    D. 91.31%
  3. How many edges does a k-regular graph with n vertices have?
    A. n × k
    B. (n × k) / 2
    C. n + k
    D. n^2 - k^2
  4. Bag A has 1 blue and 4 yellow balls, bag B has 3 blue and 2 yellow balls. Suppose a ball is drawn randomly from either bag A or B, what is the probability that the ball is from A given that ball is blue?
    A. 3/4
    B. 1/4
    C. 1/6
    D. 1/5
  5. There is an ant on each vertex of pentagon. What is the probability of collision (between any two or more of them) if they start walking on the edges of the pentagon? Assume each ant randomly picks a direction to walk with either direction being equally likely and every ant walks at the same speed.
    A. 1/32
    B. 1/16
    C. 11/16
    D. 15/16

第⼆题:给⼀个数组构建⼀棵树,每个结点有两个孩⼦结点or没有孩⼦结点。每个叶结点需0花费去构造。构造⽗结点的花费为左⼦树的最⼤叶节点值与右⼦树的最⼤叶结点值的积。划分这个数组,⽤最⼩的花费去构建这棵树
样例:arr = [4, 6, 2]. 两种可能的划分⽅法:{4}, {6, 2}或{4, 6}, {2}。
其中第⼀种划分⽅法左⼦树是4,右⼦树是{6, 2},左右⼦树的最⼤叶节点分别是4和6,则构造根节点的花费是4×6=24。
此时左⼦树只有⼀个叶结点,花费为0;右⼦树仅剩两个叶结点6和2,构造他们的⽗节点花费为6×2=12,构造两个叶结点花费为0,因此总花费为24+12=36。
第⼆种划分⽅法可同理得出花费值为36,因此最后结果为36。
这道为区间dp,可参考经典区间dp的例题⽯⼦合并的思路去求解
另三个可⻅Test case:

  1. arr = [2, 1], ans = 2
  2. arr = [1, 5, 3], ans = 20
  3. arr = [5, 3, 1], ans = 18