Flipkart Interview Question for SDE1s
- 0of 0 votes
AnswersWrite down code in any language for a simple employee hierarchy which has 3 types of employees.
- kri1311 May 27, 2015 in India
1. CEO
2. Manager
3. employee
Where an employee can have only 1 mgr, and a mgr has 1+ employees.
We were asked to input employee details(name ,id, salary,rating etc) in any order (employees might be input before his manager), create the hierarchy and implement these functionality:
1. Print hierarchy given any employee/mgr/ceo (used an n-ary tree + hash table)
2. Given a bonus and performance rating of each employee divide it to the lowest level employees(in the hierarchy ) in the ratio of their rating. i.e 100 divided among 2:3 is 40 and 60. and print the bonus of each ( simple recursive solution)
3. Top 10 employees with ratio of bonus:salary (used maxheap)| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm
Interview Type: In-Person