2020 new grad OA1+2+3

amazon OA1

7道debug题20分钟

  1. Print Pattern 变量量ch++ -> print++

  2. Even odd pattern 加括号

  3. Manchester == -> !=

  4. Reverse Array += -> -=

  5. Sort Array > -> <

  6. Get Digit sum parity result %2 == 0 -> !=

  7. Distinct Element Count f==1 -> f==0

另一个人的 new grad OA1

20分钟7道debug,题⽬目为:
1 sort array

2 奇数偶数

3 check palindromic num->temp

4 distinct element count

5 digitalSumPairy if (result % 2 !=0)->if (result % 2 ==0)

6 countproduct for loop ⾥里里⾯面限制条件错了了改下就好

7 找出出现k次的元素

OA2:

两道coding题,70min。
第一题是利口240,在2d matrix里找⼀个数。

第二题是找连通图(2d array)⾥的所有bridge(critical connections), 使得这个graph变成两个disconnected parts.

new grad OA 3

  1. Work Simulation: ⽬前没有在⾯经里看到原题,佛系吧,还是那几个原则,

manager和customer⾄上,requirement⽐deadline重要,⻓远利益⽐目前利益重要

  1. Logic:很多原题,正好做完

Logic前⾯面基本都是⼩⼟刀的原题,后面的应用题有一两个新题

应⽤题我记得的原题是factory那个,新题具体细节太长了有点忘,但是很简单

很straightforward那种,只不不过时间很紧,前⾯面的简单题⽐比如说找规律的争取大概⼗五秒一个吧。。。这样后来的长题才有时间…


贴几个别人的:

亚麻OA1 new grad

刚刚做完OA1,和前⾯发的⾯经⼀样,20min 7道debug题。顺序记不清了了,以下是我遇到的题目:

  1. ArrayOperation

  2. CheckGrade

  3. printPattern

  4. occurence

  5. countDigit

  6. EvenOddPattern

  7. replaceValues

2020 new grad OA1+OA2

8/15 网上海投

OA1 debug 七题

OA2 70min 兩题 两个hashmap 统计⻛格 + 蠡⼝一三巴

OA2 2020 new grad

三部分OA中的第⼆部分 包含两题算法跟一堆亚麻文化测试

楼主遇到的两题是利口 贰肆凌 武漆贰

社招OA

第⼀题:merge files -->⽤ PriorityQueue 就可以;第二题:Remove

Obstacle(背景:机器人去除障碍物) —>BFS搞定。

8⽉25号完成的OA, 过后recuiter 让我提供几个时间说要电话面试,昨天我把时间发给了recuiter, 过了⼀天 到现在recuiter还没有回信。。这种情况应该怎么办?

我是不是在等两天,然后催一下呢?希望有经验的人给点建议。

ps: 投的是加拿⼤大温哥华的职位。

new grad OA1

以前投过亚麻挂了,之前没有投2020 grad full time,是系统把我从student portal⾥捞起来,我就apply了,昨天刚做的oa1,发上来。题⽬顺序不记得了了,都是原题,oa1只有debug题,没有逻辑题。祝⼤大家好运。

countOccurrence
返回Value在Array⾥面出现的次数
while loop⾥面缺少i++

printPattern(出现了两次)
for loop缺少 {}

selectionSort
<>改⼀一下

reverseArray
把len++改成len–

CheckGrade
两个else if⾥里里的‘||’改为‘&&’

countDigits
加⼀句temp=num; 然后把return⾥所有的num改为temp, 这样num就不会被改变了
lllll

Min Abs Diff Between 2 Elements

You are given an array arr of n elements of positive integers. Your task is to determine the minimum absolute difference between any 2 elements of the array. You can perform the following two types of operations on the array elements any number of times:

  • If element e is even, then you can replace it by e / 2
  • If element e is odd, then you can replace it by 2 * e

Determine the minimum absolute difference between any two elements after performing this operation any number of times (possibly zero) on any element of the array.

Example 1:

Input: [1, 2]
Output: 0

Constraints:

  • 1<= T <=50
  • 2<= n <=50000
  • 1<= arr[i] <=10^8 for each valid i

Time limit: 1 sec

It is guaranteed that summation of n over all test cases does not exceed 250000.

2 Likes