Software engineer Interview Questions | Glassdoor.com.au

# Software engineer Interview Questions

1,548

software engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

11 Feb 2013

25 Jun 2011

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

21 Oct 2014
 Find the longest subsequence of duplicate numbers in an array of sorted numbers.5 AnswersA binary search with two partitions (i.e. partition list into thirds) will get you a logarithmic time solution. I got this solution, but I think I took too long to do it compared to the other candidates.Hi there, can you elaborate on what you mean by using a binary search? I've been thinking about what you said for the last 10 minutes and I can't understand would a binary search help here. Just curious, thanksIf the array is sorted, you can simply go through elements one by one and count the duplicate numbers. The complexity is linear. Could it be so trivial?Show more responsesLinear is o(n), binary search takes just o(logn)Jumping in powers of 2 would be O(log n) for best case scenario rather than linear search's O(n). Worst case scenario they would both be O(n). Logic: - Let n be the position you are currently checking for the longest subsequence (starts at 0) - K = 0 - While arr[n] == arr[n + 2^K] do - K++ - If 2^K is > the previously known longest subsequence - Binary search between 2^K-1 and 2^K to find the exact length of the current sequence - Store it as the longest known subsequence - Repeat with n as the position you are at now + 1

17 Oct 2013
 Typical Android Layouts (What's the best way to lay element vertically etc.). Android Lifecycle. LinkedList vs Arrays.4 AnswersI guess the answer to the first question would be listView? Or if is supposed to be a layout, LinearLayout would be my solution.Yes, the answer is (obviously) a Vertical LinearLayout. I had a bit of a brain fart and called it a Linear ListView, which is incorrect.Hello Michael, Have you been in a FB's interview before?Show more responsesHi, Yes, I'm the original poster - I got the phone screen but did not go to the next round unfortunately.

25 Jun 2011

2 Oct 2015

### Software Developer at carsales.com.au was asked...

14 Feb 2019
 Write pseudo code to print one word for a sequence when it's divisible by 3, another word if it's divisible by 5 and both words if they are divisible by both 3 and 53 AnswersProvided a working pseudo codeSuccessful hires over the past 2 years have been able to complete the coding task in 3 hours.But somehow I wasn't able to start from scratch and finish a presentable, working app with well maintainable code in 3 hours. Maybe I'm too dumb, but I felt at least I deserved a response email after sending the project to the recruiter. I spent more than 3 hours creating the app as per their specs and they didn't utter a word of response. May be just spare a minute to say 'we didn't like the way you handled this... ' or so? Have a heart