Meta | University Grad | March 2022 | Screening [Passed]
Anonymous User
944

Bachelor's University Grad

No intro.

2 coding problems:

Given a  string, write a method that returns true if the string is a valid number or false otherwise.
Only integers and decimals should be considered as valid. In other words,
only characters allowed are digits, "-" and ".".
The string can be very long (think millions of characters) and no built-in function/class
can handle it without overflowing or losing precision.

Some example strings and expected output:
"13"    ---> true
"3.0"   ---> true
"-7.4"  ---> true
"-13.5" ---> true
"abc"   ---> false
"123a"  ---> false
"-."    ---> false
"-..--" ---> false
"1.0.0.1" -> false

The interviewer didn't mention more test cases such as "007" or ".9", be sure to think about every possible input.

  • I don't have a link for this second question but I'm pretty sure there has to be in LeetCode already:
Implement a function to merge 3 sorted integer arrays.
The output should be another sorted integer array consisting of
all integers from the 3 input arrays.
The input arrays may have duplicates, but the output array shouldn't have any duplicate.

The interviewer didn't mention any edge case.

I was able to explain my approach with time and space complexities, code both and ran tests but found bugs, and ran out of time to fix them.

5 minutes at the end to ask questions.

Comments (2)