Second Round (F2F):(1:30hr) 1) Find LCA in BST. 2) Find LCA in Binary Tree. 3) Given a binary tree where each node contains three pointers left,right,succ, where succ pointer is pointing to any of its successor node , the question is if any of succ pointer is pointing to its predecessor node then make that pointer NULL. 4) Given an array that represents the runs scored by a batsman and we have given the total score ,now we have to find out in how many ways can batsman score the run. Ex – arr = {2,3,1} total run = 4 2+1+1 = 4, 3+1 = 4, 2+2 = 4, 1+3 = 4, 2+1+1 = 4 and many more. First I have given the recursive solution than interview asked me dp solution, I told him DP approach he was satisfied. 5) Find Loop in a linked list and remove it. 6) You have 100 songs to play in a shuffling mode how will you play. Interview want full working code for each question for last question he wanted only approach.
Check out your Company Bowl for anonymous work chats.