PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

This collection evaluates proficiency in fundamental data structures and algorithms — including tree traversal and binary search tree reasoning, array manipulation and counting, string/stack validation for parentheses, prefix-sum range queries, and basic dynamic programming — within the Coding & Algorithms domain.

  • Medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Solve various LeetCode data-structure questions

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

##### Question LeetCode 129. Sum Root to Leaf Numbers LeetCode 2089. Find Target Indices After Sorting Array LeetCode 270. Closest Binary Search Tree Value LeetCode 1249. Minimum Remove to Make Valid Parentheses LeetCode 303. Range Sum Query – Immutable LeetCode 746. Min Cost Climbing Stairs https://leetcode.com/problems/sum-root-to-leaf-numbers/description/ https://leetcode.com/problems/find-target-indices-after-sorting-array/description/ https://leetcode.com/problems/closest-binary-search-tree-value/description/ https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/description/ https://leetcode.com/problems/range-sum-query-immutable/description/ https://leetcode.com/problems/min-cost-climbing-stairs/description/

Quick Answer: This collection evaluates proficiency in fundamental data structures and algorithms — including tree traversal and binary search tree reasoning, array manipulation and counting, string/stack validation for parentheses, prefix-sum range queries, and basic dynamic programming — within the Coding & Algorithms domain.

Given an integer array nums and an integer target, sort nums in non-decreasing order and return a list of all indices where target appears in the sorted array. Indices are 0-based and must be returned in increasing order.

Constraints

  • 1 <= len(nums) <= 100000
  • -10^9 <= nums[i] <= 10^9
  • -10^9 <= target <= 10^9
  • Return indices in increasing order

Hints

  1. Sorting nums and scanning for target works in O(n log n).
  2. You can avoid sorting: count how many elements are less than target and how many equal target.
  3. If cLess is the count of elements < target and cEq is the count == target, the answer is the range [cLess, cLess + cEq - 1].
Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ 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
  • AI Coding 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.

Related Coding Questions

  • Find Shortest Unique Prefixes - Meta (medium)
  • Compute Exclusive Execution Times - Meta (medium)
  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)