PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Design a time-versioned key-value store and find common free time

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in designing time-versioned data structures and reasoning about interval-based scheduling, covering competencies in temporal data retrieval, state versioning, and computing common free time across multiple calendars.

  • easy
  • Meta
  • Coding & Algorithms
  • Software Engineer

Design a time-versioned key-value store and find common free time

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

You are given two coding tasks. ## Task 1: Time-versioned key-value store Design an in-memory data structure that supports: - `set(key, value, timestamp)`: store the string `value` for string `key` at integer `timestamp`. - `get(key, timestamp) -> value`: return the value associated with `key` at the largest stored timestamp `t` such that `t <= timestamp`. If there is no such timestamp (or `key` was never set), return an empty string. **Notes / assumptions** - Multiple `set` operations may occur for the same `key` at different timestamps. - Timestamps are integers; you may assume `set` calls for a given key arrive in non-decreasing timestamp order unless stated otherwise. ## Task 2: Find time slots when everyone is available You are given schedules for `N` people. Each person’s schedule is a list of **busy** time intervals during the day. - Each busy interval is `[start, end)` with `start < end`. - For each person, their busy intervals are non-overlapping and sorted by start time. Return all time intervals (also as `[start, end)`) when **everyone is available** (i.e., when no one is busy). Only include intervals with positive length. **Clarify in your solution** - What overall day bounds apply (e.g., `[0, 24*60)` minutes) and how to handle availability outside provided busy intervals. ### Input / Output format (for Task 2) - **Input:** `schedules: List[List[Interval]]`, where `schedules[i]` is person `i`’s busy intervals. - **Output:** `List[Interval]` representing common free time intervals.

Quick Answer: This question evaluates proficiency in designing time-versioned data structures and reasoning about interval-based scheduling, covering competencies in temporal data retrieval, state versioning, and computing common free time across multiple calendars.

Related Interview Questions

  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)
  • Solve a Key-Door Corridor Maze - Meta (medium)
  • Solve Array Merge and Parentheses Cleanup - Meta (medium)
Meta logo
Meta
Nov 12, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
3
0

You are given two coding tasks.

Task 1: Time-versioned key-value store

Design an in-memory data structure that supports:

  • set(key, value, timestamp) : store the string value for string key at integer timestamp .
  • get(key, timestamp) -> value : return the value associated with key at the largest stored timestamp t such that t <= timestamp . If there is no such timestamp (or key was never set), return an empty string.

Notes / assumptions

  • Multiple set operations may occur for the same key at different timestamps.
  • Timestamps are integers; you may assume set calls for a given key arrive in non-decreasing timestamp order unless stated otherwise.

Task 2: Find time slots when everyone is available

You are given schedules for N people. Each person’s schedule is a list of busy time intervals during the day.

  • Each busy interval is [start, end) with start < end .
  • For each person, their busy intervals are non-overlapping and sorted by start time.

Return all time intervals (also as [start, end)) when everyone is available (i.e., when no one is busy). Only include intervals with positive length.

Clarify in your solution

  • What overall day bounds apply (e.g., [0, 24*60) minutes) and how to handle availability outside provided busy intervals.

Input / Output format (for Task 2)

  • Input: schedules: List[List[Interval]] , where schedules[i] is person i ’s busy intervals.
  • Output: List[Interval] representing common free time intervals.

Submit Your Answer

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 8,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.