Software Developer Interview Questions
- 0of 0 votes
AnswersProcess ID Arrival Time Burst
- D PRAVEEN KUMAR September 26, 2016 in India
P1 arrived at 0 and need10 units burst time, P2 is arrived at 1 and need 8 units of burst time, process P3 is arrived at 2 and need 6 units of burst time and process P4 arrived at 3 and need 4 units of burst time.
Assume that context switch takes one unit of time. Draw that gant chart and find the average waiting time, turnaround time using SJF scheduling.| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersFive jobs are waiting to be run. Their expected run times are 9, 6, 3, 5, and X . In what order should they be run to minimize average response time?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersProblem statement: You are given a maze with N cells. Each cell may have multiple entry points but not more than one exit (ie. entry/exit points are unidirectional doors like valves). The cells are named with an integer value from 0 to N-1. You need to find the following :
- sarthakbansal19 September 23, 2016 in India
Nearest meeting cell: Given any two cells - C1,C2, find the closest cell Cm that can be reached from both C1 and C2.
Note: Aim for O(Log(N)) solution.
INPUT FORMAT - First line has the number of cells N
Second line has list of N values of the edge[] array. edge[i] contains the cell number that can be reached from of cell ‘i’ in one step. edge[i] is -1 if the ‘i’th cell doesn’t have an exit.
Third line contains two cell numbers whose nearest meeting cell needs to be found. (return -1 if there is no meeting cell from the two given cells) .
OUTPUT FORMAT - Find nearest meeting cell (NMC).| Report Duplicate | Flag | PURGE
Juspay Software Developer Data Structures - 0of 0 votes
AnswersProblem statement: You are given a maze with N cells. Each cell may have multiple entry points but not more than one exit (ie. entry/exit points are unidirectional doors like valves). The cells are named with an integer value from 0 to N-1. You need to find the following :
- sarthakbansal19 September 23, 2016 in India
find Maximum number of entry points (incoming edges) for any cell in the maze
Note: Aim for O(N) solution.
INPUT FORMAT - First line has the number of cells N
Second line has list of N values of the edge[] array. edge[i] contains the cell number that can be reached from of cell ‘i’ in one step. edge[i] is -1 if the ‘i’th cell doesn’t have an exit.
OUTPUT FORMAT - Find max entry points in any cell.| Report Duplicate | Flag | PURGE
Juspay Software Developer Data Structures - 0of 0 votes
AnswersProblem statement: You are given a maze with N cells. Each cell may have multiple entry points but not more than one exit (ie. entry/exit points are unidirectional doors like valves). The cells are named with an integer value from 0 to N-1. You need to find the following :
- sarthakbansal19 September 23, 2016 in India
The length of the largest cycle in the maze. Return -1 if there are no cycles.
Note: Aim for O(N) solution.
INPUT FORMAT - First line has the number of cells N
Second line has list of N values of the edge[] array. edge[i] contains the cell number that can be reached from of cell ‘i’ in one step. edge[i] is -1 if the ‘i’th cell doesn’t have an exit.
OUTPUT FORMAT - length of the largest cycle.| Report Duplicate | Flag | PURGE
Juspay Software Developer Data Structures - 0of 0 votes
AnswersSuppose there is a social networking site like Facebook. Every user gets some friend recommendations (i.e. People you may know!). Now, if there is a user A and he has 100 friends and each of his friends has got 5 other friends,A can get these 500 recommendations. But the condition is that he should only get the top 10 recommendations with whom he has the maximum number of mutual friends(If A and B are friends and B and C are friends, then A and C have a mutual friend, B). Suggest an efficient data structure for this and how to implement it. The implementation should be flexible as at any moment, any user can make new friends and he may also unfriend someone!
- manidam07 September 19, 2016 in India| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm - 0of 2 votes
Answershttp://www.geeksforgeeks.org/find-water-in-a-glass/
- vgupta.2119 September 18, 2016 in India| Report Duplicate | Flag | PURGE
Google Software Developer - 2of 4 votes
AnswersFind the minimum of every sub-array of size k in an array of size n.
- vgupta.2119 September 18, 2016 in India
O(n) solution required.| Report Duplicate | Flag | PURGE
Google Software Developer - -1of 1 vote
Answershttp://www.geeksforgeeks.org/find-water-in-a-glass/
- vgupta.2119 September 18, 2016 in India| Report Duplicate | Flag | PURGE
Google Software Developer - 1of 3 votes
AnswersFind the minimum of every sub-array of size k in an array of size n.
- vgupta.2119 September 18, 2016 in India
O(n) solution required.| Report Duplicate | Flag | PURGE
Google Software Developer - -1of 1 vote
AnswersSearching for a string in a DOM tree. A complete working solution was required. Assume you have any string matching algorithm available.
- vgupta.2119 September 18, 2016 in India
(Based on Ctrl+F search in chrome)| Report Duplicate | Flag | PURGE
Google Software Developer Algorithm - -1of 1 vote
AnswersSearching for a string in a DOM tree. A complete working solution was required. Assume you have any string matching algorithm available.
- vgupta.2119 September 18, 2016 in India
(Based on Ctrl+F search in chrome)| Report Duplicate | Flag | PURGE
Google Software Developer Algorithm - 1of 1 vote
AnswersGiven a directed graph G, duplicate the graph using minimum space.
- vgupta.2119 September 18, 2016 in India| Report Duplicate | Flag | PURGE
Google Software Developer Algorithm - 0of 0 votes
AnswersHow to find total number of greater number after all number in an array ?
- rahulkumar5july September 18, 2016 in India
Eg. Given array is,
5 3 9 8 2 6
o/p
3 3 0 0 1 0| Report Duplicate | Flag | PURGE
Walmart Labs Software Developer - 1of 1 vote
AnswerYou are given a list of tasks as an integer array, task_costs. Every i-th element of task_costs represents a task and requires task_costs[i] seconds to complete. All tasks listed in the array are independent of other tasks.
- Abhishek.Mathur.CA September 18, 2016 in United States
It is required to finish all the tasks independently and as soon as possible. You are given a single worker robot to start taking the tasks and finish them one at a time. However if you like, you can divide the worker robot in two. Each resulting robot can then be further divided into two and so on. There is a cost, in seconds, of dividing a robot in two, represented by robot_divide_cost.
You can assign an independent task to any available robot, however you can't interrupt or divide a robot while it is working on the assigned task. At the same time you can't assign a task to any robot while its in the process of getting divided.
To keep things simple you can't allow multiple robots to work on the same task. At any given time only one robot can work on a task and finish it. Once any particular robot finishes a task it can't be assigned any further tasks.
Given a list of tasks and cost of dividing a robot, find the least amount of time to finish all tasks.
Input:
3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,360,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600,3600
3600
Expected Output: 25200
Input:
1113,773,824,822,1458,1257,908,1320,780,1016,1066,861,1150,718,1405,738,718,980,1037,946,1121,1349,805,1378,1308,1272,1532,779,875,1392,982,1282,744,723,1033,1067,1158,1071,742,683,678,762,686,1143,862,1231,765,1472,1560,1085
3147
Expected Output: 20040| Report Duplicate | Flag | PURGE
unknown Software Developer - 0of 0 votes
AnswersGiven an array of numbers find the duplicates
- andy.r.nathan September 14, 2016 in United States for Mobile| Report Duplicate | Flag | PURGE
Linkedin Software Developer Algorithm - 1of 1 vote
AnswersSuppose you have a list of Dishes, where each dish is associated with a list of ingredients. Group together dishes with common ingredients.
- andy.r.nathan September 14, 2016 in United States for Mobile
E.g:
Input:
"Pasta" -> ["Tomato Sauce", "Onions", "Garlic"]
"Chicken Curry" --> ["Chicken", "Curry Sauce"]
"Fried Rice" --> ["Rice", "Onions", "Nuts"]
"Salad" --> ["Spinach", "Nuts"]
"Sandwich" --> ["Cheese", "Bread"]
"Quesadilla" --> ["Chicken", "Cheese"]
Output: ("Pasta", "Fried Rice") ("Fried Rice, "Salad") , ("Chicken Curry", "Quesadilla") ("Sandwich", "Quesadilla")
Follow up: What is the time and space complexity?| Report Duplicate | Flag | PURGE
Linkedin Software Developer Algorithm - 0of 0 votes
Answerhow to create a de-duplication engine that acts as a file storage, retrieval, and handling system. It must take some files as inputs, take data from it in chunks of 8 byte size and store it in some efficient data structure of our choice. The data structure should be robust and must not store duplicate chunks. Instead, it has to make a reference to the original chunk that is repeated.
- smtkpr88 September 11, 2016 in India| Report Duplicate | Flag | PURGE
Coupon Dunia Software Developer unix system programmin - 0of 0 votes
AnswersDesign a HTTP response service that will allow sync and async download. What classes would you create and the methods used with paramerters and return types.
- MM September 10, 2016 in United States| Report Duplicate | Flag | PURGE
Facebook Software Developer Object Oriented Design - 2of 2 votes
Answers[redacted]
- tohhubeta September 02, 2016 in United States| Report Duplicate | Flag | PURGE
Google Software Developer Algorithm - 1of 1 vote
AnswersGiven a sparse matrix, implement below two methods:
- starlord September 01, 2016 in United States
void set(int row, int col, int val) /*Update value at given row and col*/
int sum(int row, int col) /*give sum from top left corner to given row, col sub-matrix*/| Report Duplicate | Flag | PURGE
Google Software Developer Algorithm - 1of 1 vote
AnswersA company is looking for algorithm to show item recommendations.
- maksymas August 29, 2016 in United States
If a customer bought A and B items and another buys A item, B should come as recommendations.
There are two types of recommendations based on the connections
1) Two items are strongly connected if a customer buys those items.
2) Two items are weakly connected if each items are strongly/weakly connected to another third item.
Provided the sample input
ABC
10
first:ABC
first:HIJ
sec:HIJ
sec:KLM
third:NOP
fourth:ABC
fourth:QRS
first:DEF
fifth:KLM
fifth:TUV
first, sec, third.. represents the customer names
ABC, HIJ... represents the item codes
For the Input item Id "ABC", since "ABC" is strongly connected to HIJ, DEF, QRS
and whereas ABC is weakly connected to KLM and TUV
the output should be count of strong and weak connection i.e., [3,2]| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm - -5of 5 votes
Answersinterview would be easy. For freshers it would be okay
- magesh215 August 17, 2016 in India
for experienced no salary hike is available| Report Duplicate | Flag | PURGE
Nanosoft Technologies - Chennai Software Developer - 0of 2 votes
Answerpair programming example question with code for thoughworks interview
- rahulgoyal030 August 16, 2016 in India| Report Duplicate | Flag | PURGE
ThoughtWorks Software Developer C++ - -2of 2 votes
AnswersDesign unix file system in database.
- mohit.kum85 August 16, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Database - 0of 0 votes
AnswersSuggest a data structure and implement efficient phrase search along with word search in a huge chunk of text.
- novicedhunnu August 14, 2016 in India for N/A| Report Duplicate | Flag | PURGE
Microsoft Software Developer Trees and Graphs - 2of 2 votes
AnswersThere are n+1 loading docks. a permutation of boxes 1->n is placed on the first n. there is a fork that can move one box to an empty location at a time. Give an algorithm to sort then boxes with minimum number of moves.
- ad09 August 05, 2016 in United States
Follow up: minimum distance| Report Duplicate | Flag | PURGE
Google Software Developer Algorithm - 0of 0 votes
AnswersGiven a dictionary and a string, find all the substrings that are valid words in dictionary.
- Pedro July 28, 2016 in United States
I was thinking of a Trie solution but I'm not sure a Trie will work easily to match sub words that begin in the middle of the string.| Report Duplicate | Flag | PURGE
Google Software Developer Algorithm - 0of 0 votes
AnswersGiven an array: 1,2,3 ,5,8,7,6,9,5,7,3,0,5
- sindhu1690 July 27, 2016 in United States
subarry:5,7
Find the subarray in the large array and return the minimum length and index where you can find the subarray. Note: that the subarray may be present in the large array non-contiguous.
In the above case : the answer is length = 2 and
index = 8| Report Duplicate | Flag | PURGE
Microsoft Software Developer Algorithm - 0of 0 votes
AnswersAn unsorted array is given . Find the no of greater elements on right side on current element in array. Find this for every element of array Expected time complexity is lesser then O(n^2)
- knocks July 24, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm
Open Chat in New Window