推荐:数据科学课程和书籍清单以及培训讲座


一亩三分地论坛

 找回密码
 获取更多干活,快来注册

一亩三分地官方iOS手机应用下载
查看: 2945|回复: 1
收起左侧

Airbnb电面

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

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

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

您需要 登录 才可以下载或查看,没有帐号?获取更多干活,快来注册

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
"""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"
*/


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.
*/


.1point3acres缃

评分

1

查看全部评分

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

使用道具 举报

本版积分规则

关闭

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

手机版|小黑屋|一亩三分地论坛声明

custom counter

GMT+8, 2017-8-19 00:45

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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