Amazon OA sharing|Two Coding + BQ assessments, the overall difficulty is medium to easy

32 Views
No Comment

Just received it this afternoon Amazon OA, I finished it in the evening. The overall experience feels that the difficulty is medium to easy. The two questions are not particularly complex algorithm questions, but more focused on data structure + regular observation. If you are relatively stable in answering questions at ordinary times, you can basically complete it within the time.

This OA platform is still a common online evaluation environment. After the coding part is completed, there will be a period of situational judgment questions (similar to work scene selection) + personality test questions. The whole process takes about 100 minutes, and the pace is not particularly stressful.

Amazon OA sharing|Two Coding + BQ assessments, the overall difficulty is medium to easy

Coding 1:Bug Frequency 排序

题目简析

第一题整体非常经典,本质上就是一个frequency sort 类型的题。题目给一个 bugs 数组,每个数字代表一个 bug code,数组里可能会有重复的数字,需要根据 bug 的“重要程度”进行排序。

排序规则其实非常直观。首先是出现次数越少的 bug 越重要,也就是优先级越高;如果两个 bug 的出现次数相同,那么bug code 数值更小的排在前面。

比如示例数组:

[8,4,6,5,4,8]

统计每个数字出现次数之后会得到:

6 -> 1
5 -> 1
8 -> 2
4 -> 2

按照题目的排序规则,最终结果会变成:

[5,6,4,4,8,8]

Problem-solving ideas

The first step is to use HashMap to count the number of occurrences of each bug code, and then use custom sorting rules when sorting: first sort by frequency in ascending order, and if the frequencies are the same, then sort by the bug code itself in ascending order.

The code implementation is a frequency statistics + custom comparator sorting. This kind of question is relatively common in many OA. If you have studied similar question types, it is basically a type that can be completed quickly.

Coding 2:Prefix 最大分段数

题目简析

题目给一个只包含大写字母 的字符串 packages。要求对于字符串的每一个前缀,计算这个前缀最多可以被切成多少段连续子串,并且需要满足一个条件:每一段里面每个字符出现的次数必须完全一样。

换句话说,就是所有分出来的子串,它们的字符频率分布必须一致。

举个简单的例子:

字符串:

ABAB

逐个 prefix 来看:

A     -> 1
AB -> 1
ABA -> 1
ABAB -> 2

最后一个 prefix ABAB 可以被分成:

AB | AB

因此这一位的答案是 2。

所以最终输出结果就是:

[1,1,1,2]

Problem-solving ideas

The key point of this question is: for each prefix, it is necessary to determine the maximum number of substrings with the same structure that it can be cut into.

The general idea is to first maintain the character frequency statistics of prefix. If the prefix length is N, assuming it can be divided into K Segments, then the length of each segment is N/k. Only if N Can be K This segmentation is only possible when dividing by integers.

Next, you need to check whether the character distribution of each segment is consistent, that is, whether the frequency of characters within each segment is the same. If the conditions are met, then this K It is a legal number of segments, and the largest one is finally taken. K That’s it.

During implementation, a 26-length frequency array is usually used to record character statistics, and then the number of possible segments is enumerated for verification. The whole question type is string processing + simple mathematical rule judgment.

OA other parts

After the two codings are written, there is also a part of Work Simulation and some personality test-type questions. This part is mainly for some work scenarios, such as team collaboration, task priority conflicts, project time pressure, etc., allowing you to choose the approach that best suits your behavior among several options. Some questions are single-choice, and some ask you to choose Most Likely/Least Likely among several options.

This part of Amazon's questions are basically designed around Leadership Principles, such as: Customer Obsession, Ownership, Bias for Action, Earn Trust, etc. So, when answering questions, the general idea is to take the initiative to take responsibility, prioritize solving customer problems, teamwork, and data-driven decision-making. The number of questions in this part is not particularly large, but the answers need to be logically consistent and not inconsistent.

Learn more

If you have been preparing for OA from companies such as Amazon / Google / Citadel / IMC recently, but are not familiar with the question types or are worried about lack of time, you can actually look at the real interview question bank in advance. We have been sorting out the latest OA question types from major manufacturers for a long time, and there are also Real-time OA assists and simulation training. Many students successfully passed OA by familiarizing themselves with the question types in advance.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0