PracHub
QuestionsLearningGuidesInterview Prep
|Home/Coding & Algorithms/Amazon

Detect words formed by multiple dictionary parts

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in string processing, selection and use of appropriate data structures and algorithms (hashing, tries), dynamic programming and memoization, and complexity analysis for large inputs and edge-case handling within the Coding & Algorithms domain.

  • medium
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Detect words formed by multiple dictionary parts

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Given an array words of up to 100,000 non-empty lowercase strings (total characters ≤ 1,000, 000), return all strings that can be formed by concatenating at least two other strings from the same array. Component strings may be reused multiple times. Describe two approaches (hash-set with dynamic programming, and trie with DFS plus memoization), analyze time and space complexity, and explain how to avoid counting a word as itself unless it is split into smaller parts. Discuss edge cases such as very short words, repeated components, and large inputs.

Quick Answer: This question evaluates proficiency in string processing, selection and use of appropriate data structures and algorithms (hashing, tries), dynamic programming and memoization, and complexity analysis for large inputs and edge-case handling within the Coding & Algorithms domain.

Related Interview Questions

  • Schedule Priority Jobs with Cooldowns - Amazon (medium)
  • Find Paths Across a Weighted Binary Grid - Amazon (medium)
  • Implement Multi-Player Tic-Tac-Toe - Amazon (medium)
  • Compute Edit Distance - Amazon (medium)
  • Minimize Replacements So Equal Product Values Are Contiguous - Amazon (hard)
|Home/Coding & Algorithms/Amazon

Detect words formed by multiple dictionary parts

Amazon logo
Amazon
Sep 6, 2025, 12:00 AM
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
2
0

Given an array words of up to 100,000 non-empty lowercase strings (total characters ≤ 1,000, 000), return all strings that can be formed by concatenating at least two other strings from the same array. Component strings may be reused multiple times. Describe two approaches (hash-set with dynamic programming, and trie with DFS plus memoization), analyze time and space complexity, and explain how to avoid counting a word as itself unless it is split into smaller parts. Discuss edge cases such as very short words, repeated components, and large inputs.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

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

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

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.