HARMAN Interview Question

Q1: Write java program to give all permutation of given string. For example "bot", bto", "obt", "otb", "tbo" and "tob". Q2: Two dimensional matrices addition. Analytical Questions: 1) One cake , you can cut it 4 times, tell the max possible pieces. 2) 12 coins and one faulty coin. Find it out in 3 scales. 3) An employee works for an employer for 7 days. The employer has a gold rod of 7 units. How does the employer pays to the employee so that the employee gets 1 unit at the end of everyday. The employer can make at most 2 cuts in rod.

Interview Answer

Anonymous

Aug 20, 2019

1. Either cut 2 Horizontal slices and then 2 cross cuts causes 3 slices each of 4 pieces= 3*4=12 max. 2. Either cut 1 Horizontal slices and then 3 cross cuts causes 2 slices each of 6 pieces= 2*6=12 max

1