Preparing for an interview? Check out Cracking the Coding Interview
Published on

Meta | E5 | NYC | Phone Screen

Author
  • Shared Anonymously

I was asked two fairly straightforward questions. I don't think they are on Leetcode

  1. Given a long list/array of 1s and 0s and two indices i and j, return the number of 1s between those two indices in O(1) time.
    • interviewer was looking for pre-processing using hashmap and cumulative sum, which I coded up
  2. Merge 3 sorted arrays, while removing any duplicates in the final sorted array
    • I took a couple hints for this but I eventually got to the solution in time. I took the global min over three pointers and moved each one depending on the choices. The one concern I had was that I might've missed a boundary check in the code and did tell the interviewer this and would test more aggressively if I had a few more minutes

I think I did OK overall but this was 2 days ago and no feedback yet. My chances depend how lenient they are with the hints and the out of bounds check in the second problem, I'm leaning towards a reject but will update when I know.

ReportMark as Helpful