Principal consultant Interview Questions in Bangalore, India | Glassdoor.co.in

# Principal consultant Interview Questions in Bangalore

321

principal consultant interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

### Principal Engineer at Intuit was asked...

19 Jun 2009
 analytical- there are 50 floors in a building. You are given two balls which can break at a certain f trheight . Give a solution where you can determine the critical height at which a ball breaks. the solution should be optimised to give the least no. of tries for the worst case scenario(i.e where the ball breaks on the 50th floor only)3 Answersthink over !!first ball --- throw it every floor from the iteration the second balls breaks second ball --- throw it every 3 or 4 or 5 floor ... When the second ball breaks, you know there are only 3 or 4 or 5 floors to check ... O (log n) complexity ... best case O(1)i'll go with binary search procedure..since it stands a better chance

### Principal Engineer at Yahoo was asked...

12 Sep 2011
 How will you save a hierarchical data into a file. 2 Answerswe can use xml to stored hirerchical data... as it represents a tree structurewe can use xml to stored hirerchical data... as it represents a tree structure

### Principal Software Engineer at Yahoo was asked...

27 Feb 2011
 How to reverse the linked list1 AnswerI gave them three inline options god knows they were able to get it I think he only knows one way putting all the elements in the array and then reversing it when I finally told that he was happy.

### Principal Engineer at Yahoo was asked...

6 Apr 2011
 *How to find out the inorder successor of a node in a tree?? 1 AnswerSo, if we want to find X.successor(), we do the following: 1. If X has a right child, then the successor must be on the right side of X (because of the order in which we visit nodes). Specifically, the left-most child must be the first node visited in that subtree. 2. Else, we go to X’s parent (call it P). 2.a. If X was a left child (P.left = X), then P is the successor of X 2.b. If X was a right child (P.right = X), then we have fully visited P, so we call successor(P). 1 public static TreeNode inorderSucc(TreeNode e) { 2 if (e != null) { 3 TreeNode p; 4 // Found right children -> return 1st inorder node on right 5 if (e.parent == null || e.right != null) { 6 p = leftMostChild(e.right); 7 } else { 8 // Go up until we’re on left instead of right (case 2b) 9 while ((p = e.parent) != null) { 10 if (p.left == e) { 11 break; 12 } 13 e = p; 14 } 15 } 16 return p; 17 } 18 return null; 19 } 20 21 public static TreeNode leftMostChild(TreeNode e) { 22 if (e == null) return null; 23 while (e.left != null) e = e.left; 24 return e; 25 }

### Principal Engineer at Goibibo was asked...

23 Jan 2016
 Check if a pattern string is present in base string 1 AnswerApply Rabin-Karp; KMP or any pattern matching algo

### Principal Engineer at Goibibo was asked...

28 Jan 2016
 Write a program to match starting of a query string and return all matching words from the dictionary. 1 AnswerImpl using a Trie of all the dictionary words and then lookup.

### Principal Engineer/Staff Engineer at Traveloka was asked...

31 May 2019
 Discussion of solution design to Question 11 AnswerExplained the flows with different test cases

### Principal Engineer/Staff Engineer at Traveloka was asked...

31 May 2019
 Design of a dynamic Pricing engine for Hotel/Flight/etc booking1 AnswerChose a weighted sum approach to generate a multiplying factor which will decide the discount on the baseline price. Also suggested that we could use a K D tree , with a dimension each for each of the factors that would affect the discount. Traverse down the tree applying the weights to each of the applicable factors and calculate the final multiplying factor