面經------Google(2)
-
又是純數學題. Black Jack. 給你infinity張牌. Card value 1到10. Find the probability that a card will bust. P(bust|x=hand) 玩家17 to 21時贏, 超過21 bust.
-
給你N幅畫. 每幅畫都有price和quality. 用最低價格買K幅畫, with 0<K<=N Constraint: 買的畫必須遵守minimum price for 那幅畫. 用了一個ratio來買一幅畫, 剩餘的K-1幅畫都要遵守這個ratio.
-
i. 給你一個tree. 裡面多了一條edge, 所以不是binary tree了. Remove 那個多餘的edge. ii. Implement power(x,y) st it returns x^y. Optimize 它
-
i. 猜字遊戲. 給你一個secret word, 一個guess word. Return <number of words that is guessed correctly and at correct position, number of words that is guessed correctly but at wrong position> ii. 迷宮. 給你一個有一些牆的迷宮. 怎麼從start去到end.
-
一個俄羅斯小哥, 人狠話不多. 給你一個infinite size length array, 和list of queries in the format of <i,j>, find the maximum number from index i to index j in array. 全程45分鐘一句話都不說, 就盯著你.