重磅资料,CSOahelp客户独享Amazon2025 coding算法真题100例

暑期期间大厂招聘都不太活跃,但是Amazon 亚麻 招聘却非常的活跃,之前我们已经分享过Amazon的OA题库,没看过的同学点击这里

幸运的是Amazon的OA真题并不太难,很多同学靠自己刷题就通过了,于是非常多的同学来咨询我Amazon面试会考什么的。

石老师呕心沥血,努力帮大家整理了2025年亚麻考的coding题目,如果想要BQ 问题或者系统设计 system design 题的可以评论留言或者加我微信反馈,我会根据反馈的人数来决定要不要继续整理。

当然如果有希望meta资料,Microsoft,google真题的同学,也请尽量反馈哦~

Q1

Implement the function pow(x, n), which calculates x^n.

Note that you cannot use any existing functions that implement pow, as that would trivialize the problem.

Example 1: Input: x = 2, n = 5 output = 32

Example 2: Input x = 3.4, n = 3 Output = 39.04

思路:二分(快速)幂

Q2

Amazon is planning to give prizes to a number of farms that are producing ingredients for wholefoods, based on how environmentally friendly they are.

The environmental friendliness is determined by how low the value of chemical X is in the soil, i.e. the less X in the soil, the better the farming techniques for the environment.

The values of X in the soil for the farms are presented in a 1D array.

Because the farming techniques differ between these farms, no two neighboring farms can have the same value of X. Due to geological reasons, we can't really compare farms that are too far apart.

Task: Find any farm that should be awarded the prize.

思路:二分查找局部最小值

Q3

You are given a (potentially large) List of words. Some of these are compounds, where all parts are also in the List. Example List: [rockstar, rock, star, rocks, tar, star, rockstars, super, highway, high, way, superhighway]

The task is to identify all combinations where one word is a composite of two or more words from the same list and them.

[[rock, star], [super, highway], [super, high, way], ...]

思路:动态规划

Q4

Implement find linux command as an API. The API will support finding files that:

Files that have a given size requirement.

Files with a certain naming pattern.

思路:递归遍历文件系统并应用过滤器链

Q5

convert number to excel column and convert excel column back to number

思路:模拟 Excel 列标的无零 26 进制映射

Q6

Amazon has web server logs from multiple hosts consisting of a Session ID and Web Page ID

Example: session_id, web_page_id 0001, product_1 0001, cart 0002, product_2 0003, home_page 0005, help 0001, checkout 0002, cart 0001, help 0001, product_1 0002, checkout 0005, checkout 0002, help

We want to find the 3-page pattern that is visited most (in the example, <cart, checkout, help> sequence appeared twice)

logs = [ session: 0001, web: product_1 session:0001, web:cart session:0002, web:product_2 session:0003, web:home_page session:0005, web:help session:0001, web:checkout session:0002, web:cart session:0001, web:help session:0001, web:product_1 session:0002, web:checkout session:0005, web:checkout session:0002, web:help ]

思路:滑动窗口+哈希计数

Q7

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night. Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.

思路:动态规划

Q8

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1. You may assume that you have an infinite number of each kind of coin. Example 1: Input: coins = [1,2,5], amount = 11 Output: 3 Explanation: 11 = 5 + 5 + 1 Example 2: Input: coins = [2], amount = 3 Output: -1 Example 3: Input: coins = [1], amount = 0 Output: 0

思路:动态规划

Q9

I own a parking garage that provides valet parking service. When a customer pulls up to the entrance they are either rejected because the garage is full, or they are given a ticket they can use to collect their car, and the car is parked for them. Given a set of different parking bays (Small, Medium, Large), write a control program to accept/reject cars (also small, medium or large) as they arrive, and issue/redeem tickets.

Garage layout is 1 small bay, 1 medium bay, and 2 large bays: [1,1,2] First sequence Actions: [(arrival, small), (arrival, large), (arrival, medium), (arrival, large), (arrival, medium)] Expected output: [1, 2, 3, 4, reject] Second sequence Actions: [(arrival, small), (arrival, large), (arrival, medium), (arrival, large), (depart, 3), (arrival, medium)] Expected output: [1, 2, 3, 4, 5]

思路:事件驱动模拟,维护不同尺寸车位的空闲队列进行分配和回收

Q10

Imagine you have a twitter post tagged. Each post can have multiple tags Your task is to return top X frequent tags of your friends and friends of your friends.

**思路:使用BFS遍历社交关系并用哈希表统计标签频次,取前X

还有非常多,我一直帮大家整理了30多页,合计100题。这份资料对你备战Amazon 或者亚马逊那简直 是如虎添翼,再也不用地里辛苦搜索搬砖攒积分啦。

而且资料对于老客户们来说都是免费领取的哦,比开一亩三分地会员还划算。对于新客户我们还有暑期优惠活动,下单后也可赠送。

csoahelp.com每日分享北美大厂面经,小红书也有更新,我们还提供种类多样的收费服务协助您进入北美科技大厂,有意向的微信扫码联系我,或者也可以通过其他方式联系我

Leave a Reply

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