It was an 1 hr interview where the interviewer stated that he'll going to ask 2 questions, first a smoke test question just to get familierise me with this round - I will not be judged on this one. Second question will be the actual one where I'll be judged.
Smoke Test Question:
function isNumber(toTest: string): boolean {}Given a string input we have to return whether it's a number on not. E.g:-
'234' // true
'-455' // true
'1e2' // false
'12^2' // false
'23.23' // true
'2.2.4' // falseI was able to come up with an approach where I'll be creating a set and store 0 - 9 numbers as char in it. Then i'll just be iterating each char in string and check whether it exist in set or not, with some case handling that first number could be '-' or '.' can only occur 1 time and could not be in the end or starting.
Since there was still 30 mins left, we moved to next question.
Main Question:-
Well it was exaclty this question which was already shared by someone 7 years ago: https://leetcode.com/discuss/post/125110/linkedin-phone-screen-tournament-tree-pr-aqv9/
I was able to come up with an optimised approach after 30 mins, it was already 1 hr, so I hurried and completed the function. There were few test cases which my code was failing when I was dry running, I corrected and it was past 1hr 10mins at this time, but in hurriedness I did some mistakes in code to which interviewer pointed out when he gave me 1 test case to run and then asked me to tell the changes verbally to correct the function, he don't want me to code now as it was already late.
Whole interview took 1hr 20 mins.
I recevied the rejection mail today that I'll not be advancing to next stages of hiring.
I feel sad that I received this big opportunity but haven't practiced properly before hand and missed this one. It was the first time a big MNC have reached out to me and yet I lost this shot.