Onsite Interview (4 轮)
Q1) Reverse an integer
Q2) Given two linked lists which merge at point, find the common point at which they merge
Q3) Given the stock prices from morning to evening in an array, Find two points such that u get maximun profit.
( Hint: You have to make sure min lies left to the max value in the given array)
- Behavioural Questions
- Q1) Find the common root directory for given two paths.
Answer would be “/C:/ProgramFiles”
Q2) Build a Toll Booth System (Basically they are looking on how you build class programming)
Q1) Find the length of longest consecutive subsequence in a given array
[ 1 , 7, 8, 2, 3, 4, 5, 10, 6, 7, 8 ] ( answer is 2,3,4,5 with length 4 )
Q2) Print the elements at k distance from leaf node in a binary tree.
Q1) Given rand(0,1) simulate rand(1,6)
Q2) [3,4,5,2,3,1,1,11] list pair that adds up to a given number.