PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Meta

Solve parsing, counting, ranges, and window problems

Last updated: Mar 29, 2026

Quick Overview

This set of problems evaluates parsing and string-processing, array and range reasoning, binary search, and sliding-window/frequency-counting competencies within the Coding & Algorithms domain, covering expression evaluation with operator precedence, counting occurrences in sorted arrays, summarizing missing ranges, and minimum-window substring problems. Such questions are commonly asked to assess the ability to implement efficient algorithms that meet specified time and space bounds while handling edge cases, and they require practical implementation skills (linear and logarithmic time techniques) combined with conceptual understanding of precedence, search boundaries, and two-pointer/window strategies.

  • Medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Solve parsing, counting, ranges, and window problems

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Solve the following four algorithm problems: 1) Expression evaluator with + and *: Given a string s containing non-negative integers, '+' and '*' operators, and optional spaces or commas as separators, compute the value of the expression. Multiplication has higher precedence than addition; no parentheses appear. Assume s length ≤ 1e5 and all intermediate results fit in 64-bit signed integer. Return the integer result in O(n) time and O( 1)/O(n) extra space (your choice). Clarify how to handle invalid tokens (you may assume input is valid). 2) Count target occurrences in a sorted array: Given a nondecreasing integer array nums and an integer target, return the number of occurrences of target in nums. Achieve O(log n) time and O( 1) extra space by locating the first and last positions via binary search. If target is absent, return 0. 3) Summarize missing ranges within [0, 99]: You are given a sorted, unique list present of integers each in [0, 99] representing the values that exist. Output a list of strings summarizing all missing values in [0, 99] that are not in present. For any consecutive missing run [a, b]: if the count of missing numbers is at least 3, output "a->b"; otherwise list each missing number individually, joined by commas (e.g., "6,7"). Examples: present = [0,1,5,9,99] -> missing includes "2,3,4", "6->8", "10->98". If nothing is missing, return an empty list. 4) Minimum window covering a multiset: Given strings s and t, return the shortest substring of s that contains every character of t with its required multiplicity. If multiple answers exist, return any one; if none exist, return the empty string. Aim for O(|s|) time and O(Σ) space using a sliding window with frequency counts.

Quick Answer: This set of problems evaluates parsing and string-processing, array and range reasoning, binary search, and sliding-window/frequency-counting competencies within the Coding & Algorithms domain, covering expression evaluation with operator precedence, counting occurrences in sorted arrays, summarizing missing ranges, and minimum-window substring problems. Such questions are commonly asked to assess the ability to implement efficient algorithms that meet specified time and space bounds while handling edge cases, and they require practical implementation skills (linear and logarithmic time techniques) combined with conceptual understanding of precedence, search boundaries, and two-pointer/window strategies.

Related Interview Questions

  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve a Key-Door Corridor Maze - Meta (medium)
  • Solve Array Merge and Parentheses Cleanup - Meta (medium)
  • Solve Two Backtracking Array Problems - Meta (hard)
  • Solve Maze and Suffix Problems - Meta (medium)
Meta logo
Meta
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
1
0

Solve the following four algorithm problems:

  1. Expression evaluator with + and : Given a string s containing non-negative integers, '+' and ' ' operators, and optional spaces or commas as separators, compute the value of the expression. Multiplication has higher precedence than addition; no parentheses appear. Assume s length ≤ 1e5 and all intermediate results fit in 64-bit signed integer. Return the integer result in O(n) time and O( 1)/O(n) extra space (your choice). Clarify how to handle invalid tokens (you may assume input is valid).
  2. Count target occurrences in a sorted array: Given a nondecreasing integer array nums and an integer target, return the number of occurrences of target in nums. Achieve O(log n) time and O(
  3. extra space by locating the first and last positions via binary search. If target is absent, return 0.
  4. Summarize missing ranges within [0, 99]: You are given a sorted, unique list present of integers each in [0, 99] representing the values that exist. Output a list of strings summarizing all missing values in [0, 99] that are not in present. For any consecutive missing run [a, b]: if the count of missing numbers is at least 3, output "a->b"; otherwise list each missing number individually, joined by commas (e.g., "6,7"). Examples: present = [0,1,5,9,99] -> missing includes "2,3,4", "6->8", "10->98". If nothing is missing, return an empty list.
  5. Minimum window covering a multiset: Given strings s and t, return the shortest substring of s that contains every character of t with its required multiplicity. If multiple answers exist, return any one; if none exist, return the empty string. Aim for O(|s|) time and O(Σ) space using a sliding window with frequency counts.

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.