← Meta Interview Insights

Meta·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Meta SWE coding round with a data manipulation problem that looks straightforward until you realize you need to join two datasets with overlapping fields before you can even start computing anything.

Questions Asked (1)

Q1

Given two datasets with animal attributes spread across them (one has name and leg count, the other has name, tail, and walking leg count), write a function that returns the speeds of animals that walk on two legs, sorted in descending order. Speed is derived from both leg and tail fields.

Algorithms & Data StructuresData Modeling
Author's notes

The join part is what gets you.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the join key and the speed formula, then propose a hash join to merge the datasets on animal name. Filter for animals with exactly two walking legs, compute speed using both leg and tail fields, and sort the results in descending order.

Pro tip: Discuss trade-offs: a hash join is O(n+m) time and O(n) space, but if data is already sorted or memory is constrained, a sort-merge join might be preferable. Also, confirm the speed formula and edge cases like missing data or ties.

1. Clarify requirements and assumptions

Ask about the join key (likely animal name), the exact speed formula (e.g., speed = leg_count * tail_length), and how to handle missing or inconsistent data. Confirm that 'walking leg count' is the field to filter on for two-legged animals.

2. Choose data structures and join strategy

Propose using a hash map to index one dataset by name for efficient lookups, or a sort-merge join if data is sorted. Consider memory constraints and whether to load the smaller dataset into memory.

3. Implement the join and filter

Iterate through the datasets, join on name, and filter for animals where walking leg count equals 2. Compute speed using the derived formula from both leg and tail fields.

4. Sort and return results

Collect the speeds into a list and sort in descending order. If multiple animals have the same speed, decide on a tie-breaking rule (e.g., alphabetical by name) or mention that it's unspecified.

5. Analyze complexity and edge cases

State the time and space complexity (e.g., O(n+m) for hash join, O(k log k) for sorting). Discuss edge cases: missing names, null values, negative speeds, and large datasets that don't fit in memory.

Key Points to Mention

  • Hash join vs. sort-merge join and their trade-offs
  • Time and space complexity analysis
  • Handling missing or inconsistent data (e.g., nulls, mismatched names)
  • Definition of speed formula and its derivation from leg and tail fields
  • Filtering condition: walking leg count == 2
  • Sorting in descending order and tie-breaking strategy

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.