Directi Interview Report
- 0of 0 votes
AnswersA binary tree is given with a positive weight attached to each node. Find the subset of nodes in the tree whose sum give you the maximum weight such that if a node is in the subset, none of its children can be in that subset.
- game January 07, 2010| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven 2 sorted arrays A and B, sorted in increasing order, find the minimum value of |A[i]-B[j]| for all i belonging to A and all j belonging to B. Preffered order O(M+n) in the worst case. m being size of array A and n being size of array B.
- game January 07, 2010
Then he extended the same question to n sorted arrays with k elements each. I was required to find the minimum range in which the values fall.| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer - 0of 0 votes
AnswersGive some important differences between threads and processes.
- game January 07, 2010
When should I use thread and when should I use processes?
You are given a single processor. Will it be still beneficial if I use threads to parallelize my work? Explain with reasons. If yes, give me a case.| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer - 0of 0 votes
AnswersHe gave me an array of Integers, each integer allows me to make at max its value jumps. If i am at zero, i'm stuck i cannot move forword. He asked me to find,
- game January 07, 2010
1). If the last index was reachable from the first index.
2). Minimum number of jumps required to reach the last index, given any index as the starting index.
3). Total number of ways one can reach the last index.
I was asked to write a code for this.
ex: 1 3 5 8 9 2 6 7 6 8 9
initially at one i can make only one jump to 3, from 3 i can jump either 1 step reaching 5, or 2 steps reaching 8, or 3 steps reaching 9. Carrying on in the same way till i can hit the last index.| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer - 0of 0 votes
AnswersYou are given 2 arrays of size 'n' each. You need to stable-merge these arrays such that in the new array sum of product of consecutive elements is maximized.
- game January 07, 2010
eg
A= { 2, 1, 3}
B= { 3, 7, 9}
Stable merging A and B will give an array C with '2n' elements say C={c1, c2, c3, c4, c5, c6}
You need to find a new array C by merging (stable) A and B such that sum= c1*c2 + c3*c4 + c5* c6..... n terms is maximum.| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer - 0of 0 votes
AnswersConsider a complete 'tree'. Find an equality relation between number of internal nodes and external nodes (leaf nodes) in that tree. He started with a binary tree and then extended this question further to 'n'ary tree.
- game January 07, 2010| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer - 0of 0 votes
AnswersWhat are hash tables? What is collision ? How can collision be resolved (He asked me all the methods and still wanted some more :P )?
- game January 11, 2010
When should a Hash table be used and when should a BST?
Do Hash Tables always give constant time 'find' complexity? If yes, why would I ever prefer to use BST over Hash table ?| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer Hash Table