SDE1 Interview Questions
- 0of 0 votes
AnswersAnnosance problem. Like you are given a string and you have to find words starting with a vowel and move that each word untill next to the previous vowel word ..
- sonamist90 April 16, 2015 in United States| Report Duplicate | Flag | PURGE
Epic Systems SDE1 - -1of 1 vote
AnswersWell ordered string problem
- sonamist90 April 16, 2015 in United States| Report Duplicate | Flag | PURGE
Epic Systems SDE1 - 0of 0 votes
AnswersThe Jumper Game problem.
- sonamist90 April 16, 2015 in United States| Report Duplicate | Flag | PURGE
Epic Systems SDE1 - 0of 0 votes
AnswersI had my online test today. Do the careercup questions as they will really help you in your preparation.
- sonamist90 April 16, 2015 in United States
Q1. 2 numbers given . First no have to be divided into 2 halves such that the sum of its halves must be less than or equal to the second half. You have to find such 2 hal pairs which are as close to the second no.| Report Duplicate | Flag | PURGE
Epic Systems SDE1 - 3of 3 votes
AnswersGiven a dictionary that contains mapping of employee and his/her manager like this
- enok April 09, 2015 in United States
Dictionary<string, string> employees = new Dictionary<string, string>()
{
{ "A","C" },
{ "B","C" },
{ "C","F" },
{ "D","E" },
{ "E","F" },
{ "F","F" }
};
Write a function to get no of employees under each manager in the hierarchy not just their direct reports.
In the above dictionary the root node/ceo is listed as reporting to himself.
Output should be a Dictionary<string,int> that contains this
A - 0
B - 0
C - 2
D - 0
E - 1
F - 5| Report Duplicate | Flag | PURGE
Microsoft SDE1 Algorithm - 0of 0 votes
AnswersGiven an integer array with multiple repeated elements, print all distinct elements in array. O(n) c code/link??
- sharma.kamalkishor53 April 06, 2015 in India| Report Duplicate | Flag | PURGE
Student SDE1 Algorithm - 0of 0 votes
AnswersThe person who wrote this problem is going through the bad phase of his life. But, fortunately he won some cash in his last programming event.
- disasteryes April 05, 2015 in India
Now to make his girlfriend feel special, he wants to buy her some chocolates. As mentioned, he is not having good time so he want to spend as less as possible.
Keeping that in mind, he decided to play a game with her. The rule of game is as follows:
1) There are N chocolates represented by type 1..N
2) He will arrange them in a row in some random order
3) Now she (his girlfriend ofcourse) has to pick an index say i, then she will get all the chocolates at index j such that j>i and type of chocolate at j is strictly less than type of chocolate at index i.
He believes that his girlfriend is not that clever and will surely not choose the most optimal index, but he wants to know that if by any chance she picked the optimal index then how many chocolates will he have to buy.
Input:
First line contain N. then next line contain N space separated integers.
output :
A single integer which is the answer.
Constraints :
1 ≤ N ≤ 105
1<=A[i]<=10^5
Sample Input (Plaintext Link)
10
7 6 10 5 2 8 1 9 3 4
Sample Output (Plaintext Link)
7
Explanation
If she chooses i=3, then all the elements in right of i have type less than 10, hence ans is 7. In none of the other case she can get more chocolates.| Report Duplicate | Flag | PURGE
fd SDE1 Algorithm - 0of 0 votes
AnswersThere is a dictionary with few words each of length 3 and start and finish word is given. You can reach from one word to another word by changing only one digit. Like from cat, you can reach to hat or bat or cap. What is the minimum number of steps should be taken to reach finish word from start word
- topCoder March 15, 2015 in India| Report Duplicate | Flag | PURGE
Coupon Dunia SDE1 Algorithm - 0of 0 votes
AnswersGiven three arrays sorted in non-decreasing order, print all common elements in these arrays.
- topCoder March 15, 2015 in India
Examples:
ar1[] = {1, 5, 10, 20, 40, 80}
ar2[] = {6, 7, 20, 80, 100}
ar3[] = {3, 4, 15, 20, 30, 70, 80, 120}
Output: 20, 80
ar1[] = {1, 5, 5}
ar2[] = {3, 4, 5, 5, 10}
ar3[] = {5, 5, 10, 20}
Outptu: 5, 5| Report Duplicate | Flag | PURGE
Coupon Dunia SDE1 Algorithm Data Structures - 0of 0 votes
Answersquicksort takes O(n2) when elements are sorted what is the solution to reduce it to O(nlogn)?
- topCoder March 15, 2015 in India| Report Duplicate | Flag | PURGE
SDE1 Algorithm - 0of 0 votes
Answergiven a bst, convert it to a binary tree such that each element is replaced by the sum of all the elements greater than it+ its own sum?
- topCoder March 15, 2015 in India| Report Duplicate | Flag | PURGE
Coupon Dunia SDE1 Algorithm - 0of 2 votes
AnswersGiven an array of random integers and a sum value, find two numbers from the array that sum up to the given sum.
- shoryagupta1493 March 12, 2015 in United States for Amazon Fresh
eg. array = {2,5,3,7,9,8}; sum = 11
output -> 2,9
Implement in O(n) time complexity. Find all distinct pairs. (2,9) and (9,2) are not distinct.| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
AnswersWhat are the advantages of an array over a linked list? and vice versa.
- shoryagupta1493 March 12, 2015 in United States for Amazon Fresh| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 4of 4 votes
Answersin a tree any root can have any number of children. Every node has an integer value. Find the maximum length on consecutive number sequence anywhere in the tree. For example if root is 2 and one child is 3, its child is 4 its child is 6 then max length will be 3. I was able to write the code the find of one sequence but when one sequence ends and other starts I was not able to handle that case. I think its hard to do by recursion. Is there any other trick or algorithm for this??
- ajrules2105 March 10, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 Trees and Graphs - 2of 2 votes
AnswersLink all the level order nodes to makes a linked list with the first node of each level acting as the root of that linklist.
- catlover February 27, 2015 in India
10
/ \
6 17
/ / \
4 14 19
So the Linklist will be
10->null
6->17->null
4->14->19->null| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersYou have three containers, small, medium and large. Passenger comes in, checkin the luggage. You have to store the baggage in the appropriate container and generate a unique token number. Then passenger should get back the bag using the same token number. Trick was if small container is full store in medium if available or large. Now if the large bag comes in and there is now a empty space in small, than move the small bag back to small & store the large bag. How to generate the unique token number and move the baagage internally without changing the token number?
- catlover February 27, 2015 in India
Lookup should be in constant time complexity and insertion in minimum complexity.| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 1of 3 votes
AnswersNew CareerCup Android App!!!
- Nitin Gupta February 22, 2015 in United States
Hey Guys,
Lately I was trying to get android app for this website and no single app was good enough for me.
So I thought of developing it myself. After 2 weekends of work I released first version of the app. With lot more new features lined up.
Please download it here
https://play.google.com/store/apps/details?id=com.careercup
and give your reviews and ratings.
Thanks| Report Duplicate | Flag | PURGE
A9 SDE1 - 0of 0 votes
AnswersYour are given two strings str1 and str2, you have to generate another unique string str3, which can only generated by these two string str1 and str2, no other string can generate that string str3. Some later point you have to retrieve back those two string str1 and str2 form that unique string str3.
- neelabhsingh February 20, 2015 in India for Hyderabad| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
AnswersYou are given an array, you have to replace each element of the array with product of the rest element. Example: {1,2,3}==> {6,3,2}
- neelabhsingh February 20, 2015 in India for Hyderabad| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
AnswersSuppose you have an array with infinite numbers, which is sorted and there may be duplicates. Find the occurrence of a number.
- MM February 20, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersHow will implement an auto complete feature? Eg: if you type clo it shows clothes etc
- MM February 20, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersSuppose there are 2 streams, which has infinite value and write a method that returns a stream that would be a combination of both the streams in a sorted form
- MM February 20, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersWrite printf method.
- Nitin Gupta February 17, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 1of 1 vote
AnswersWhich is best Merge Sort or QuickSort?
- Nitin Gupta February 17, 2015 in India
Why and How?| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 1of 1 vote
Answers150 men are standing in a line heightwise. A blind man has to find where he should stand in the line and for that he has to find the first taller boy than him in the line. As he can't see he is allowed to ask any number of man the question : "Are you taller than me?". Answer can be Yes or No. But he is just allowed only two YESes (BUT there is not limit on number of NOs) as reply after that he is not allowed to ask any man. Calculate fewest number of men he'll require to ask question in the worst case possible.
- ankur February 15, 2015 in India
Options
1. 14
2. 17
3. 25
4. 33| Report Duplicate | Flag | PURGE
Snapdeal SDE1 Brain Teasers - 0of 0 votes
AnswersHow would you design a system to store the search history of your users?
- Ray February 14, 2015| Report Duplicate | Flag | PURGE
Adobe SDE1 System Design - 0of 0 votes
AnswersHow does Google know that you are who you say you are?
- Ray February 14, 2015 in United States| Report Duplicate | Flag | PURGE
Adobe SDE1 System Design - 0of 0 votes
AnswerHow would you design the search future in Google from frontend to backend?
- Ray February 14, 2015| Report Duplicate | Flag | PURGE
Adobe SDE1 System Design - 0of 0 votes
Answers(Variant of Children-Sum Problem better than O(n^2))
- Rahul Sharma February 08, 2015 in India
Given a tree, implement a function which replaces a node’s value with the sum of all its childrens’ value, considering only those children whose value is less than than the main node’s value.
Eg: input = 60->50->80->40 , output = 90->40->40->0| Report Duplicate | Flag | PURGE
Amazon SDE1 Coding - 0of 0 votes
AnswersFind if a given number can be expressed in the form of p^q, where p and q are integers
- xyz_coder February 06, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm Coding