MTS Interview Questions
- 0of 0 votes
AnswersImplement a fair mutex
- neer.1304 July 09, 2019 in United States| Report Duplicate | Flag | PURGE
Nutanix MTS System Design - 0of 0 votes
AnswersTwo very very large files F1, F2 containing key, value pairs. Write these key, values to a third file without any duplicates.
- neer.1304 July 09, 2019 in United States| Report Duplicate | Flag | PURGE
Cohesity MTS Algorithm - 1of 1 vote
AnswersDesign real time tail log search
- neer.1304 July 09, 2019 in United States| Report Duplicate | Flag | PURGE
Rubrik MTS Distributed Computing - 1of 1 vote
AnswersBuild a key-value data structure that allows the user to take a snapshot of the data. The user can read the key-value store from any snapshot.
- neer.1304 July 09, 2019 in United States
Structure has the normal key/value like methods plus something like
snapshot = dataStructure.takeSnapshot()
value = dataStructure.get(key, snapshot)
void dataStructure.deleteSnapshot()| Report Duplicate | Flag | PURGE
Rubrik MTS Algorithm - 0of 0 votes
AnswersA table has some number of balls at various positions on a line segment. All are moving with same speed in one or the other direction. Wherever a collision occurs they change direction. A ball falls from the edges of the table. Find the time when all balls fall of the table given initial position of each ball and speeds
- neer.1304 July 09, 2019 in United States| Report Duplicate | Flag | PURGE
Rubrik MTS Algorithm - 0of 0 votes
AnswersString1 -- "aaabb"
- vivekkumarraju May 18, 2019 in United States
String2 -- "aaabbbb"
String3 -- "aaabbb"
These are sample strings. The problem stated that a given string has to be cut in such a fashion that the remaining characters in the string, say a and b have same character count. If not, then the method returns false.
In case the string already has characters with same frequency of occurrence as in case 3, then just return true. Return type can be assumed to be Boolean.
Tried to solve problem using substring() method in java by running a loop over the string, but could not arrive at a solution.| Report Duplicate | Flag | PURGE
VMWare Inc MTS String Manipulation - 0of 0 votes
Answershere are tuples given for each users of a website (Si,Ei) where Si denotes the when the user entered the website and Ei denotes when the user exits the website .Find the maximum number of users active of website at any time duration.
- neer.1304 September 04, 2017 in United States| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm - 0of 0 votes
AnswersThere is a binary stream coming . You need to print true or false based on the fact whether the number formed is divisible by 5 or not.
- neer.1304 September 04, 2017 in United States| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm - 0of 0 votes
AnswersSamu's Birthday is near so she had started planning a party for all of her friends. Being a kind and caring girl she calls each of her friend and asks for his/her favorite dish.Now each friend has own liking/disliking for different dishes.
- lucklypriyansh July 25, 2015 in India
A friend can only like or dislike a dish it means if we are having three dishes 1,2,3 then if a friend says that he likes Dishes 1 and 2 then its obvious that he dislikes Dish 3. So for each friend we are given a string of 1 and 0 where 1 shows that this person like this particular dish.
Now we are given that Samu has N friends and total of K dishes available to make her menu. Now Samu doesn't want to make any of her friend unhappy , After all its her birthday.
So she got confused on what dishes to count in menu and calls you for help. You need to find count of minimum dishes to order so that all of her N friends are happy which means everyone has at least one dish to eat in party.
Note : Its for sure that everyone has at least liking for one dish.
Input : Input will contain T test cases and each of the test case has following description :
First line of test case has N denoting the total number of friends and K denoting the total number of dishes available.Both separated by a space (Dishes are numbered from 1 to K) .
Then it is followed by N lines each of length K . Each of the N lines contains a string of 0 and 1 where if jth (1<=j<=K) value in ith line (1<=i<=N) is set 1 then it shows that dish| Report Duplicate | Flag | PURGE
Adobe MTS - 0of 0 votes
AnswersThere is a Blank Paper Sheet, Given a list of characters and their sizes,
- amitesh.hbti June 20, 2013 in India
for ex. A, P, O, N, Q with different font sizes and designs.
Now we need to cut characters from given sheet of paper of all sizes
atleast once. And also try to maxmize number of characters cut. Along with
this, when you remove a character, rest paper is more or less like a rough
sheet left. So we should try to minimize that rough sheet size as well.
Write Algo for this. Provide Data Structure, Complexity of algorithm.| Report Duplicate | Flag | PURGE
Adobe MTS - 0of 0 votes
AnswersGiven an arrangement of balls on 2-D Euclidean plane (i.e a flat surface), you have to assign a color to each ball
- nprabhanjan October 26, 2012 in India
such that no two adjacent balls are of the same color. A greedy approach can be used to reduce the number of
colors required.
Question:
Model this as a graph problem. [Hint: Balls become vertices, adjacency relation is modeled by edges, and each
vertex has a unique identification number and a color.]. Write a program that finds the number of colors
required and outputs the balls (unique ids) along with their colors.. Note that to solve this problem, all balls and
their neighbors must be inspected.
Use adjacency lists to represent the graph.
The input to this program is a file containing the number of balls in the first line followed by the list of
adjacencies – one per line: e.g. an input line containing
x,y
denotes that balls x and y are neighbors. Here x and y denote the unique ids of the two balls.
A simple greedy algorithm for this color assignment problem is as follows:
I. Sort all the vertices in the graph on the basis of their degrees [This sorting should be done in-place on
the array of adjacency lists.]. Assume colors are ordered c1, c2, …
II. Let u be the un-colored vertex with the smallest degree. [Break ties in favor of the vertex with the
smaller id]
a. Assign first color ci in the list of colors to u such that
color(u) ci where ci != color(vj ) for any vertex vj in the adjacency list of u.
III. Repeat step II until all vertices are colored.
Implement your solution using a Graph ADT that supports the following interfaces:
a) Graph createGraph() : Creates an empty graph.
b) Graph addEdge(Graph g, Vertex v1, Vertex v2): adds an edge from vertex v1 to vertex v2 to the graph g.
If a new vertex is found, then an entry has to be added in the adjacency list
c) Iterator getNeighbors(Graph, Vertex): gets a list of neighbors of the vertex.
d) Graph sortGraphbyDegree(Graph) : sorts the adjacency list based on degree of the vertices. The vertex
with smallest degree will appear first, and the vertex with the largest degree will appear last. If two
vertices are having the same degree, then their order of appearance will not change.
e) Color chooseColor(Graph, Vertex): returns the first color in the list of colors that satisfies the condition
mentioned in step (2) above.
f) int assignColors(Graph) : invokes chooseColor vertex by vertex and stores the chosen color in the
corresponding vertex. This function returns the number of colors used.
g) printGraph(Graph , num_colors_used, file) : prints the number of colors used, num_colors_used, in the
first line of the output file. It then prints the graph into the file using the following format:
(vertexid,color):v1,v2,v3,vn
where vertexid is the unique id of the vertex, color is the color assigned to the vertex, and v1,v2,…,vn
correspond the unique identification numbers of the vertices that are adjacent to the current vertex.
Data structures Used:
Graph: This is a dynamic array, such that each entry in the array contains a pointer to vertex vi, the degree of vi
and a list of neighbors of vi.
Vertex: Each vertex contains the unique identification number of the vertex, its color.
List: This is for the list of neighbors, such that each entry in the list corresponding to vertex vi consists of a
pointer to vertex vj, ∀ vj Î neighborhood(vi)
Steps to perform:
1. Write the relevant Header files for an adjacency list representation of Graph
2. Write a driver file that reads an input file containing the edges in the graph and prints the graph after
coloring the balls. This driver uses the adjacency list for graph representation.
a. The driver takes the name of the input file and output file as command line parameters.
b. From the file, find number of nodes involved.
c. For each line in the input file corresponding to an edge
i. add the edge using call to addEdge().
d. The driver must then invoke function sortGraphbyDegree() to sort the vertices in the increasing
order of their degrees.
e. Invoke assignColors to assign colours to each vertex.
f. Print the number of colours used and the resultant graph into the output file using the call to
the function printGraph(). If no output file is mentioned in the command-line, then print the
graph into the screen.
3. Write the code for the functions a - g| Report Duplicate | Flag | PURGE
Amazon MTS Software Engineer / Developer - 0of 0 votes
AnswersGive a Data structure to store Name-value pair like name-age
- shani October 19, 2012 in India
"abc",12
"xyz",34...
such than insert(name,value), value = search(name), name = nthentry(n), delete(name); all can be perfomed in O(1).
Note:- after deletion order should be maintained.Ex.
"ds",12
"df",78
"teu",54
"etr",12
If delete("df") is called then nthentry(2) should return "teu"| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm - 0of 0 votes
AnswersThere is one linked list having two pointer one as usual next and other is random pointer pointing to any random node in list.
- shani October 19, 2012 in India
write algo to make a duplicate of it.
Note:- Original list is const, Can't be modified.| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm - -1of 1 vote
AnswersWrite a code to generate Pascals triangle of any level.
- Nitin Gupta October 05, 2012 in India| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm Data Structures - 0of 2 votes
AnswersI have a list of N teams T1, T2, T3 … Tn. Each of these teams has played a match against every other team. I have a function displayResult(Team T1, Team T2), it returns the team which won the match between any two given teams T1 and T2.
- Nitin Gupta October 05, 2012 in India
I have to write the teams in an order such the (n-1)th team (in the order) had lost to the nth team which in turn had lost to (n+1)th team..Write Code| Report Duplicate | Flag | PURGE
Adobe MTS SDE1 Algorithm Data Structures - -1of 1 vote
AnswersFind the mean and median of the elements which are dynamically added at runtime.
- Nitin Gupta October 05, 2012 in India| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm Data Structures - -2of 2 votes
AnswersGiven a sorted but rotated array. Search an element inside it without finding the pivot. Complexity of the solution should still remain O(Log n)
- Nitin Gupta October 05, 2012 in India| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm Arrays Data Structures - -1of 1 vote
AnswersGiven a sorted but rotated array. Find the pivot.
- Nitin Gupta October 05, 2012 in India| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm Arrays Data Structures - -1of 1 vote
AnswersHow will you implement a stack using a priority queue. Push and pop should be in O(1).
- Nitin Gupta October 05, 2012 in India| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm Data Structures - -1of 3 votes
AnswersWhat data structures will you use to implement a text editor. Size of editor can be changed and you also need to save the styling information for all the text like italic, bold etc.
- Nitin Gupta October 05, 2012 in India| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm Data Structures - 0of 0 votes
Answersdevise an algorithm to color the graph in such a way that no two adjacent vertices have same color.You have to color them with any of the two colors say red or green?what will the time and space complexity of the solution.
- softy July 15, 2012 in India| Report Duplicate | Flag | PURGE
Mentor Graphics MTS Algorithm Data Structures - 0of 0 votes
Answersfind a number a matrix a[m][n] where all the rows and columns are sorted non-decreasingly.What will be the complexity of the solution.
- softy July 15, 2012 in India| Report Duplicate | Flag | PURGE
Mentor Graphics MTS Algorithm Arrays