PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Meta

Solve four OA coding problems

Last updated: Mar 29, 2026

Quick Overview

This set of four problems evaluates core algorithmic competencies including array manipulation and counting in sorted arrays, resource-constrained optimization for reachability with recharge stations, grid-based connected-component identification, and detection of longest consecutive-value sequences, emphasizing data-structure selection, edge-case reasoning, and time/space complexity analysis. Commonly asked in Coding & Algorithms interviews to assess both conceptual understanding of algorithmic paradigms and practical application of efficient techniques under constraints, these questions measure algorithmic thinking, complexity analysis, and problem decomposition.

  • easy
  • Meta
  • Coding & Algorithms
  • Software Engineer

Solve four OA coding problems

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: HR Screen

The online assessment reportedly contained four coding problems: 1. **Compare negative and positive counts** Given a sorted integer array `nums` in nondecreasing order, return the larger of: - the number of elements less than `0` - the number of elements greater than `0` Elements equal to `0` should not be counted in either group. 2. **Reach a destination with charging stations** A drone must travel `target` units of distance. It starts with `startCharge` units of battery, and it consumes `1` unit of battery per unit of distance traveled. Along the route, `stations[i] = [position_i, charge_i]` describes a charging station at distance `position_i` from the start that can provide `charge_i` additional battery units. The stations are sorted by position. Return the minimum number of charging stops needed to reach the destination, or `-1` if the destination cannot be reached. 3. **Count objects placed on a grid** You are given an `m x n` grid of characters `'X'` and `'.'`. Each object is formed by one or more contiguous `'X'` cells placed either horizontally in one row or vertically in one column. Different objects are separated by at least one `'.'` cell, so no two distinct objects touch horizontally or vertically. Return the total number of objects in the grid. 4. **Find the longest consecutive-value run** Given an unsorted integer array `nums`, return the length of the longest set of consecutive integer values that appears in the array. The values do not need to be adjacent in the original array. Aim for an `O(n)` solution.

Quick Answer: This set of four problems evaluates core algorithmic competencies including array manipulation and counting in sorted arrays, resource-constrained optimization for reachability with recharge stations, grid-based connected-component identification, and detection of longest consecutive-value sequences, emphasizing data-structure selection, edge-case reasoning, and time/space complexity analysis. Commonly asked in Coding & Algorithms interviews to assess both conceptual understanding of algorithmic paradigms and practical application of efficient techniques under constraints, these questions measure algorithmic thinking, complexity analysis, and problem decomposition.

Related Interview Questions

  • Solve Two Backtracking Array Problems - Meta (hard)
  • Solve Array, Matrix, and Recommendation Problems - Meta (medium)
  • Find a String Containing Another - Meta (medium)
  • Solve Subarray Sum and Local Minimum - Meta (hard)
  • Validate abbreviations and brackets - Meta (medium)
Meta logo
Meta
Jan 26, 2026, 12:00 AM
Software Engineer
HR Screen
Coding & Algorithms
1
0
Loading...

The online assessment reportedly contained four coding problems:

  1. Compare negative and positive counts
    Given a sorted integer array nums in nondecreasing order, return the larger of:
    • the number of elements less than 0
    • the number of elements greater than 0
    Elements equal to 0 should not be counted in either group.
  2. Reach a destination with charging stations
    A drone must travel target units of distance. It starts with startCharge units of battery, and it consumes 1 unit of battery per unit of distance traveled. Along the route, stations[i] = [position_i, charge_i] describes a charging station at distance position_i from the start that can provide charge_i additional battery units. The stations are sorted by position. Return the minimum number of charging stops needed to reach the destination, or -1 if the destination cannot be reached.
  3. Count objects placed on a grid
    You are given an m x n grid of characters 'X' and '.' . Each object is formed by one or more contiguous 'X' cells placed either horizontally in one row or vertically in one column. Different objects are separated by at least one '.' cell, so no two distinct objects touch horizontally or vertically. Return the total number of objects in the grid.
  4. Find the longest consecutive-value run
    Given an unsorted integer array nums , return the length of the longest set of consecutive integer values that appears in the array. The values do not need to be adjacent in the original array. Aim for an O(n) solution.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Software Engineer•Meta Software Engineer•Meta Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.