注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
分享一下rippling第一轮AI面试的经历!因为地里看rippling大部分AI面试都挂了,感觉现在对AI面试的bar还是不清晰,所以想分享一下我的过经(以及我觉得他们的要求是什么
如果有帮助的话,求大米!
我被问到的题是地里很常见的expense rule engine。
我的approach是,先跟面试官讨论问题,clarify一些edge case,好好沟通
然后再开始讲自己的思路,这时候完全不能把整道题放进AI里,假装AI不存在,先把OOP里面的一些class写出来,和一些基本的function。这时候要一直跟面试官讨论为什么要这么做。
我前面讨论和写初始的class差不多花了二十多分钟。
之后再把每个class和大概思路放到AI里面,让他给你完整的写完每一个function。最好是每个function你已经自己写了个框架,只是把具体逻辑交给AI写
之后再写测试,也要先讲自己的思路,但是可以让AI写测试
总之我感觉说是AI interview,其实还是得展示自己不靠AI也思路非常清晰,也能写基本的code,只是让AI做一些implementation details而已
把题目放在下面啦,希望对大家有帮助!我还在看面经中,求大米!
Full Problem Statement:
Building an Expense Rules Engine. Companies give employees credit cards for work. Managers need to set rules to make sure employees do not spend too much money or buy the wrong things. Your goal is to build a tool that checks expense data against a list of rules. It should flag any expense that breaks a rule.
Design Goals:
- Flexibility: Handle many different rule types. New rules added later via API.
- Stateless: Do NOT write specific code for every rule. Rules treated as data.
- Extensibility: Easy to add new rule types without changing main code.
Input data: List of expense dicts:
{"expense_id": "001", "trip_id": "001", "amod_by(e): violations.append({"expense_id": e["expense_id"], "rule_id": r.rule_id}) return violations
def evaluate_group_rules(group_rules, expenses): violations = [] for rule in group_rules: groups = defaultdict(list) for e in expenses: k = e.get(rule.group_by) if k: groups[k].append(e) for gid, items in groups.items(): filtered = [e for e in items if rule.filter_condition.matches(e)] if rule.filter_condition else items total = sum(float(e.get(rule.aggregate_field, 0)) for e in filtered) if total > rule.threshold: violations.append({"group_id": gid, "rule_id": rule.rule_id, "actual": total}) return violations |