Experience: 1.5 years
Round1:
There was an online Test, Two coding questions were asked which were easy
Round2 (Technical):
Round Stared with brief introduction about myself
Two coding questions were asked
- https://leetcode.com/problems/largest-number/
I used inubuilt sort and modified the comparator to solve this.
2)Given a binary Tree print all the paths from left leaf nodes to right leaf nodes, you can print paths in any order.
(I did not find link for the problem, if you do please post it in comments)
example :
- -----------------------------1-----------------
-------------2 ------------------------- -----3----------------
--------4--------------5-----------------6-------------7---------------------
Paths:
4 2 1 3 7
4 2 1 3 6
5 2 1 3 6
5 2 1 3 7
I came up with brute force solution, he asked me to code it up which i did.
I generated all paths in the left subtree,right subtree and joined them at the end to get all paths
Round 2( Technical ) :
Round Stared with brief introduction about myself
one coding question was asked
- https://leetcode.com/problems/two-sum/
Next he jumped onto asking questions on Java
questions were asked on static, final
-> wrote small class with static, final keywords and asked what happens here
->what's the difference between Integer and int in Java
-> what is singleton pattern
-> write the code for creating singleton class
->what if two objects are calling for a singleTon object.(see what problems you might face if you dont synchronize the object creation & how to synchronze in singleTon class)
-> Transient variable, volatile variable.
For Java related questions i was able to answer only 70-80% of the questions
Verdict : Selected