interview-prepare


  • Given a stream of characters (e.g. acacabcatghhellomvnsdb) and a list of words (e.g. ["aca","cat","hello","world"] ) find and display count of each and every word once the stream ends.(Like : "aca" : 2 , "cat" : 1 , "hello" : 1 , "world" : 0 ).

    badebhaiyya April 16, 2016 in United States  | Report Duplicate | Flag 
    Booking.com Software Developer Algorithm
  • bookingcom-interview-questions
    0
    of  0 votes
    1 
    Answer

    Design auto complete for booking.com

    Qasim November 12, 2015 in Netherlands  | Report Duplicate | Flag 
    Booking.com Software Developer System Design
  • bookingcom-interview-questions
    1
    of  1 vote
    8 
    Answers

    Write a function to test if the given set of brackets are balanced or not. e.g. {{}}{)([][]

    Qasim November 12, 2015 in Netherlands  | Report Duplicate | Flag 
    Booking.com Software Developer Algorithm
  • bookingcom-interview-questions
    0
    of  0 votes
    1 
    Answer

    You are building a small command-line application to calculate hotel availability for a city. Your application reads in two (2) data files, and outputs its answer to STDOUT. 
    Your application will read in: 
    · a list of hotels along with how many rooms each contains (in no particular order) 
    · a list of bookings that have been made (in no particular order) 
    Your application will then print the list of all hotels which have availability for check-in and check- out date range, if any. 
    Do not worry about whether a specific room is available in a hotel for the entire booking period without switching rooms: availability is defined as the hotel having at least one (1) available room for each night of the target stay, regardless of whether it's the same room from day to day. 

    Data Files 
    hotels.csv 
    # Name, Rooms 
    Westin, 10 
    Best Western, 20 
    Hilton, 10 
    ... 

    bookings.csv 
    # Name, Checkin, Checkout 
    Hilton, 2015-04-02, 2015-04-03 
    Hilton, 2015-04-02, 2015-04-04 
    Westin, 2015-05-01, 2015-05-20

    amusing October 06, 2015 in United States  | Report Duplicate | Flag 
    Booking.com Software Engineer / Developer Algorithm
  • bookingcom-interview-questions
    0
    of  0 votes
    3 
    Answers

    There's a very simple compression algorithm that takes subsequent characters and just emits how often they were seen.  

    Example:  
    abababaabbbaaaaa

    Phil September 08, 2015 in Netherland  | Report Duplicate | Flag 
    Booking.com Software Engineer Algorithm
  • bookingcom-interview-questions
    1
    of  1 vote
    7 
    Answers

    $a = [3, 1, 4, 5, 19, 6];

    $b = [14, 9, 22, 36, 8, 0, 64, 25];

    # Some elements in the second array are squares. 
    # Print elements that have a square root existing in the first array. 
    # $b[1] = 9, it’s square root is 3 ($a[0]) 
    # $b[3] = 36, it’s square root is 6 ($a[5]) 
    # $b[7] = 25, it’s square root is 5 ($a[3]) 

    # Result: 
    # 9 
    # 36 
    # 25

    Phil September 08, 2015 in Netherland  | Report Duplicate | Flag 
    Booking.com Software Engineer Algorithm
  • bookingcom-interview-questions
    0
    of  0 votes
    26 
    Answers

    A multiset or a bag is a collection of elements that can be repeated. Contrast with a set, where elements cannot be repeated. 
    Multisets can be intersected just like sets can be intersected. 

    Input : 

    A = [0,1,1,2,2,5] 
    B = [0,1,2,2,2,6] 

    Output : 
    A ∩ B = C = [0,1,2,2] 

    Input : 
    A = [0,1,1] 
    B = [0,1,2,3,4,5,6] 

    Output 
    A ∩ B = C = [0,1] 

    Write a function to find the intersection of two integer arrays in that way ?

    ersegun August 20, 2015 in Netherlands  | Report Duplicate | Flag 
    Booking.com Software Developer String Manipulation
  • bookingcom-interview-questions
    1
    of  1 vote
    20 
    Answers

    "Smart substring" 
    Write a function that takes maximum 30 characters from a string but without cutting the words. 

    Full description: 
    "Featuring stylish rooms and moorings for recreation boats, Room Mate Aitana is a designer hotel built in 2013 on an island in the IJ River in Amsterdam." 

    First 30 characters: 
    "Featuring stylish rooms and mo" 

    Smarter approach (max 30 characters, no words are broken): 
    "Featuring stylish rooms and"

    ersegun August 20, 2015 in Netherlands  | Report Duplicate | Flag 
    Booking.com Software Developer String Manipulation
  • bookingcom-interview-questions
    0
    of  0 votes
    3 
    Answers

    public class Node 

    public Node[] Children; 
    public Node Right; 

     Each node represents an element of a tree and specifies a list of immediate children. 
     The 'Children' property lists all children (in order) but the 'Right' property is set to null. 
    Suppose you are given the root of a fully populated tree (i.e. a Node called RootNode). Write code to set the 'Right' property so that each node is linked to its right sibling.

    sg August 18, 2015 in United States  | Report Duplicate | Flag 
    Booking.com SDE-2
  • bookingcom-interview-questions
    0
    of  0 votes
    3 
    Answers

    Write an itoa

    JSDUDE July 09, 2015 in United States  | Report Duplicate | Flag 
    Booking.com Software Developer Algorithm String Manipulation
  • bookingcom-interview-questions
    -2
    of  2 votes
    9 
    Answers

    You have the file with word at a single line. 
    #input sample file 
    abactor 
    abaculus 
    abacus 
    Abadite 


    Zyrenian 

    #Output 
    ******************************************************************a 
    *************b 
    **********************************c 
    **********************d 
    *******************************************************************************e 

    a) you have to count the character and create a histogram in alphabetical order. 
    b) now you have to produce a histogram with max 80 character in line in reference to max count 
    c) now same out based histrogram based on the character count

    madeinindia March 24, 2014 in neitherland for perl backend | Report Duplicate | Flag 
    Booking.com Software Engineer / Developer Perl
  • bookingcom-interview-questions
    0
    of  0 votes
    25 
    Answers

    Given a list/array of names(String) sort them such that each name is followed by a name which starts with the last character of the previous name. 
    # input 

    Luis 
    Hector 
    Selena 
    Emmanuel 
    Amish 


    # output: 

    Emmanuel 
    Luis 
    Selena 
    Amish 
    Hector 
    ]

    anurag.11feb January 07, 2014 in Netherlands  | Report Duplicate | Flag 
    Booking.com Developer Program Engineer Algorithm
  • bookingcom-interview-questions
    2
    of  2 votes
    27 
    Answers

    Two tables. Country and City 
    country --> countryid, country name 
    city --> countryid, city name 

    1. how do you get the countries that has no cities? 
    2. how do you get the countries that has less than 3 cities and also make sure the countries with no cities also show up.

    sunny smart June 16, 2013 in Netherlands  | Report Duplicate | Flag 
    Booking.com None None Database SQL
  • bookingcom-interview-questions
    1
    of  1 vote
    5 
    Answers

    What is the difference between a class method and an instance method?

    Mauricio.Malf February 21, 2013 in Netherlands  | Report Duplicate | Flag 
    Booking.com Software Engineer / Developer Object Oriented Design
  • bookingcom-interview-questions
    1
    of  1 vote
    29 
    Answers

    How do you remove repeated values from a INT array, returning the resultant array in the same order as original ?

    Mauricio.Malf February 20, 2013 in Netherlands  | Report Duplicate | Flag 



