一亩三分地论坛

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

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

Airbnb电面

[复制链接] |试试Instant~ |关注本帖
movefast 发表于 2014-11-19 04:47:46 | 显示全部楼层 |阅读模式

2014(7-9月) 码农类 本科 全职@Airbnb - 网上海投 - 技术电面 |Pass

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

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

x
最近Airbnb在面很多人但是面经不是很多,分享个我自己的吧+求人品哈哈。他家最近bar比较高,主要是申请人多,题不难但是要求短时间写working code。题在下面,先把codepad的直接贴上,之后附解释。1. CSV Reader

/*
John,Smith,john.smith@gmail.com,Los Angeles,1
Jane,Roberts,janer@msn.com,"San Francisco, CA",0
"Alexandra ""Alex""",Menendez,alex.menendez@gmail.com,Miami,1.鏈枃鍘熷垱鑷1point3acres璁哄潧
"""Alexandra Alex"""

John|Smith|john.smith@gmail.com|Los Angeles|1
Jane|Roberts|janer@msn.com|San Francisco, CA|0
Alexandra "Alex"|Menendez|alex.menendez@gmail.com|Miami|1
"Alexandra Alex" 鏉ユ簮涓浜.涓夊垎鍦拌鍧.
*/

.鏈枃鍘熷垱鑷1point3acres璁哄潧

2. URL Shortener

/*

Often, we want to encode raw IDs in our database by hiding them behind some 2-way decodeable hash. So, a URL which would have at one time been:

https://www.airbnb.com/rooms/848662

becomes

https://www.airbnb.com/rooms/kljJJ324hjkS_

We decode the ID kljJJ324hjkS to 848662 on our backend and serve the relevant content. At some point, we start getting 404 errors from clients requesting a certain URL of the form
https://www.airbnb.com/rooms/kljjj324hjks

This can happen if certain clients, email services, or url shorteners "sanitize" the url. Unfortunately, this change breaks decoding and the resource cannot be found.
To assess how big of a deal this is, we may want to recover the IDs of the targets that were 404ing.

Given a method decode(testEncStr) which will return the decoded int id if testEncStr is decodeable or will throw an exception (or return null) if not, implement a new method decodeFind(String badEncStr) which takes a string and returns the decoded int id.
*/


. from: 1point3acres.com/bbs

评分

1

查看全部评分

shinichish 发表于 2014-11-19 05:00:20 | 显示全部楼层
没太看懂。。是算法题吗?好像不算吧
回复 支持 反对

使用道具 举报

本版积分规则

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

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

关闭

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

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

custom counter

GMT+8, 2016-12-9 14:28

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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