Software/Systems Engineer (Software Engineer) Interview Questions | Glassdoor

# Software/Systems Engineer (Software Engineer) Interview Questions

182

Software/Systems engineer (software engineer) interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

### Tegra Systems Software Engineering at NVIDIA was asked...

Feb 27, 2012
 identify the number of 1s in an integer is odd or even7 Answershint is XORvoid OnesAreOdd(int n) { int i=0; while(n!=0) { n=n&(n-1); i++; } return (i&1==1)?true:false; }Above solution is incorrect. void OnesAreOdd(int n) { int i=0; while(n!=0) { n=n&(n-1); i=i^1; } return i==1?true:false; }Show More ResponsesWas taken from: http://graphics.stanford.edu/~seander/bithacks.html unsigned int v; // word value to compute the parity of bool parity = false; // parity will be the parity of v while (v) { parity = !parity; v = v & (v - 1); }Hey guys, why are you thinking the question means binary 1s? I think it means decimal 1s.Let number be c int count = 0; while ( c != 0 ) { count += (c & 1); c >> 1; } if ( count%2 == 0) printf("Number of 1s are even);Easy dumb solution, convert the number to string and count. sprintf(str, "%d", num); int i=0, cnt=0; while (str[i]!='\0') { if (str[i++]=='1') cnt++; } if (cnt%2) printf("odd"); else printf("even");

### Systems Software Engineer at NVIDIA was asked...

Apr 27, 2012
 Given a page size and a number, align the number with the nearest page. (Note: This was a phone interview question. The interviewer and I used an online document to share ideas about this problem.7 Answers//naive solution: int getAlignedValue(int pageSize, int valueToAlign) { int index = valueToAlign/pageSize; return index * pageSize; } //faster solution: int getAlignedValue_Fast(int pageSize, int valueToAlign) { return valueToAlign & !(pageSize-1); }I think that at the faster solution you mean int getAlignedValue_Fast(int pageSize, int valueToAlign) { return valueToAlign & ~(pageSize-1); } Note: There is a difference between !(pageSize-1) and ~(pageSize-1) ~(0x11) is 0xee !(0x11) is 0@The Dude Good catch! I didn't think about that. (Fortunately, I didn't have to execute the code in the interview--I just typed it in a program similar to Google Docs.) Thanks!Show More ResponsesI just wanted to point out that the "faster solution" only works if the pageSize is assumed to be a power of 2. For example, suppose pageSize = 10 (or 01010 in binary), and valueToAlign = 24 (or 11000 in binary), then the fast method would give 16, but it should be 20. Anyways, thanks for posting the question and solution.@observer I see how the mask works out for the alignment, why it is works mathematically? ThanksThe interviewer could be looking for some bit ops. But, the following one, works even page size isn't a power of 2. int mod = (value_to_align % page_size); value_to_align -= mod; if (mod > (page_size - mod)) { value_to_align += page_size; }Have you tried using this website? www.rooftopslushie.com It says you can get career advice and interview prep info from Nvidia employees.

### Software Systems Engineer at MITRE was asked...

Jul 14, 2009
 Please describe how to implement a function to print out a linked list backwards2 AnswersI outlined how to accomplish this in the C programming language, just watch out for basic stuff from your first computer science classes and software systems classes.iterate through the list and add the data onto a stack; then iterate through the stack and print..o(2n). alternatively you can write a recursive function that calls itself on the next element before printing its own element, but that has its own overheads.

### Systems Software Engineer at NVIDIA was asked...

Apr 27, 2012
 Implement memcpy.4 Answersvoid memcpy (int* dest, int* src, int length) { char* currSrc = (char*)src; char* currDest = (char*)dest; for(int i=0; iyou should care about how src and dest are overlapped, and copy from left or from right.void memcpy (void *dest, void *src, size_t length) { int *currSrc = src; int *currDest = dest; chat *charSrc, *chardst; size_t nTimes = length / sizeof(int) for(int i=0; iShow More Responsesvoid my_memcpy(void *dst, void *src, int size) { for(int i=0; i

### Systems Software Engineer at NVIDIA was asked...

Apr 1, 2012
 write a function to set a particular field of register to the desired value. ( For example, set bit 3 - 10 of a word to the given value)3 AnswersExample: Value=0x1234 Desired Bits are 0,1, 7 & 15 Desired value=0x8083Example: Value=0x1234 Desired Bits are 0,1, 7 & 15 Desired value=0x8083Have you tried using this website? www.rooftopslushie.com It says you can get career advice and interview prep info from Nvidia employees.

### Fluid Systems Software Engineer at SpaceX was asked...

Jul 22, 2014
 How would you lessen the pressure surge (water hammer) from a valve being closed?1 AnswerClose the valve more slowly or use an accumulator.

### Systems Software Engineer at NVIDIA was asked...

Apr 1, 2012
 Say the program you are running has stack overflow. You want to know when and where this happens, but you don't want to use debuggers, because they slow. How would you do this?3 AnswersManual Inspection or Ram dump should helpwrite a pattern to end of stack. uint32_t *StackPtr = (uint32_t *) 0x7FFFFFFF; //0x7FFFFFFFis end of stack *StackPtr = 0xDEADBEEF; A memory dump or a simple check in your code like will suffice if (*StackPtr != 0xDEADBEEF) { //Stack overflow }Align the stack memory at the end of a read only memory, this would cause an automatic err fatal

### Embedded Systems Software Engineer at MITRE was asked...

Dec 6, 2010
 When would you use inheritance (abstract vs interface in java), can you give an example.1 AnswerI gave the standard weather or something example and he commented that the answer was pretty standard.

### Systems Software Engineer at Akamai was asked...

Apr 16, 2015
 Q1: Find the common ancestor of two nodes in a binary tree (not binary search tree). Interviewers didn't know the complexity. Q2: Write echo client-server model. It is expected to know the signatures of the apis and the arguments passed in bind, listen, accept. Q3: Implement ringbuffer.2 AnswersQ1:Provided the first solution as mentioned in "Cracking the coding interview". Not the second one which is improving the solution by a constant factor. They asked for complexity, its O(n) as mentioned in the book. The reason is that you do n + n/2 + n/4...operations. Which adds to n( 1+ 1/2 + 1/4...) = 2n. The interviewers who were both seniors claimed this is exponential. Obviously confusing it with the 1 + 2 +3 + ...n = n(n+1)/2..On the feedback of my rejection i was told i had issues with complexity...some people..I think the key in generic questions like this is to be careful to cover the fundamentals, and to be familiar with all the followups so you're prepared for whatever they throw at you. Maybe do a mock interview with a Akamai Systems Software Engineering expert on PrepTick to get a real-world answer? They give lots of guidance and pro tips on how to deal with this kind of stuff. https://www.preptick.com/practice-interviews-swe

### Senior Systems Software Engineer at NVIDIA was asked...

Jun 16, 2010
 Find the words used in some text and report by word length and how often each word appears.1 AnswerParse list to obtain words, whether space/comma/linebreak delimiter ArrayList> where the word length will be the index of the ArrayList. HashMap will have key as the single word in text and the value will be an Integer as the counter for how many times the word appears.
110 of 182 Interview Questions

More