tripadvisor phone+onsite

原帖地址:一亩三分地

刚刚面完onsite…..感觉悲剧了…..本来5轮的面试…现在3轮就下来了..唉….我面的是mobile组。感觉都比较在意你解决一下实际问题..没有单独的那种算法题。
另外感觉组里好像比较倾向于做前端的….虽然也有做后端的group….lz前端基本不会….悲催…

phone interview: manager面的,就问了一个题:
Business listing coupons to display for certain locations to promote a hotel, restaurant, city…
Given a list of Coupon objects, find the best coupon to display for a specific location.
class Coupon { int id; String subject; String description; int locationId;}
class Location { int locationId; int parentLocationId; // -1 if no parent, location is hierarchy String name; static Location findLocation(int locationId) {…} }

class Store { private List couponList; Coupon findBestCoupon(int locationId) { // 要实现这个 } }
Examples: If 3 coupons, one in Hilton Boston Back Bay, one in the city of Boston, and one in Massachusetts:
A user looking at the Hilton Boston Back Bay specific page should see the coupon of Hotel Hilton and not the one of BostonA user looking at a Boston page should see the coupon of BostonA user looking at the Hotel Commonwealth (in Boston) specific page should see the coupon of BostonA user looking at the Restaurant Captain Marden of Wellesley specific page should see the Massachusetts coupon.A user looking at a Montreal specific page should see no coupon.
不是很难,就是注意用个hashmap。。把东西存起来就好了…经理是个法国人….口音有点怪怪的..但是人很nice。
onsite:两轮美国小哥+那个manager….本来应该还有一轮技术面+一轮recruiter….recruiter出差了…..另一轮技术面…直接免了..悲剧….#128546;#128546;…第一轮: 叫你处理review,每个review class 有method 取rating 和content….然后我实现了两个method..。一个是算平均rating..一个是把most recent的content用个数据结构存起来….这里給了一个map…id + review….可以通过这个map 读取所有的review….
第二轮: 写了一个hotel的class..里面有name 和 price… 这里要小心price….小哥好纠结这个问题…我说了好多种方案..最后方案是用int 来表示.然后price 表示成cent….例如10.5 dollar。就是1050 cent… 然后自己还实现了一个comparator…和写了一个pricetostring class…例如1050cent..转换成$10.50 这里注意那个cent 是几位就好了…
最后一轮还是那个manager…一个技术问题都没问…就问了我接不接受intern…和一些behavior问题..例如为什么tripadvisor…. team work里面 miscommunication 遇到过的问题… 怎么说服你队友之类的问题…这一轮….也谈得屎一样…唉..
然后就没了…感觉我的onsite…技术问题不是好多…都是那种问这问那的问题….
希望給后面的面试攒攒rp….祝大家好运….