面试两道技术题,第一题是给两个数组,找最小的共同元素,

HashSet+List搞定,然后问了hash function的问题。


第二题是经典的六维空间问题,给你社交网络中的两个人,判断两人之间的距离是否小于6。

LZ当初看LiveRamp面经的时候看到过这题,应该用bi-directional BFS做,但是面试的时候一紧张没想起来,于是先写了普通的BFS,然后面试官问如果有的人朋友特别多,内存空间不够用该怎么优化,LZ没答上来,估计跪的话就跪在这里了。

技术题之后又问了我商业方面的问题,说Booking.com在芬兰拓展业务的时候,很多当地的旅馆都抱着观望的态度,问我该怎么说服他们加入Booking。LZ作为一个屌丝码农,完全不懂这方面的事,然后乱答了一通。这家至今还没出结果,不过多半是跪了,而且即使过了也要去阿姆斯特丹on-site,就随他去了。


 在hackerrank 上面做的。 强烈建议大家做之前先把hackerank 的输入输出搞清楚。。 我浪费了好长时间弄懂它。下面是题目: 1. 给一些输入 比如 {4 4 4 4,6 5 6 5,1 2 3 4,1 1 1 1, 2 3 4 8} 每一项代表一个图形4个边的长度。 然后图形可能是正方形, 矩形,或者其他。 输出有几个正方形,矩形和其他。 比如我前面那个例子就输出 2 个正方形(因为4 4 4 4 和 1 1 1 1), 1个矩形(6 5 6 5),2个其他(1 2 3 4 和2 3 4 8)。 2.和leetcode group anagrams 一样. 不同的一点是 可能有“dirty room” 中间有空格的单词出现, 所以每次都要处理下这种情况,变成”dirtyroom” 在下一步操作。 3. 给一堆数,比如 input :25400 26300 2 128 5. output:25400 -128 900 -128 -26298 126 -123 题意 只要当前数减去前面数 -127<=diff<=127 就直接输出 diff, 如果不是先输出-128 在输出diff。 4. 类似 leetcode two sum. 不同是只要发现有2个数可以组成 target 就输出 1, 没有就输出 0; 其实题都不难,就是读题意 和 弄清楚输入输出 耗时间。。 还好 及时做完了。 求大米,求电面~~~~~


