Date: July 2019
Year of exprience: 6 year
Domain: Backend [ java, webservices, java servcies, spring, javaEE etc, BigData, Spark... ]
Location: Bangalore
Online assessment (via HackerRank):
Coderpad:
Phone screen:
- Mostly java: how hash map work, design your own hashmaps, how class loader works, what is PermGen memory, what is the memory hierarchy in jvm, define singleton pattern, how it works. Etc.
Onsite:
Round 1:
- Given a stream of stocks share, given that find the max value of stock for any given duration window. The window can be from extreme ends of timw frams.
- Implement dictionary.
- Projects discussion.
Round 2:
- Full current project discussion in deep.
- Design doubletone
- Git/maven/version control/Jenkins/branching/conflict in merge
Round 3:
- Project discussion in brief, technology used and why. Why each component design their usage and reason n all.
- Design banking system that supports below requirements
- debit
- credit
- Atm transaction debit / credit
- Third party transaction via net banking, upi, atm
- balance query
- mini statements query
- Given an array which contains number from 0 to N, few numbers are duplicated. Find any duplicate number efficiently (couldn't satisfied him 100%)
[Solution: approaches i applied during interview ]
- Sort the given array and find the repeating element: O(nlogn) -> This approach would be bad if the size of given array is huge.
- IF size is huge, then we can use k-way-merge sort. Instead of sorting whole array, what we can do is for any chunk we found duplicate (during merge process) then we can direclty flag back that duplicate found.
- We can use Set to keep all the distinct element from the array as soon as we found a number alrady present then its duplicate
- So far in all above solution we did not utilize the range given.
4.1. We can use negation method to find out the array has duplicate or not:
Algo: for each element go to the index as a[a[i]] if its already neg then duplicate otherwise negate it and continue. { this approach don't work if array is unmodifiable }
4.2: We can also use modulo and division method.
Algo: For each element go to a[a[i]] and add N in it. After this divide every element with N. If any value found greater then 1 then its duplicate value { this approach don't work if array is unmodifiable }
- Here is the intersting approach that works in O(n) time without modification of array.
Algo: Assume and imagin the given array as linked list where every node is like index of array from 0 to N-1 (this way list would have at most N node) and for every element, points its index node. We'll find that its a linked list which has loop(s). Our problem reduce to find the loop in the list (or given array)
Simply use fast and slow pointer concept here and we'll find out the loop in array and same way we do in linked list, put slow pointer on start and move both of them 1 by 1 , they will meet at element which is repeated. ]
Round 4 (Systems development life cycle):
- Brief discussion about sprint planning and progression
- Testing framework: regression testing, sanity testing, unit testing etc
- Expectation from developer
- What you expect from GS, tech stack choice etc
Round 5 (Behavioral questions & expectations and team behavior):
- why you want to change
- Your vision Etc.