-
Notifications
You must be signed in to change notification settings - Fork 0
/
questions.txt
52 lines (33 loc) · 2.74 KB
/
questions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Google
After given clearly definition of UTF-8 format. ex: 1-byte: 0b0xxxxxxx 2- bytes:....
Asked to write a function to validate whether the input is valid UTF-8.
Input will be string/byte array, output should be yes/no.
Given an array of (unsorted) integers, arrange them such that a < b > c < d > e... etc.
Given a TV remote, write a script that would give directions to input some letters. Starting from the upper left-hand corner. If the buttons were in 3 columns, and you wanted to type "feed", you would want the output of the program to say "right, right, down, PRESS, left, PRESS, PRESS, left, PRESS"
This was one of the more standard questions. You have stairs with N number of steps. You can take either one step steps or two step steps; how many ways can you climb the stairs?
A string consists of ‘0’, ‘1’ and '?'. The question mark can be either '0' or '1'. Find all possible combinations for a string.
Give you a text file, remove duplicated lines.
Follow up: If the file is very large, general hash map takes too much spaces, come up with a better solution.
Two phone interviews. Does a given file name match a single-star pattern?
index.html matches *.html
foo.txt does not match *.html
matches(“index.html”, “*html”) returns true
matches(“foo.txt”, “*html”) returns false
matches(“cat”, “c*t”) returns true
Given infinitely numbers, for every number compute the average of the former k numbers.
Convert string to integer like atoi in C
Write a function for -- Given a URL which has url-encoded name-values and a variable, return the value for it.
Now modify the function to handle when the name appears multiple times.
Phone interview 1:
1. What is virtual function?
2. What is the benefit of inherent?
3. What is the advantage of interface in java?
4. Write a program to reverse a linked list.
5. Write a program to find the intersection of two sets and test your program.
Phone interview 2:
1. How to get k random samples in a large file of query key words?
hints: partition the files into n trunks. Load the trunk into main memory.
Given two sorted lists of ordered tuples, combine them into one such that overlapping ranges are merged. For example: [ (1,4) , (10, 15) , (20, 24) ] and [ (3, 5) , (16, 17), (21, 23) ] becomes [ (1,5) , (10, 15) , (16, 17), (20, 24) ]
We have a schedular. Timer is available to the schedular. The clients of this schedular want to call this schedular with 2 parameters, 1) time interval in ms 2) callback function. The schedular will invoke specified callback function after specified time intevals. Design data structure and implement it.
Addition of 2 big numbers (represented by 2 int arrays, assuming each integer can only be 0-9)
Find if a binary tree is the sub-tree of another.