Senior Software Development Engineer Interview Questions
- 1of 1 vote
AnswersImplement cycle detection for a spreadsheet with the characteristics outline below. Your solution should include working data structures to represent the spreadsheet and operate on a "entire" spreadsheet to indicate which cells have circular dependencies.
- thejediknight May 23, 2015 in United States
Spreadsheet
The spreadsheet is a collection of cells within a 2-D space of columns and rows. Columns are defined with a letter and rows are defined by a number. You can assume an upper limit of 26 columns for simplicity.
Cell values are either a number (long or double) or an expression containing numbers, operators, and references to other cells (i.e. B2 means the second column [B] and second row [2]). You can ignore the parsing of expressions for this exercise. Instead, your solution can define the data you will work with after expressions have been parsed.
Cycles
A cycle occurs when a cell refers to itself either directly or indirectly via an expression.| Report Duplicate | Flag | PURGE
Netflix Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersYou have a coffee shop with say, a 1000 flavors of coffee. You always face a customer query asking for a certain number of coffee flavors that are closest matches to what they are drinking. Write a function which would take a coffee flavor and find a certain
- thejediknight May 23, 2015 in United States
number of closest flavor matches in terms of flavor.| Report Duplicate | Flag | PURGE
Groupon Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersYou have a requirement where a user searches for a search term, which could be say, the title of a movie
- thejediknight May 23, 2015 in United States
and you need to find the title and then show a description of the movie. How would you implement it. Describe the data structures used. If you were going to host this service on a single machine with 250 MB of RAM while you need to handle, say 10 GB of data, how would you do this?| Report Duplicate | Flag | PURGE
Groupon Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersThere are N pots. Every pots has some water in it. They may be partially filled . Every pot is associated with overflow number O which tell how many minimum no. of stones required for that pot to overflow. The crow know O1 to On(overflow no. for all the pots). Crow wants some K pots to be overflow. So the task is minimum number of stones he can make K pots overflow in worst case.
- sas.rockks May 05, 2015 in India
Array of overflow no--. {1,...On}
Number of pots--n
No of pots to overflow-- k
Let say two pots are there with overflow no.s {5,58}, and crow has to overflow one pot(k=1). So crow will put 5 stones in pot with overflow no.(58), it will not overflow, then he will put in pot with overflow no.(5), hence the total no. of stones to make overflow one pot is=10.
What are the best algorithm to do it?| Report Duplicate | Flag | PURGE
Samsung Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersImplement a program to reverse the linear linked list in pairs. it should handle both even number of nodes and odd number of nodes. if odd number of nodes, the last node will be the last node after reversion.
- panchadi520 April 27, 2015 in India
Do not move the data in the nodes. Do manipulate node pointers/references. the nodes themselves need to be manipulated, not just the data in the nodes.
For example, if the initial linear linked is,
1->2->3->4->5
after reverse it should be,
2->1->4->3->5| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Data Structures - 1of 1 vote
AnswersImplement a function that checks if the given binary tree is binary search tree(BST). Use tree operations to solve this. do not try solving by pre-order traversal of the tree and then checking if the array is sorted.
- panchadi520 April 27, 2015 in India
instead, traverse the tree for checking if it is BST.| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Data Structures - 0of 2 votes
AnswersWrite a function that takes two arguments one array of integers that ranges between 0 and 9 and second the target sum(again integer). It produces all permutations strings of the input digits that equals the target sum.
- panchadi520 April 27, 2015 in India
For example, if input is array 2, 3, 5 and target sum is 10, then the output should be:
22222 because 2+2+2+2+2 = ,10
2323 as 2+3+2+3 = 10
3232
55
2233
3322
532
235
352
etc.,| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Data Structures - -1of 3 votes
AnswersWrite a function which returns the number of times the digit "1" appears in a number which is generated from raising 11 to the Nth power where N is passed in as an input parameter. The range of N is 0 to 1,000.
Be sure to unit test your solution.
For instance, If N is 3, the number is 1331 and the function returns 2.
If N is 5, the function returns 3.
If N is 10, the function returns 1 and so on.public int solution(int N) { ... }
You have 30 minutes to complete the problem.
- robertlaub April 17, 2015 in United States| Report Duplicate | Flag | PURGE
iCIMS Senior Software Development Engineer Java - 1of 1 vote
AnswerThis is design question. Starts with small data size and then goes with bigger data size
- um01 March 04, 2015 in United States
Design an application to retrieve the value for a key as fast as possible. The data given to you doesnt change.
You are given a data file of 1GB. Its key value data with key being bytes[]. What would be your application design.
Now assume the data set is 1 TB or greater how would you change your application design.(Distributed is a possibility).
Now assume the keys are very small. What are your optimizations.| Report Duplicate | Flag | PURGE
LiveRamp Senior Software Development Engineer System Design - 0of 0 votes
AnswersYou are given a list of strings
- rao January 28, 2015 in United States for Legal
/flapp/server/apache
/d/apps
/d/apps/pub
/flapp
/flocal/firms
/d/sw/java
/d/sw/orcl/jdbc
The filtered strings shoud be
/flapp
/d/apps
/d/sw/java
/d/sw/orcl/jdbc
/flocal/firms
You have to identify the problem/requirement and provide solution that can work for any input with similar pattern.| Report Duplicate | Flag | PURGE
Thomson Reuters Senior Software Development Engineer Algorithm Java Puzzle - -1of 1 vote
AnswersIt started with simple behavioral questions like, why facebook, cultural fit questions etc. They asked simple question.
You are at latest version of committed code. assume one branch of code. Code version is in sorted order. It is corrupted with bug. You have fun isBug(VerNumber) which returns True or False. Find the version in which bug was introduced?
This can be solved with linearly checking each version or modified binary search. Person asked to write test cases? This is where i struggled. how do you write test case for this question? Do you guys use framework syntax or something else?
- anonymous January 22, 2015 in India| Report Duplicate | Flag | PURGE
Facebook Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersGiven row on N house, each is marked either R or B. And each house having some gems. You have to collect gems from these house with some constraint:
- SK January 21, 2015 in India
You can choose gems from any blue house but you have to choose even number of red house ( either from 2 Red houses or from 4 red houses)
each time you take gem from one house, you will multiply gems received with gems currently, you have.
You have to choose continuous houses.
You have to return start point and end point of house (remember this should be continuous )| Report Duplicate | Flag | PURGE
Directi Senior Software Development Engineer Algorithm - 5of 5 votes
Answersyou have given array of Size N and two numbers M, K. K is size of subarray and M is count of subarray.
- SK January 21, 2015 in India
You have to return sum of max M subarray of size K (non-overlapping)
N = 7, M = 3 , K = 1
A={2 10 7 18 5 33 0} = 61 — subsets are: 33, 18, 10 (top M of size K)
M=2,K=2
{3,2,100,1} = 106 - subsets are: (3,2), (100,1) 2 subsets of size 2| Report Duplicate | Flag | PURGE
Directi Senior Software Development Engineer Algorithm Dynamic Programming - 0of 0 votes
AnswersHow can I represent the following in a data structure ?
- Andy January 05, 2015 in United States
<html><body><div><span>TEXT1</span><br/></div></body></html>
Do I do the same using a stack or create a tree for the same ?| Report Duplicate | Flag | PURGE
Google Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersGiven an array A and an array B. Sort all the elements of A in the order of B. Sort the remaining elements.
- Guest December 05, 2014 in India
e.g.
A = {4,2,7,6,8,9,1,3,2,5,6}
B = {6,3,4,1}
Output= {6,6,3,4,1,2,3,5,7,8,9}| Report Duplicate | Flag | PURGE
Monotype Senior Software Development Engineer Arrays - 0of 0 votes
AnswersCheck if 2 link lists merge or not. If yes, return the 1st common node.
- Guest December 05, 2014 in India| Report Duplicate | Flag | PURGE
Monotype Senior Software Development Engineer Data Structures - 1of 1 vote
AnswersCheck if an integer is a power of 2 or not.
- Guest December 05, 2014 in India| Report Duplicate | Flag | PURGE
Monotype Senior Software Development Engineer Bit Manipulation - 0of 0 votes
AnswerInput a matrics, print the elements one by one:right->left down->left->up. The 1st line is the matrics size, then follows the matrics elements. Ex:
- Cory.Xie December 01, 2014 in China
5 3
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
First loop:
starts from the top left '1';
1: to right, print 1,2,3,4,5
2: to left down, print 9,13
3: to left, print 12,11
4: to up, print 6 ('1' has been print, ignore)
Second round:
1: to right, print 7,8
2: no more elements to print
So the elements should be:
1,2,3,4,5,9,13,12,11,6,7,8| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer - 0of 0 votes
AnswerImplement algo for ls command in unix. You have n ordered file names with you. You have to print file names in column then in rows.
- darklight November 24, 2014 in India
e.g. I have 5 files
F1 F3 F5
F2 F4
Minimize on number of rows
Maximize on number of columns
Max Page Width possible P
Page width of any row = max width of all files in first column + max width of all files in second column + ... +max width of all files in last column| Report Duplicate | Flag | PURGE
Boomerang Commerce Senior Software Development Engineer Algorithm Android - 1of 1 vote
AnswersAsked at Walmart Labs
- ayaskant.swain November 04, 2014 in India for R&D
----------------------------------
There is a row of seats. Assume that it contains 15 seats adjacent to each other. There is a group of people who are already seating in that row randomly. i.e. some are sitting together & some are scattered.
Take the row as a String in java.
The seat which is occupied is marked with a character 'X' & which is not occupied is marked with a dot '.'
Now your target is to make the whole group sit together i.e. next to each other and without having any vacant seat between them in such a way that the total number of hops or jumps at the end of the grouping them together should be minimum.
Ok let me try to explain you in details.
Here is the row having 15 seats represented by the String (0, 1, 2, 3, ......... , 14) -
. . . . x . . x x . . . x . .
Now to make them sit together one of approaches is - . . . . . . x x x x . . . . .
Following are the steps to achieve this -
1 - Move the person sitting at 4th index to 6th index - Number of jumps by him = (6 - 4) = 2
2 - Bring the person sitting at 12th index to 9th index - Number of jumps by him = (12 - 9) = 3
------------------------------------------------------------------------------------------------------------------------------------------------------------
So now the total number of jumps made = ( 2 + 3) = 5 which is the minimum possible jumps to make them seat together.
There are also other ways to make them sit together but the number of jumps will exceed 5 & that will not be minimum.
For example bring them all towards the starting of the row i.e. start placing them from index 0. In that case the total number of jumps will be ( 4 + 6 + 6 + 9 ) = 25 which is very costly and not an optimized way to do this movement.
Now write an algorithm which will return the minimum number of jumps required to make them sit together.| Report Duplicate | Flag | PURGE
Walmart Labs Senior Software Development Engineer Algorithm - 0of 0 votes
Answersfind out the subset of an array of continuous positive numbers from a larger array whose sum of of the elements is larger in comparision to other subset. eg: {1,2 5 -7, 2 5} .The two subarrays are {1,2,5} {2,5} and the ans is {1,2, 5} as its sum is larger than{2,5}
- hydabckumar October 04, 2014 in India| Report Duplicate | Flag | PURGE
makemytrip Senior Software Development Engineer Arrays - 6of 6 votes
AnswersComponents of computer systems often have dependencies -- other components that must be installed before they will function properly. These dependencies are frequently shared by multiple components. For example, both the TELNET client program and the FTP client program require that the TCP/IP networking software be installed before they can operate. If you install TCP/IP and the TELNET client program, and later decide to add the FTP client program, you do not need to reinstall TCP/IP.
- Byll September 26, 2014 in United States
For some components it would not be a problem if the components on which they depended were reinstalled; it would just waste some resources. But for others, like TCP/IP, some component configuration may be destroyed if the component was reinstalled.
It is useful to be able to remove components that are no longer needed. When this is done, components that only support the removed component may also be removed, freeing up disk space, memory, and other resources. But a supporting component, not explicitly installed, may be removed only if all components which depend on it are also removed. For example, removing the FTP client program and TCP/IP would mean the TELNET client program, which was not removed, would no longer operate. Likewise, removing TCP/IP by itself would cause the failure of both the TELNET and the FTP client programs. Also if we installed TCP/IP to support our own development, then installed the TELNET client (which depends on TCP/IP) and then still later removed the TELNET client, we would not want TCP/IP to be removed.
Write a program to automate the process of adding and removing components. To do this we will maintain a record of installed components and component dependencies. A component can be installed explicitly in response to a command (unless it is already installed), or implicitly if it is needed for some other component being installed. Likewise, a component, not explicitly installed, can be explicitly removed in response to a command (if it is not needed to support other components) or implicitly removed if it is no longer needed to support another component.
I found a reference to this problem online.. Check this for i/o details. This is the exact same problem
http://www.cs.cornell.edu/Info/Courses/Spring-98/CS211/assgts/assgt3/assgt3.pdf| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersWrite a program to find first 20 elements with high density
- you.win September 26, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer - 1of 1 vote
Answers/* In "the 100 game," two players take turns adding, to a running
- you.win September 24, 2014 in United States for Mobile
total, any integer from 1..10. The player who first causes the running
total to reach or exceed 100 wins.
What if we change the game so that players cannot re-use integers?
For example, if two players might take turns drawing from a common pool of numbers
of 1..15 without replacement until they reach a total >= 100. This problem is
to write a program that determines which player would win with ideal play.
Write a procedure, "Boolean canIWin(int maxChoosableInteger, int desiredTotal)",
which returns true if the first player to move can force a win with optimal play.
Your priority should be programmer efficiency; don't focus on minimizing
either space or time complexity.
*/
Boolean canIWin(int maxChoosableInteger, int desiredTotal) {
// Implementation here. Write yours
}| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersCheck if tree is BST.
- newbee September 24, 2014 in United States| Report Duplicate | Flag | PURGE
Samsung Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersWe have a char array and we need to reverse it. say Char Array is “Northern California USA”, need to print “USA California Northern”. Can’t use any other data structures or buffer. Can only use a char temp.
- newbee September 24, 2014 in United States| Report Duplicate | Flag | PURGE
Samsung Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersFind the kth minimum element into binary search.
- newbee September 24, 2014 in United States| Report Duplicate | Flag | PURGE
Samsung Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersWe have array of strings. Go through each element of array and eliminate duplicates if any string is having. You have to save in the same array.
- newbee September 24, 2014 in United States| Report Duplicate | Flag | PURGE
Samsung Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersWhat is the diffenrce between join() and wait()?
- newbee September 17, 2014 in United States
What is sleep(). Which method releases the lock?| Report Duplicate | Flag | PURGE
Intuit Senior Software Development Engineer Java - 0of 0 votes
AnswerHow can we implement asynchronous call in Java? Say I want to query Google but don’t want to use all the urls want to use later. How can we do that?
- newbee September 17, 2014 in United States| Report Duplicate | Flag | PURGE
Intuit Senior Software Development Engineer Java