PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Identify trees, lists, and array search costs

Last updated: Mar 29, 2026

Quick Overview

This question evaluates knowledge of fundamental data structures (tree hierarchies, linear lists, and arrays), algorithmic time and space complexity, and cycle-detection concepts.

  • Medium
  • Meta
  • Coding & Algorithms
  • Data Scientist

Identify trees, lists, and array search costs

Company: Meta

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: HR Screen

Answer all parts concisely and justify time complexities. a) A data model requires each node to have at most two children and a single parent. Name the data structure and describe the typical fields per node. If keys are stored to enable ordered searches, state the average and worst-case time to search by key and what property must hold to achieve the average case. b) You need a structure where each element points to the next element and supports O(1) insertion at the head. Name the structure. Describe how to detect whether it contains a cycle and give the time and space complexity of your method. c) For an unsorted array of n integers, what is the worst-case time complexity to determine whether a target value exists? If the array is sorted, what algorithm would you use and what is the new time complexity? Yes/No: Is binary search valid on an unsorted array? Explain in one sentence.

Quick Answer: This question evaluates knowledge of fundamental data structures (tree hierarchies, linear lists, and arrays), algorithmic time and space complexity, and cycle-detection concepts.

Related Interview 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)
Meta logo
Meta
Oct 13, 2025, 9:49 PM
Data Scientist
HR Screen
Coding & Algorithms
4
0

Answer all parts concisely and justify time complexities.

a) A data model requires each node to have at most two children and a single parent. Name the data structure and describe the typical fields per node. If keys are stored to enable ordered searches, state the average and worst-case time to search by key and what property must hold to achieve the average case.

b) You need a structure where each element points to the next element and supports O(1) insertion at the head. Name the structure. Describe how to detect whether it contains a cycle and give the time and space complexity of your method.

c) For an unsorted array of n integers, what is the worst-case time complexity to determine whether a target value exists? If the array is sorted, what algorithm would you use and what is the new time complexity? Yes/No: Is binary search valid on an unsorted array? Explain in one sentence.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Data Scientist•Meta Data Scientist•Meta Coding & Algorithms•Data Scientist Coding & Algorithms
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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.