找多个array中都有且最小的数。和interviewer讨论没有结果应该怎么处理浪费了很多时间,最后时间不够有点慌没有答很好。 


楼主前段时间做了booking的OA。 分享一下。 记得好像是给5天时间做的~~ 不知道和大伙最近做的OA 是否一样。 给大家参考一下~~~ 1. 输入一个数组,要求输出如下 int array = { 3,6,61,6,7,9,1,7,7,2,7,7,2,388,3,72,7}; output [ ,,,,,, ] 2. Implement a function all_anagram_groups() that, given many input strings, will identify and group words that are anagrams of each other. An anagram is word that is just a re-arrangement of the characters of another word, like “reap” and “pear” and “a per” (whitespace is ignored). But “pear” and “rep” are not, since “rep” does not have an “a”. Also, “the” and “thee” are not anagrams, because “the” only has one “e”. Given this example input: The output should be an array-of-arrays (or list-of-lists) [ , , , , ] 3. Write a function get_hops_from(page1, page2) that will determine the number of hyperlinks that you would need to click on to get from some page1 on the web to some other page2 on the web. For example, if each page below links to the pages that are indented below it, e.g. page 1 links to pages 2 and 5, and page 2 links to pages 3 and 4, and page 5 links to pages 3 and 7, then the get_hops_from(page1, page7) should return 2 (2 hops), since you have to hop once from page 1 to 5 and once more from page 5 to page 7. page1 : distance == 0 page2 : distance == 1 page3 : distance == 2 page4 : distance == 2 page5 : distance == 2 page3 : distance == 2 page7 : distance == 2 Assume that an API is available to: * get_links(a_page) will return an array/list of all pages that a_page links to 4. Implement a function sort_numerically() that will receive a list of numbers represented in English words and return the listed sorted by their numeric value, starting with the largest. Input: [ “seventy five”, “two hundred forty one”, “three thousand”, “one million thirty five thousand twelve”, “twenty”, “five hundred thousand”, “two hundred”, ] Output: [ “one million thirty five thousand twelve”, “five hundred thousand” “three thousand”, “two hundred forty one”, “two hundred”, “seventy five”, “twenty”, ] 


OA就跟版上说的75min 四道题一样,提前写了一下结果半小时就交了……感觉好假╮(╯▽╰)╭输入输出都是要自己写,从stdin读,输出到stdout,做过其他oa的话copy过来改一改就好…… 9.28学校招聘会投简历给hr,过两天收到邮件约未来三周时间电面,30-45min,因为时差只能约早上,我回的快,好久之后才回复我说约到了10.21,第二天才回的就被告知这个时段人太多约不过来了……= = 确认面试时间时候说会给个oa面试之前做完,然后忘记给我发,我问了一遍才发的……= =而且确认面试时间那个邮件的标题开头!

赫然写着!Template!内容里还出现了n/a....这hr是有多不走心…… 


于是早上十点艰难地爬起来面试,两个面试官,上来一句简历都没问,直接做题 0 xxx yyy zzz 10 sss eee sss ... 后面的string是query,前面的数字是这个query搜到的结果数,问在结果数为0的query里头出现最多的单词是什么 我写到一半要返回最多单词了突然跟我说要返回最多的五个。。。。。于是开始硬着头皮写Priority queue.....= =心好累 写完已经过去20分钟了,问了跟priority queue相关的概念,然后五分钟问问题,完事儿了 当时说这周内给结果,结果今天一觉醒来就收到了onsite....然而签证过期并去不了阿姆斯特丹…… = =想去玩儿的小伙伴们加油~ 


不会算10 sss那行的,因为只算0的那行~可能我例子写的不大清楚 0 word1 word2 word3 10 word4 word2 word1 0 word5 word3 word 5 0 word3 word2 word7 … 这种的话就是word3最多~ 回复 举报 0 manjusaka077 2015-10-23 21:42:12 stevenlordiam 发表于 2015-10-24 04:10 请问 是不是 10 sss eee sss. 返回搜到最多的是sss 这个字符?输入是个arraylist么?还是一行一行的读取? 输入是一个文件,按行读取,不过他说读文件这块意思一下就行,不是重点 0 stevenlordiam 2015-10-24 11:05:32 manjusaka077 发表于 2015-10-24 09:42 输入是一个文件,按行读取,不过他说读文件这块意思一下就行,不是重点 懂了,多谢楼主~ 0 jackmk 2015-10-28 11:32:33 楼主申的是graduate的那个职位吗?我也收到电面邮件,但明确的说不是technical的,目前也不知道准备些什么 0 manjusaka077 2015-10-29 20:10:18 jackmk 发表于 2015-10-28 23:32 楼主申的是graduate的那个职位吗?我也收到电面邮件,但明确的说不是technical的,目前也不知道准备些什么 是那个职位……我的电面邮件明确说了是technical的,可能你是跟hr聊的那轮?我是job fair跟hr聊过所以直接给了电面 

链接: https://instant.1point3acres.com/thread/138179
来源: 一亩三分地




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值