meta logo
Meta· Software Engineer - Machine Learning

Meta Software Engineer - Machine Learning

Posted
17 Jul 2025
338 reads

Summary

This post details a Meta Software Engineer - Machine Learning interview experience, focusing on two specific algorithm questions.

How it went

Q1) Find the buildings that have an ocean view. A building has an ocean view if any part of the building can see the ocean without being obstructed by another building.

Input = Array of numbers that represent the height of buildings.

Output = Return the indexes of the buildings that have ocean view

Example Input: [4, 3, 2, 3, 1] Output: [0, 3, 4]


Q2) Given a 2D array, print out its elements in diagonal order as shown in the below image. https://imgur.com/Ib0VUPO Example Input:

1, 2, 3 4, 5, 6 7, 8, 9

Questions asked (2)

  1. 01

    Buildings With an Ocean View

    Data Structures & Algorithms

    Find the buildings that have an ocean view. A building has an ocean view if any part of the building can see the ocean without being obstructed by another building.

    Input = Array of numbers that represent the height of buildings.

    Output = Return the indexes of the buildings that have ocean view

    Example Input: [4, 3, 2, 3, 1] Output: [0, 3, 4]

  2. 02

    Diagonal Traverse of 2D Array

    Data Structures & Algorithms

    Given a 2D array, print out its elements in diagonal order as shown in the below image. https://imgur.com/Ib0VUPO Example Input:

    1, 2, 3 4, 5, 6 7, 8, 9

    Open the problem

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Meta recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!