Guys, I want to share my interview experience in JP Morgan Bengalore recently.
I got rejected on second round on silly thing in first 20 mins which I couldn't understand from interviewers questions.
Round 1:
- Asked question around saving Employee object as key in HashMap (hashcode + equals) - very easy.
- Asked one simple sql query based on 2 tables Employee and Salary where I need to find employees which don't have salary rows in Salary table.
- Oral discussion around AWS lambda (constraints of Lambda such as default max concurrency, max memory utilization, RDS, master slave, read write ratio etc.)
- General System Design discussion over batch processing etc.
Overall it was very easy casual interview.
Round 2:
- Interviewer asked me to write sql query where there is one employee table which has empid, name, managerid column. managerid column has one of the employee ids (because managers are also employees). Write a query to print those manager names who has more than 5 subordinates.
- Upon failing on writing above query, he asked what if you have a ArrayList of Employees in Java and Employee class has those 3 attributes id, name, managerid. Print manager name who has more than 5 subordinates.
Code was simple to create a Map of managerid-employee list and for each manager check size of employee list.
But for returning the manager name, I was again iterating over the employee list. And he was asking to don't iterate over the list twice.
And I did not get that what he was asking.
Just after zoom call ended, I got what he might refering to:
He might want me to create one more map of empId-EmpObject and for getting manager name, just use that map instead of iterating over employee list again. Bad day!
PS: Focus on writing different sql queries asked in regular interviews.
Hope this helps.