I was contacted by a consultancy about a potential job opportunity.
The first round of the interview focused on problem-solving and backend-related discussion.
- Introduction, current project, current tech stack, knowledge/familiarity of Java as I didn't have any work experience in Java.
- Three Sum problem. Detailed discussion on how the optimized version would be O(n^2), not O(n^3). The interviewer was looking for big O notation and how these complexities are calculated, the fundamentals about various kinds of complexities.
- Count number of leaves in a binary tree.
- Table1:
name,loc,datetime
abc,india,0419
xyz,us,0512
bbb,india,0101
ccc,mexico,0105
zzz,india,0406
sss,us,0420
Table2:
name,loc,datetime
abc,india,0419
xyz,uk,0111
//Write a SQL query to select de-duplicated records (from the combination of above 2 tables) based on “loc” with highest “datetime”
//
//Final output/result should have only one record per location (with its own highest datetime)
//
//Output will be:
//
name,loc,datetime
abc,india,0419
xyz,us,0512
ccc,mexico,0105
xyz,uk,0111
I couldn't figure out the complete query by myself, but the interviewer helped, and this was the answer we both came to agree on -
Select Table.name, Table.loc, Table.datetime from (Select * from Table1 UNION Table2) Table where DENSE_RANK(loc) = 1 PARTITION BY loc ORDER BY datetime;
The second round of the interview focused on problem-solving and front-end related discussion.
- Introduction, front-end experience, Familiarity with front-end frameworks, Javascript, ES6.
- Trapping rain water problem, approach and pseudo code.
- Design patterns which I have used. Explain builder pattern with example.
- Webpack, and how it works.
- Dependency injection.
- Closure.
- DOM Manipulation.
- Virtual DOM Manipulation in React.
- Rendering cache.
- Variable hoisting.
- Treeshaking.
- Web workers, I didn't know, but I mentioned service workers which I explained well.
- Web components.
- Difference between var and let.
- Difference between functional programming and object-oriented programming.
- Node JS internal architecture. How does it work asynchronously.
- React hooks.
- Various ways of code optimization methods.
- Any questions.
Result: Waiting for the second round response.