e*****u 发帖数: 67 | 1 自己不是CS專業,只學過一門數據結構,會一些Python.
明天on-site面試一個engineer工作。 臨時抱佛腳。
如果明天當場要寫code,估計只能有Python硬着頭皮寫-
請教諸位大俠, 下面這幾道題用Python怎麼寫-
1) Describe recursive mergesort and its runtime. Write an iterative
version in Python.
2) Given an array of numbers, replace each number with the product of
all the numbers in the array except the number itself *without* using
division.
3) Write a program to find depth of binary search tree without using
recursion.
4) Efficiently implement 3 stacks in a single array.
5) Given an array of integers which is circularly sorted, how do you
find a given integer.
6) Find the maximum rectangle (in terms of area) under a histogram in
linear time.
7) Most phones now have full keyboards. Before there there three letters
mapped to a number button. Describe how you would go about implementing
spelling and word suggestions as people type.
8) How would you determine if someone has won a game of tic-tac-toe on a
board of any size?
9) Create a cache with fast look up that only stores the N most recently
accessed items.
10) How to design a search engine? If each document contains a set of
keywords, and is associated with a numeric attribute, how to build
indices?
11) Given two files that has list of words (one per line), write a
program to show the intersection.
12) What kind of data structure would you use to index annagrams of
words? e.g. if there exists the word “top” in the database, the query
for “pot” should list that.
------------
多謝各位。 明天面試回來,一定來回報一下! | l********a 发帖数: 1154 | 2 这几个问题用python基本都不算问题,py的数据结构太省心了关键 | t*****n 发帖数: 4908 | | e*****u 发帖数: 67 | 4 自己不是CS專業,只學過一門數據結構,會一些Python.
明天on-site面試一個engineer工作。 臨時抱佛腳。
如果明天當場要寫code,估計只能有Python硬着頭皮寫-
請教諸位大俠, 下面這幾道題用Python怎麼寫-
1) Describe recursive mergesort and its runtime. Write an iterative
version in Python.
2) Given an array of numbers, replace each number with the product of
all the numbers in the array except the number itself *without* using
division.
3) Write a program to find depth of binary search tree without using
recursion.
4) Efficiently implement 3 stacks in a single array.
5) Given an array of integers which is circularly sorted, how do you
find a given integer.
6) Find the maximum rectangle (in terms of area) under a histogram in
linear time.
7) Most phones now have full keyboards. Before there there three letters
mapped to a number button. Describe how you would go about implementing
spelling and word suggestions as people type.
8) How would you determine if someone has won a game of tic-tac-toe on a
board of any size?
9) Create a cache with fast look up that only stores the N most recently
accessed items.
10) How to design a search engine? If each document contains a set of
keywords, and is associated with a numeric attribute, how to build
indices?
11) Given two files that has list of words (one per line), write a
program to show the intersection.
12) What kind of data structure would you use to index annagrams of
words? e.g. if there exists the word “top” in the database, the query
for “pot” should list that.
------------
多謝各位。 明天面試回來,一定來回報一下! | l********a 发帖数: 1154 | 5 这几个问题用python基本都不算问题,py的数据结构太省心了关键 | t*****n 发帖数: 4908 | | z**********6 发帖数: 68 | 7 以前面试Google的时候曾经被问第10题,感觉是如果你能答出跟倒排索引相关的算法的
话HR会很happy,倒排的资料上网搜一下应该不少 |
|