Oath

Oath Onsite --- Feb 15


Interview 1:

  1. Follow up question asked on campus:

code how to find first unique char in a string... he gave the answer... asked me to implement:

Use HashMap and invalidate if encounter again...

Coding optimization!!

make -1 as const and gave meaning to it... as INVALID

char ans = '\0x\' (make it static constant)

for(,)

if ....

    ans

return ans

  1. atoi

  2. negative

  3. leading zero

  4. optimise coding style

coding style:

offset

isNegative 1/-1

return isNegative*num;

Interview 2:

BST, delete value greater than or equal to ... keep the tree structure... (means the inorder would be the same)

follow up:

  • what if we find smaller or equal to... something like comparator chage the logic of comparision

  • worst cases tree?? and stack overflow... (there is iterative sol, we just mentioned but not implementing this)

  • early termination... parent pointer...

results matching ""

    No results matching ""