Find jobs for software development engineer

software development engineer Interview Questions

18K

software development engineer interview questions shared by candidates

Top Interview Questions

Sort: Relevance|Popular|Date
Amazon
Software Development Engineer was asked...29 February 2012

Given a string "aaabbbcc", compress it, = "a3b3c2" . Given that output string's length is always smaller than input string, you have do it inplace. No extra space

29 Answers

#include #include #include #define STR_SIZE 26 int main() { /* Current char sequence tracker */ char *c = NULL; char *b = NULL; char *str = (char*)malloc(STR_SIZE * sizeof(char)); if(NULL == str) return -1; memcpy(str, "aaaabbbcceeeeefffffff", 26); b = c = str; printf("Input: %s\n", b); while(*str) { if(*(str+1) != *str) // Repeat sequence ends { // Add 48 so the count gets printed as a char *(c+1) = ((str-c+1)+48); // Updated count, copy rest of the string starting after the count position memcpy(c+2, str+1, strlen(str)); // Update c to point to the new char repeat sequence c = c+2; } str++; } /* b was initialized to point to str up top, proving it was done in place */ printf("Output:%s\n", b); free(b); b = NULL; return 0; } Less

Rohan: What if I give you the string "aaaaaaaaaa"? Your solution will print "a:", not "a10". Less

What about the input "abc"? I assume that should compress to "a1b1c1" which is NOT shorter than the input, so you cannot compress in place. Less

Show More Responses
Microsoft

how would you move mount fuji?

27 Answers

I would first answer with, "First, I would analyze the problem and determine if it didn't make better sense to come to the mountain rather than move the mountain. Assuming that's not feasible..." I think that's a key element they're looking for in an answer. That you can look at a major task and first identify if there isn't a better approach. The next element is to determine how you would go about completing a seemingly impossible or gargantuan task. The specifics of this part of the answer don't matter other than to show that you have an understanding that huge problems need to be broken down into smaller, more manageable tasks using the resources you have. Less

When they ask a quesion like this at MS, they do want an answer. If you tell them that you want to consider alternatives up front, they will wave that off and tell you that, in this hypothetical situation, alternatives were already considered and that moving the mountain is the approach was chosen. They really want you to answer the question. The point of this question is - process. They want to see what process you use to solve problems. It is important to show that you solve the problem not by arranging and re-arranging a series of random thoughts but that you can approach it methodically and that this methodology can be applied to any problem. Do not to to some up with a clever answer that attempts to solve the problem - they will just keep insisting that you tackle the problem. If you don't, you won't pass the interview. So, brush up on your problem solving process before you interview at MS. Use these questions as an opportunity to impress them with how well you can solve difficult problems. Less

This is a common dorky Computer Science joke. The answer I believe they are looking for is that you use the Tower of Hanoi algorithm to move the mountain (i.e. that the problem of moving Mt. Fuji is reducible to the already-solved Tower of Hanoi problem). This could be accomplished by having a large laser and a couple of really good cranes. Less

Show More Responses
Amazon

non disclosure agreement

18 Answers

I don't actually know. I mean, that's what I would do if I were amazon, but I did not read anything about them webcamming me, and I also didn't happen to notice the webcam light being on. That didn't mean it didn't happen, though. Less

I took the test in c++. The function interfaces were in base c, though, so it would probably look more or less identical in c or java. Less

Hi, I just finished my second assessment test for Amazon and passed all their tests for the 2 coding questions. Was the second test really the final round? There isn't a final third round? Thanks! Less

Show More Responses
Amazon

What was one of your best achievements on a project in the past?

18 Answers

From what i've heard and seen, just wait, following up will barely do you any good. Less

Hey, I just have one question out of curiosity, was the second online assessment web-cam proctored? Less

i heard amazon is changing their recruiting process. Many people complained that the online proctoring was an invasion of their privacy. I also had a second online assessment but it was not webcam proctored. I am assuming the recruiting process is now two online non webcam assessments then a final phone interview. My friend had that round of interviews with Amazon 2 weeks ago. Less

Show More Responses
Amazon

DS, Algorithms.

18 Answers

Review Leetcode, CTCI.

Hi, did you interview on Jan 27? Did the engineer ask about behavioral questions or resume questions or did they just jump right into the coding questions? Also I finished my second assessment a week ago but still didn't get a reply back. Was that normal for you? Less

Hi, did you interview on Jan 27? Did the engineer ask about behavioral questions or resume questions or did they just jump right into the coding questions? Also I finished my second assessment a week ago but still didn't get a reply back. Was that normal for you? Less

Show More Responses
Amazon

Discussed online assessment.

17 Answers

The recruiter called me yesterday and informed me that they are no longer gonna recruit new college grads for SDE positions because they already have enough. She told that they are done with 2017 and 2018 recruitment. This was through University Programs. I was invited for an onsite and then revoked. It was a little annoying because they waited 2 weeks to inform me this (that too on a Friday eve!) I spent the 2 weeks preparing for this one, when I could have given Twitter. But again, I am nothing and they are people of power, so what I feel doesn't matter! Less

