Google Mostly Asked Technical Questions | Google technical interview question 2014| Google Mostly Asked Technical Questions
Technical papers:
Q1) What is the value of i after execution of the following program?
void main()
{
long l=1024;
int i=1;
while(l>=1)
{ l=l/2;
i=i+1;
}
}
a)8 b)11 c)10 d)100
ans:b
Q2) This question is based on the complexity …
Q3)
s->AB
A->a
B->bbA
Which one is false for above grammar?
Q3) Some Trees were given & the question is to fine preorder traversal.
Q4) One c++ program, to find output of the program?
Q5) If the mean failure hour is 10,000 and 20 is the mean repair hour. If the printer is used by 100 customer, then find the availability?
1)80% 2)90% 3)98% 4)99.8% 5)100%
Q6) One question on probability?
Q7) In a singly linked list if there is a pointer S on the first element and pointer L is on the last element. Then which operation will take more time based on the length of the list?
1) Adding element at the first.
2) adding element at the end of the list.
3) To exchange the first 2 element.
4) Deleting the element from the end of the list.
ans:2 check it!
Aptitude Paper:
1. Solve this cryptic equation, realizing of course that values for M and E could be interchanged. No leading zeros are allowed.
WWWDOT - GOOGLE = DOTCOM
This can be solved through systematic application of logic. For example, cannot be equal to 0, since . That would make , but , which is not possible.
Here is a slow brute-force method of solution that takes a few minutes on a relatively fast machine:
This gives the two solutions
777589 - 188106 == 589483
777589 - 188103 == 589486
Here is another solution using Mathematica's Reduce command:
A faster (but slightly more obscure) piece of code is the following:
Faster still using the same approach (and requiring ~300 MB of memory):
Even faster using the same approach (that does not exclude leading zeros in the solution, but that can easily be weeded out at the end):
Here is an independent solution method that uses branch-and-prune techniques:
And the winner for overall fastest:
2. Write a haiku describing possible methods for predicting search traffic seasonality.
MathWorld's search engine
seemed slowed this May. Undergrads
prepping for finals.
3. 1
1 1
2 1
1 2 1 1
1 1 1 2 2 1
What's the next line?
312211. This is the "look and say" sequence in which each term after the first describes the previous term: one 1 (11); two 1s (21); one 2 and one 1 (1211); one 1, one 2, and two 1's (111221); and so on. See the look and say sequence entry on MathWorld for a complete write-up and the algebraic form of a fascinating related quantity known as Conway's constant.
4. You are in a maze of twisty little passages, all alike. There is a dusty laptop here with a weak wireless connection. There are dull, lifeless gnomes strolling around. What dost thou do?
A) Wander aimlessly, bumping into obstacles until you are eaten by a grue.
B) Use the laptop as a digging device to tunnel to the next level.
C) Play MPoRPG until the battery dies along with your hopes.
D) Use the computer to map the nodes of the maze and discover an exit path.
E) Email your resume to Google, tell the lead gnome you quit and find yourself in whole different world [sic].
In general, make a state diagram . However, this method would not work in certain pathological cases such as, say, a fractal maze. For an example of this and commentary, see Ed Pegg's column about state diagrams and mazes .
5. What's broken with Unix?
Their reproductive capabilities.
How would you fix it?
6. On your first day at Google, you discover that your cubicle mate wrote the textbook you used as a primary resource in your first year of graduate school. Do you:
A) Fawn obsequiously and ask if you can have an autograph.
B) Sit perfectly still and use only soft keystrokes to avoid disturbing her concentration
C) Leave her daily offerings of granola and English toffee from the food bins.
D) Quote your favorite formula from the textbook and explain how it's now your mantra.
E) Show her how example 17b could have been solved with 34 fewer lines of code.
7. Which of the following expresses Google's over-arching philosophy?
A) "I'm feeling lucky"
B) "Don't be evil"
C) "Oh, I already fixed that"
D) "You should never be more than 50 feet from food"
E) All of the above
8. How many different ways can you color an icosahedron with one of three colors on each face?
For an asymmetric 20-sided solid, there are possible 3-colorings . For a symmetric 20-sided object, the Polya enumeration theorem can be used to obtain the number of distinct colorings. Here is a concise Mathematica implementation:
What colors would you choose?
9. This space left intentionally blank. Please fill it with something that improves upon emptiness.
For nearly 10,000 images of mathematical functions, see The Wolfram Functions Site visualization gallery .
10. On an infinite, two-dimensional, rectangular lattice of 1-ohm resistors, what is the resistance between two nodes that are a knight's move away?
This problem is discussed in J. Cserti's 1999 arXiv preprint . It is also discussed in The Mathematica GuideBook for Symbolics, the forthcoming fourth volume in Michael Trott's GuideBook series, the first two of which were published just last week by Springer-Verlag. The contents for all four GuideBooks, including the two not yet published, are available on the DVD distributed with the first two GuideBooks.