姐们们都吃哪个牌子的葡萄籽精华啊?# Fashion - 美丽时尚
m*6
1 楼
Google:
1. Excel spread sheet, each cell is either number or function. When a number
cell is updated, how to effectively update all relevant function cells.
2. Given a folder, return a random file in the folder. File returned must be
uniformed distributed, O(1) memory, can only go through the file system
once.
3. Given an array of TreeNodes. Each Tree Node object only contains a parent
index field which is the index of the parent node in the array. Parent Node
is required to be in front of child node in the array. Array can contain
multiple trees. Root node has parent index pointing itself. Write a delete
function which takes the initial array list of TreeNodes as well as a Set of
TreeNodes to be deleted. Delete all tree nodes in the delete set as well as
its children. Resulting array list can not have holes.
4. Given an array of numbers and a min gap G. Return the max sum in the
array, max sum may not contain two numbers that are less than G apart.
5. Design Google Doc.
Facebook:
1 (Warm up). Given string a and string b, return if a contains b. (can not
use contains obviously)
2 (Warm up). Given a string, return if it's a palindrome. (aba is a
palladium)
3. Given a matrix, implement two functions. Get sum takes minX, maxX, minY,
maxY and returns the sum of the rectangle. Set index takes x, y, value and
sets cell x,y to that value. Get sum need to be O(1) and set index can be
slow.
4. Each letter maps to its location in the alphabet. (A->1, B->2, K->11, Z->
26). Given a valid int string, return the number of alphabet sequence it can
map to. For example, 111 can be AAA, AK, KA, so the return value should be
3.
5. Given an almost sorted array and max deviation D. Each element in the
array can not be more than D apart from its sorted index. Sort the array.
6. Given int array P and int N. Return the number of ways you can make N
with elements of array P. For example, if P is [1,2] and N is 3, you can do
111,12. so the answer is 2. You may not count 1,2 and 2,1 twice.
7. Given a int array list, return a sub array list that contains the longest
non decreasing sequence. If there are more than one available, you can
return any one.
8. Design Instagram.
Misc:
1. Given a Date object that contains year, month and day and int addition
days, Implement the add function and return the resulting Date object.
2. Given a string s and string pattern. Return if s fits the pattern.
Pattern may contain . and *. . can be matched to any character where * can
be matched to any sequence of characters. For example, abba matches pattern
*a and .b.a.
3. Implement a bowling game. There are two functions, roll(int pins), and
getScore(). Caller will call roll until the game is over and call getResult
to get the result.
4. Assume progress is a double between 0 and 1 and time is also a double
between 0 and 1. You are given a function getProgress(double time),
implement a function getTime(double progress). You may define an epsilon.
5. What is the run time complexity of merging one link list to another? What
is the run time complexity of Link List addAll in Java and C++? Why?
6. Implement pow(double base, int exponent).
1. Excel spread sheet, each cell is either number or function. When a number
cell is updated, how to effectively update all relevant function cells.
2. Given a folder, return a random file in the folder. File returned must be
uniformed distributed, O(1) memory, can only go through the file system
once.
3. Given an array of TreeNodes. Each Tree Node object only contains a parent
index field which is the index of the parent node in the array. Parent Node
is required to be in front of child node in the array. Array can contain
multiple trees. Root node has parent index pointing itself. Write a delete
function which takes the initial array list of TreeNodes as well as a Set of
TreeNodes to be deleted. Delete all tree nodes in the delete set as well as
its children. Resulting array list can not have holes.
4. Given an array of numbers and a min gap G. Return the max sum in the
array, max sum may not contain two numbers that are less than G apart.
5. Design Google Doc.
Facebook:
1 (Warm up). Given string a and string b, return if a contains b. (can not
use contains obviously)
2 (Warm up). Given a string, return if it's a palindrome. (aba is a
palladium)
3. Given a matrix, implement two functions. Get sum takes minX, maxX, minY,
maxY and returns the sum of the rectangle. Set index takes x, y, value and
sets cell x,y to that value. Get sum need to be O(1) and set index can be
slow.
4. Each letter maps to its location in the alphabet. (A->1, B->2, K->11, Z->
26). Given a valid int string, return the number of alphabet sequence it can
map to. For example, 111 can be AAA, AK, KA, so the return value should be
3.
5. Given an almost sorted array and max deviation D. Each element in the
array can not be more than D apart from its sorted index. Sort the array.
6. Given int array P and int N. Return the number of ways you can make N
with elements of array P. For example, if P is [1,2] and N is 3, you can do
111,12. so the answer is 2. You may not count 1,2 and 2,1 twice.
7. Given a int array list, return a sub array list that contains the longest
non decreasing sequence. If there are more than one available, you can
return any one.
8. Design Instagram.
Misc:
1. Given a Date object that contains year, month and day and int addition
days, Implement the add function and return the resulting Date object.
2. Given a string s and string pattern. Return if s fits the pattern.
Pattern may contain . and *. . can be matched to any character where * can
be matched to any sequence of characters. For example, abba matches pattern
*a and .b.a.
3. Implement a bowling game. There are two functions, roll(int pins), and
getScore(). Caller will call roll until the game is over and call getResult
to get the result.
4. Assume progress is a double between 0 and 1 and time is also a double
between 0 and 1. You are given a function getProgress(double time),
implement a function getTime(double progress). You may define an epsilon.
5. What is the run time complexity of merging one link list to another? What
is the run time complexity of Link List addAll in Java and C++? Why?
6. Implement pow(double base, int exponent).