It was an easy question, but the interviewer insisted on finding the most optimal solution, which took a lot longer than expected. It could have been done in four lines using brute force.
Just practice HackerRank and LeetCode, and don't be nervous.
The interviewer was pretty nice and helped me calm down a lot during the interview, but I couldn't finish my code as I spent way too much time on the discussion.
Count number of occurrences in an array.
The following metrics were computed from 1,861 interview experiences for the Meta Software Engineer role in United States.
Meta's interview process for their Software Engineer roles in the United States is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for Meta's Software Engineer interview process in United States.