Facebook | Phone | Valid Palindrome II and Fraction to Recurring Decimal
Company: Meta (Facebook)
Role: E4
Interview Stage: Phone Screen
Location: London
Year: unknown
Original Post Content:
Location: London
YOE : 3 years
Question 1
Given a string, determine whether its palindrome if you are allowed to delete atmost one character (https://leetcode.com/problems/valid-palindrome-ii/)
Example
"aba" - True
"abca" - True
"abccadsfa" - False
I was able to solve it within 5-10 minutes.
Question 2
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. (https://leetcode.com/problems/fraction-to-recurring-decimal/)
If the fractional part is repeating, enclose the repeating part in parentheses.
Example
1/5 - "0.2"
1/3 - "0.(3)"
9/11 - "0.(81)"
Luckily I have solved this problem few days ago, so I could able to solve this problem as well in time.
Hoping to hear positive news from recruiter.
My Two cents
* Facebook phone interview is exactly 45 minutes so make sure you put a timer of two questions in 40 minutes while practicing
* You don't have to execute the code so do not forget to dry run 2-3 test cases with the interviewer when you are done writing the code
* Always tell the approach to the interviewer first, confirm that the approach would work and take a go ahead from the interviewer whether you can write the code
* Don't forget to discuss time and space complexity of the solution even if he hasn't asked
Good luck !! Keep Leetcoding
Update : The recruiter mentioned that i did really well in the interview but next rounds are in hold for a month or two for E4 candidates until additional headcount is approved. Not sure if this has to do with impact of COVID on hiring