Did you try contacting the recruiter? How did your interview go?

Yes i did tried to contact recruiter.. no response back. Did you get any response ? Less

Show More Responses
Microsoft

Given a set of numbers -50 to 50, find all pairs that add up to a certain sum that is passed in. What's the O notation for what you just wrote? Can you make it faster? Can you find an O(n) solution? Implement the O(n) solution

16 Answers

Put all the numbers from the array into a hash. So, keys will be the number and values of the keys be (sum-key). This will take one pass. O(n). Now, foreach key 'k', with value 'v': if k == v: there is a match and that is your pair. this will take another O(n) pass totale O(2n) ~ O(n) Less

Easiest way to do it. Written in python. If you consider the easiest case, when our summed value (k) is 0, the pairs will look like -50 + 50 -49 + 49 -48 + 48 etc.... etc... So what I do is generalize the situation to be able to shift this k value around. I also allow us to change our minimums and maximums. This solution assumes pairs are commutative, i.e. (2, 3) is the same as (3, 2). Once you have the boundaries that you need to work with, you just march in towards k / 2. This solution runs in O(n) time. def pairs(k, minimum, maximum): if k >= 0: x = maximum y = k - maximum else: x = k + maximum y = minimum while x >= k / 2 and y <= k / 2: print str(x) + " , " + str(y) + " = " + str(x + y) x = x - 1 y = y + 1 Less

here is my solution using hash table that runs in O(2n) => O(n): public static String findNums(int[] array, int sum){ String nums = "test"; Hashtable lookup = new Hashtable(); for(int i = 0; i < array.length; i++){ try{ lookup.put(array[i], i); } catch (NullPointerException e) { System.out.println("Unable to input data in Hashtable: " + e.getMessage()); } } int num2; int num1; for (int i = 0; i < array.length; i++){ num2 = sum - array[i]; Integer index = (Integer)lookup.get(num2); if ((lookup.containsKey(num2)) && (index != i)){ num1 = array[i]; nums = array[i] + ", and " + num2; return nums; } } //System.out.println(lookup.get(-51)); return "No numbers exist"; } Less

Show More Responses
Amazon

Most of them were expected. Almost all are problem solving questions. 1. Given a BST with following property find the LCA of two given nodes. Property : All children has information about their parents but the parents do not have information about their children nodes. Constraint - no additional space can be used

15 Answers

function findLCA(Node node1, Node node2) { int counter1 = 0; int counter2 = 0; Node temp; //Find the level for each node, use a temp node to //traverse so that we don't lose the info for node 1 and node 2 temp = node1; while( temp.parent ! = null) { temp = temp.parent; counter1++; } temp = node2; while( node2.parent ! = null) { node2 = node2.parent; counter2++; } /* * We wanna make them at the same level first */ if(counter1 > counter2) { while(counter1 != counter2) { node1 = node1.parent; counter1--; } } else { while(counter2 != counter1) { node2 = node2.parent; counter2--; } } while (node1.parent != node2.parent) { node1 = node1.parent; node2 = node2.parent; } System.out.println("Found the LCA: " + node1.parent.info); } Less

//correction temp = node2; while( temp.parent ! = null) { temp = temp.parent; counter2++; } Less

Consider this is a BST, where max node is always on the right of min node, we can traverse max upward one node at a time while comparing min nodes as it traverse upward toward root. BinaryNode findBSTLCA( BinaryNode min, BinaryNode max ) { BinaryNode tempMax = max; BinaryNode tempMin = min; while( tempMax != null ) { while( tempMin != null ) { if( tempMin.element == tempMax.element ) return tempMin; tempMin = tempMin.parent; } tempMin = min; // reset tempMin tempMax = tempMax.parent; // traverse tempMax upward 1 node } return null; // no LCA found } Less

Show More Responses
Amazon

Write an algorithm to determine if 2 linked lists intersect

15 Answers

I don't understand why we would need extra space for this problem. If two linked list intersects, that means their end are the same. Traverse until the end of both list and check if the address of the last nodes are the same. Less

@Ja, Your example doesn't really make sense: how can the node with value 6 point to a node with value 7 AND a node with value 8? It can only point to one node: either 7 or 8. That's why I think Anonymous' answer is correct. Less

1) len1=find length of linkedlist1 2) len2 =find length of linkedlist2. 3) move the bigger linked list to (len1-len2) position. 4) rightnow both linked lists are equal at distance from last node. that is they are n node away last node. 5) iterate both LL simulatenously and if they have same instance that is their intersection point. Less

Show More Responses
Wipro

Why do you want to join Wipro ? and please don't give me crap answers !

13 Answers

because its starting of my carrier and i have interest in this field and this is the better platform to boost up my carrier and its true that it gives better salary also ..................thanks and regards Less

because, its good company and attractive salary,...

2 fullfill my dreams

Show More Responses
Viewing 1 - 10 of 17,849 Interview Questions