PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/TikTok

Flatten object & Promise.all

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in JavaScript data manipulation and asynchronous programming, testing competencies in transforming nested objects into single-level key paths and reproducing Promise.all semantics.

  • Medium
  • TikTok
  • Coding & Algorithms
  • Software Engineer

Flatten object & Promise.all

Company: TikTok

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

##### Question Given a nested JavaScript object, write a function to flatten it so that nested keys are converted to a single-level path (e.g., {a:{b:1}} -> {'a.b':1}). Implement Promise.all from scratch in JavaScript; it should take an iterable of promises/values and return a single promise that resolves when all inputs resolve or rejects when any input rejects.

Quick Answer: This question evaluates proficiency in JavaScript data manipulation and asynchronous programming, testing competencies in transforming nested objects into single-level key paths and reproducing Promise.all semantics.

Related Interview Questions

  • Parse a nested list from a string - TikTok (medium)
  • Implement stacks, streaming median, and upward path sum - TikTok (easy)
  • Implement stack variants and path-sum check - TikTok (medium)
  • Find the longest palindromic substring - TikTok (easy)
  • Maximize sum with no adjacent elements - TikTok (medium)
|Home/Coding & Algorithms/TikTok

Flatten object & Promise.all

TikTok logo
TikTok
Jul 29, 2025, 8:05 AM
MediumSoftware EngineerTechnical ScreenCoding & Algorithms
16
0
Question

Given a nested JavaScript object, write a function to flatten it so that nested keys are converted to a single-level path (e.g., {a:{b:1}} -> {'a.b':1}). Implement Promise.all from scratch in JavaScript; it should take an iterable of promises/values and return a single promise that resolves when all inputs resolve or rejects when any input rejects.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More TikTok•More Software Engineer•TikTok Software Engineer•TikTok Coding & Algorithms•Software Engineer 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
  • 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.