Cybertroubleshoot - Tech Hacks, Hacking Tutorials, Tech News, Hacker News

cyber security - technology news - tips and trick - viral tech - new technology launch

Friday, 28 July 2017

Answer of google interview question

     Answer of google interview question

1.Ans ➤  A database is a machine that memorizes lot of information about lots of things. People use them to remember that information.

2.Ans ➤ en -3
Nine -4
Sixty – 5
Ninety- 6
The next probable number would be anything that has 9 letters in it, i.e., ninety-six or ninety-one.

3.Ans ➤ Usually, people respond this question with an answer like “Beef is always dead” – Wrong Answer.  The correct answer is that “DEADBEEF” is a hexa-decimal value that was used in debugging back in the mainframe/assembly days as such it was easy to see when marking and finding specific memory in pages of hex dumps. Most computer engineers are aware of this term.

4.Ans=Answer is zero, when the wheel rolls, it is moving in two ways; rotationally around its center and horizontally in the direction of the travel.  At its point of contact with the ground, both of these motions cancel each other out, leaving a net speed (with respect to the road) of zero.

5.Ans ➤ He was playing Monopoly.

 6.Ans ➤  Every page number has a digit in the units column. With N pages, that's N digits right there. All but the first 9 pages have a digit in the tens column. That's N - 9 more digits.

All but the first 99 pages have a digit in the hundreds column (accounting for N - 99 more digits).

I could go on, but not many books have more than 999 pages. A book with 1,095 digits in its page numbers won't, anyway.

This means that 1,095 must equal:

N + (N - 9) + (N - 99).

This can be simplified to:

1,095 = 3N - 108.

That means that 3N = 1,203, or N = 401. That's the answer, 401 pages.

 8.Ans ➤ If it is dropped from that floor or below, it will be completely undamaged and you can drop the egg again.
Given two eggs, find the highest floor an egg can be dropped from without breaking, with as few drops as possible.breaking.

  9.Ans ➤ This is a very simple probability question in a software interview. This question might be a little old to be ever asked again but it is a good warm up.

Assume there are C number of couples so there would be C boys. The number of girls can be calculated by the following method.

Number of girls = 0*(Probability of 0 girls) + 1*(Probability of 1 girl) + 2*(Probability of 2 girls) + …
Number of girls = 0*(C*1/2) + 1*(C*1/2*1/2) + 2*(C*1/2*1/2*1/2) + …
Number of girls = 0 + C/4 + 2*C/8 + 3*C/16 + …
Number of girls = C
(using mathematical formulas; it becomes apparent if you just sum up the first 4-5 terms).

10.Ans ➤ void maxSumSubArray( int *array, int len, int *start, int *end, int *maxSum )
    int maxSumSoFar = -2147483648;
    int curSum = 0;
    int a = b = s = i = 0;
    for( i = 0; i < len; i++ ) {
        curSum += array[i];
        if ( curSum > maxSumSoFar ) {
            maxSumSoFar = curSum;
            a = s;
            b = i;
        if( curSum < 0 ) {
            curSum = 0;
            s = i + 1;
    *start = a;
    *end = b;
    *maxSum = maxSumSoFar;
}sub-array with the largest sum.


No comments:

Post a Comment