PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Coding & Algorithms/Bloomberg

Solve string dictionary and tree ordering

Last updated: Mar 29, 2026

Quick Overview

This question evaluates design and analysis skills for string-matching data structures that support one-edit queries and for binary tree traversal with coordinate-based ordering, testing understanding of data structures, search algorithms, sorting, and complexity analysis within the Coding & Algorithms domain.

  • Medium
  • Bloomberg
  • Coding & Algorithms
  • Software Engineer

Solve string dictionary and tree ordering

Company: Bloomberg

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Part A — One-edit dictionary: Build a data structure supporting build(words: List[str]) and search(query: str) -> bool that returns true if and only if there exists a stored word obtainable by changing exactly one character of query. Discuss possible designs (e.g., trie with masked patterns or hash-based buckets), edge cases (length mismatches, duplicates, non-lowercase), and complexity. Part B — Tree ordering by coordinates: Given a binary tree whose nodes contain lowercase letters, assign coordinates with root at (row=0, col= 0), left child at (row+1, col- 1), and right child at (row+1, col+ 1). Output the concatenation of node values ordered by column ascending, then row ascending; break ties left-to-right. Describe an algorithm (e.g., DFS/BFS to collect (row, col, char) then stable sort) and analyze time and space complexity.

Quick Answer: This question evaluates design and analysis skills for string-matching data structures that support one-edit queries and for binary tree traversal with coordinate-based ordering, testing understanding of data structures, search algorithms, sorting, and complexity analysis within the Coding & Algorithms domain.

Related Interview Questions

  • Solve meeting and tree problems - Bloomberg (easy)
  • Minimize travel cost with two cities - Bloomberg (easy)
  • Check connectivity between two subway stations - Bloomberg (easy)
  • Design a data structure for dynamic top‑K frequency - Bloomberg (hard)
  • Find tree root and bucket numbers - Bloomberg (hard)
Bloomberg logo
Bloomberg
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
3
0

Part A — One-edit dictionary: Build a data structure supporting build(words: List[str]) and search(query: str) -> bool that returns true if and only if there exists a stored word obtainable by changing exactly one character of query. Discuss possible designs (e.g., trie with masked patterns or hash-based buckets), edge cases (length mismatches, duplicates, non-lowercase), and complexity. Part B — Tree ordering by coordinates: Given a binary tree whose nodes contain lowercase letters, assign coordinates with root at (row=0, col= 0), left child at (row+1, col- 1), and right child at (row+1, col+ 1). Output the concatenation of node values ordered by column ascending, then row ascending; break ties left-to-right. Describe an algorithm (e.g., DFS/BFS to collect (row, col, char) then stable sort) and analyze time and space complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Bloomberg•More Software Engineer•Bloomberg Software Engineer•Bloomberg Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • 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.