Engineering Interview Questions | Glassdoor.com.au

# Engineering Interview Questions

1,769

Engineering interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

11 Feb 2013

### Software Engineer at Google was asked...

25 Jun 2011
 Quickly estimate 2^64 without using a pen/papar.9 AnswersWell, 2^8 is 256 and 2^16 is that squared, which should have 5 digits.. If I square it again, I should have double those digits, and again if I square it again.. So I'm looking for something in the neighborhood of 1x10^20, or approx 10,000,000,000,000,000,000. Calculator says: 18,446,744,073,709,551,616--> I'm in the ballpark.2^10=1024 ~10^3 2^64=(2^10)^6 * 2^4 => (10^3)^6*16 => 10^18*16 => 1.6 * 10 ^ 19 = 16,000,000,000,000,000,000 Calculator says: 18,446,744,073,709,551,6162 ^ 10 = 1.024 * (10^3) 2 ^ 60 = (1.024 ^ 6) * (10 ^ 18) 2 ^ 64 = (16 * (1.024 ^ 6) * (10 ^ 18) ) All, we need to solve is 1.024 ^ 6. using binomial expansion, ignoring the smaller terms we get : (1 + 0.024) ^ 6 = 1 + 6 * 0.024 = 1.144 = 1.15 (approx) Hence the answer is : (16 * 1.15) * (10 ^ 18) = 18.4 * (10 ^ 18) It is much closer to the actual answer and very fast to calculate.Show more responsesDonno if this is to test witt and prepness.. I would say 18,446,.... so on He ll ask how i get that.. Say "calculator" The question was about without using pen/paper2^32 ~= 4 bil 2^64 = 4bil * 4 bil = 16 bil bil each bil 9 0's, so 16 with 18 0's.It is 16 billion billionsThey are talking about 64 bit integer, where left most bit is set to 1, and rest to 0. Considering it is 64 bit unsigned integer, it should be equal to value of 32 unsigned integer where all bits are 1, which I guess is somewhere around 4billion, or you can just say 2^64 = UInt32.MaxValue2^64 the answer is 32well in binary, 1 followed by 64 0s. They didn't specify answer should be in decimal.

### Software Engineer at Google was asked...

25 Jun 2011
 You have a 64bit interger counter set to 0. How long it will take to overflow the counter given that you are incrementing it at 4Ghz speed. 9 Answers60 yearsIf we were to keep it simple and not consider every increment to be a load, increment, store then we basically need 2^64 increments to make the long overflow. 4GHz means 4*(2^30) instructions per second.. which is 2^32 effectively it is (2^64)/(2^32) = 2^32 seconds.. or roughly 136years.total increments before overflow (tibo) = 2^64 increment speed(is) = 1 second / (4*10^9) increments | 4Ghz = 1x10^9 Hz total seconds (ts) = 2^64 increments * (1 second /(4*10^9) increments) ts = 4.611 * 10^9 seconds total years = ts/(60*60*24*52) = 146.2 yearsShow more responsestotal years = ts/(60*60*24*7*52) = 146.2 years and 4ghz = 4*10^9 HzPlease read the question carefully, it says counter is incrementing at the rate of 4GHz. i.e, 4GB per second. Not incrementing every second. So after elapsing first second, counter is at 4GB. After elapsing 2nd second, it is 4 + 4 = 8GB. 64 bit integer is, 2^64 = 2^32 * 2^32. Which is roughly 4GB * 4GB = 16GB. So per second counter incremented to 4GB, so for 16GB it takes 4 seconds.Anonymous: 4GB * 4GB != 16 GB. You're ignoring the units! To be accurate, the answer is 4G * 4G = 16 G^2 = 16 * 2^30 * 2^30.guys note: the counter is initialized to 0. and overflows when you increment the counter when it holds 2^32.its take 2 second rightpython: (float(2**64)/(4*10**9))/(24*60*60*365) 146.235604338768 years.

8 Feb 2010

25 Jun 2011

### Software Engineer Intern at Google was asked...

8 Feb 2010
 Calculating the max execution time of a program that had to fit into a certain size of memory on an embedded device.2 AnswersI think it depends on processing speed of a µProcessor or µController or it depends on MIPS of the system. Finally, MIPS will be used to measure the time for executing total number of assembly level instructions of the given code.I guess they're expecting to measure how you can manage memory in your code. I would use pointers such that I can free up the memory (by deleting) when I'm done. clock_t* start = clock(); program code{} clock_t* end = clock(); clock_t ExecutionTime = end - start; delete start; delete end;

### Software Engineer at Google was asked...

2 Jul 2012
 how many golf balls could you fit into that building?2 AnswersI would ask what the diameter of a golf ball is and how many rooms and how big of each room are in the building. Then form a formula.You mean without the building collapsing? The weight of an individual ball isn't that great, start filling a building with them, and the weight adds up.

### Senior Technical Support Engineer at Symantec was asked...

25 Sep 2012
 Why are manhole covers round3 AnswersThere is no right or wrong answer here. The hiring manager is trying to understand the thought process you go through to answer a question.They're round because, given that they have bevelled edges, that shape makes it impossible to drop the cover down the hole.They are round because the shaft that you descend into, after removing the manhole cover, is round.

### Senior Software Engineer at Google was asked...

2 Jul 2013
 How long will it take for an unsigned 64 bit counter to overflow on a xxx ghz machine and another coding problem that requires recursive programming.2 Answersunsigned 64-bit counter = 2^64. xxx GHz machine = xxx * 10^9 cycles/second, ie. 1 cycle is 1/(xxx * 10^9) seconds. Assuming the counter increments 1 every cycle, then it'll max out at: 2^64 / (xxx * 10^9) seconds.1 G = 2 ^ 30

### Software Engineer at Google was asked...

25 Jun 2011
 C++ versus Java. Reverse a singly lined list.3 Answersreverse(Node n1, Node n2) { Node newHead; if (n2.next != null) newHead=reverse(n2, n2.next); else newHead = n2; n2.next = n1; }to J, good stuff. remember to return newHeadNode* reverseList(Node *n1, Node *n2) { Node *newHead; if (n2->next != NULL) newHead = reverseList(n2, n2->next); else newHead = n2; n2->next = n1; n1->next = NULL; return newHead; }
110 of 1,769 Interview Questions

More