注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
本帖最后由 匿名 于 2025-7-1 00:25 编辑
coding 1:
music player:
add_song(song_title)
play_song(song_ID, user_ID)
print_analytics_summary()
Part II
last_three_played_song_titles(user_ID)
Part III
print_top_k_analytics_summary()
coding 2:
We plan to offer a corporate credit card to companies that employees can use for business expenses.
Managers can set policies on the cards so that employees do not misuse the card or exceed allowances.
We're going to be building the rules engine that supports this product.
You are encouraged to ask product-oriented questions and to share your assumptions.
We will use "expenses" as our model and the policies will be rules governing whether submitted expenses should be reviewed by an expense manager.
Let's start with some basic rules and we'll add some requirements, so please think about the flexibility of your design.
The rules to start with:
* No expense at a restaurant can exceed $75
* No airfare expenses
* No entertainment expenses
* No expenses over $250
Let's look at an example of some expenses:
expenses.add(new HashMap<String, String>() {
{
put("expense_id", "001");
put("trip_id", "001");
put("amount_usd", "49.99");
put("expense_type", "supplies");
put("vendor_type", "restaurant");
put("vendor_name", "Outback Roadhouse");
}
});
expenses.add(new HashMap<String, String>() {
{
put("expense_id", "002");
put("trip_id", "001");
put("amount_usd", "125.00");
put("expense_type", "supplies");
put("vendor_type&qwing expenses that violate rules, managers now need to review trips that violate rules.
Let's add functionality to evaluate rules such as:
* A trip cannot exceed $2000 in total expenses.
or
* Total meal expenses cannot exceed $200 per trip.
In our set of expenses, trip ``002`` violates both rules.
Implement a way to handle more complex rules like these ones, in addition to the rules already covered.
The output should show trips that violate these new rules, in addition to individual expenses from the previous question.
Before you get started coding, let's discuss the function's return type.
coding 3:
web api, need to run a local service to support few endpoints for a tiny stackoverflow- post question
- get all questions.
follow up:
upvote question.
一共90分钟,大部分时间用来问一下general的知识,如何让这个code change production ready,比如做哪些改进PR ready for review; 如何确保数据安全,有哪些可能的攻击,这个部分应该是比较open的面试官可以问的比较灵活。
sd:
design google news.
跪求大米 |