一亩三分地论坛

 找回密码
 获取更多干货,去instant注册!

扫码关注一亩三分地公众号
查看: 877|回复: 0
收起左侧

[找工就业] tripadvisor 面经

[复制链接] |试试Instant~ |关注本帖
基德不爱吃鱼 发表于 2015-5-2 04:53:26 | 显示全部楼层 |阅读模式

2015(4-6月)-[13]EE硕士+fresh grad 无实习/全职 - 网上海投| 码农类全职@TripAdvisorfresh grad应届毕业生

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

您需要 登录 才可以下载或查看,没有帐号?获取更多干货,去instant注册!

x
有没有大神谈谈思路?
Given a data file containing hotel deals, write an app to find the best applicable deal for the user and return the promo_txt for the deal. You will need to consider the type of deal, valid dates, hotel name, and edge cases. If no deal applies you will return “no deals available”. You may assume the entire deals file fits in memory. You may use Java, C++, C#, or Python for your solution with the standard libraries at your disposal.
The types of deals are as follows:
    rebate : a straight discount off the total price of the stay
    rebate_3plus : a straight discount off the total price when the duration of stay is >= 3
    pct : a percentage discount off the total price of the stay
The deals data file will be a comma-separated file (CSV) in the following format:
hotel_name,nightly_rate,promo_txt,deal_value,deal_type,start_date,end_date
Hotel Commonwealth,250,$50 off your stay 3 nights or more,-50,rebate_3plus,2014-06-01,2014-07-31
Hotel Commonwealth,250,5% off your stay,-5,pct,014-06-01,2014-06-15
Hotel Commonwealth,250,$25 off your stay,-25,rebate,2014-07-07,2014-07-31   

The input to your application will be the path to the deal file, the hotel name, check in date, and number of nights stay. For example:
> BestHotelDeal ./deals.csv “Hotel Commonwealth” 2014-06-30 3
Any errors resulting from bad parameters and/or invalid deal file should be handled gracefully, with informative feedback to the user.
Examples:
> BestHotelDeal ./deals.csv  "Hotel Commonwealth" 2014-06-30 3
> $50 off your stay 3 nights or more
> BestHotelDeal ./deals.csv  "Hotel ABC" 2014-06-30 1
> 5% off your stay
> BestHotelDeal ./deals.csv  "Hotel ABC" 2014-06-30 2
> no deal available
. visit 1point3acres.com for more.

本帖被以下淘专辑推荐:

  • · TA|主题: 9, 订阅: 0

本版积分规则

请点这里访问我们的新网站:一亩三分地Instant.

Instant搜索更强大,不扣积分,内容组织的更好更整洁!目前仍在beta版本,努力完善中!反馈请点这里

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2016-12-11 20:47

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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