📣 Back to School开学季 - VIP通行证5折优惠!蓝莓、Offer多多同步优惠
回复: 5
跳转到指定楼层
上一主题 下一主题
收起左侧

亚麻Onsite problem solving具体考什么?

🔗
匿名用户-TZSS0  2023-9-30 04:57:28 |倒序浏览

2023(10-12月) 码农类General 硕士 全职@amazon - 网上海投 - Onsite 视频面试  | 😐 Neutral 😐 Average | Other | 在职跳槽

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
Interview2: Problem Solving (CODING) + 2 Leadership Principles
Interview3: Logical and Maintainable (CODING) + 2 Leadership Principles

早上刚和recruiter电话, 但是我不是很懂这两轮考什么?
Recruiter给了这两个例子。

这个logical and maintainable感觉和OA差不多。
我看problem solving 的例子, find file matcher, 感觉这不就是OOD吗? 我问他, 他说不是OOD。

问一下大家了解这个吗?

另外两轮是SD和coding。L5.

Logical and Maintainable


Amazon wants to build a lottery system. When a customer purchases items worth between $1 and $100, then they are entered into the lottery. Customers that purchase an item for $10 should be 10 times more likely to win the lottery than customers who have purchased an item for $1 [i.e. there is a linear relationship between the amount a customer purchased an item for and their probability of winning]. Write a function that takes a list of customers and purchase price as input. As output, it should return K winners.



import random
import heapq


class Customer:
    def __init__(self, id, price):
        self.id = id
        self.price = price




def get_k_lottery_winners_brute_force(customers, k):
    entry_list = []
    result = []
    for customer in customers:
        for i in range(0, customer.price):
            entry_list.append(customer.id)
    for i in range(0, k):
        result.append(random.choice(entry_list))
    return result

def get_k_lottery_winners_heap(customers, k=1):
    sorted_customers = []
    result = []
    customer_dict = {}

    # Combine prices for each customer
    for customer in customers:
        if customer.id in customer_dict:
            customer_dict[customer.id] += custo
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
extends LogicalFileMatcher {
    public AndMatcher(FileMatcher left, FileMatcher right) {
        super(left, right);
    }
    @Override
    public boolean matches(FileObject file) {
        return left.matches(file) && right.matches(file);
    }
}
public class OrMatcher extends LogicalFileMatcher {
    public OrMatcher(FileMatcher left, FileMatcher right) {
        super(left, right);
    }
    @Override
    public boolean matches(FileObject file) {
        return left.matches(file) || right.matches(file);
    }
}
public class SymbolicLinkAwareFileSearch {
    public static List<FileObject> findFiles(File directory, FileMatcher matcher) throws IOException {
        List<FileObject> results = new ArrayList<>();
        if (directory.exists() && !isSymbolicLink(directory)) {
            File[] files = directory.listFiles();
            // Rest of the code...
        }
        return results;
    }
    // Rest of the code...
}

评分

参与人数 2大米 +21 收起 理由
yimuwufendi + 1 欢迎分享你知道的情况,会给更多积分奖励!
匿名用户-YICGA + 20 欢迎分享你知道的情况,会给更多大米奖励!

查看全部评分


上一篇:tiktok 9.25 OA
下一篇:TikTok 招工问题请教
地里匿名用户
🔗
匿名用户-R7EGQ  2023-9-30 09:17:04 来自APP
我也是这个 一模一样 还没面
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-DV4EI  2023-10-4 08:15:27 来自APP
楼上什么时候面试啊?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-IQWRO  2023-10-4 08:30:02 来自APP
那轮实际就是coding
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-SKEUK  2023-10-20 11:56:19
楼主发的这个代码是hr 给的example? 还是原题?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-TZSS0  2023-10-23 02:32:16
匿名用户 发表于 2023-10-19 19:56
楼主发的这个代码是hr 给的example? 还是原题?

hr给的example
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表