# mathworks OA

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

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