PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Maximize Letters from Disjoint Words

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of combinatorial selection, set-based constraints, and efficient representation and enumeration of candidate subsets, measuring competency in handling uniqueness constraints and optimizing an objective over a collection of strings.

  • medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Maximize Letters from Disjoint Words

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given an array `words` of lowercase English strings. Choose a subset of words such that: - each chosen word contains no repeated letter within itself, and - no letter appears in more than one chosen word. The score of a subset is the number of distinct letters covered by all chosen words combined. Return the maximum possible score. If multiple subsets achieve the same score, any one of them is acceptable. Example: - Input: the 12 month abbreviations such as `jan`, `feb`, ..., `dec` - The subset `{jan, feb, may}` is **invalid** because the letter `a` appears in both `jan` and `may`. - A valid answer must use words whose character sets are pairwise disjoint. Design an efficient algorithm. You may assume all characters come from the 26 lowercase English letters.

Quick Answer: This question evaluates understanding of combinatorial selection, set-based constraints, and efficient representation and enumeration of candidate subsets, measuring competency in handling uniqueness constraints and optimizing an objective over a collection of strings.

Related Interview Questions

  • Find Shortest Unique Prefixes - Meta (medium)
  • Compute Exclusive Execution Times - Meta (medium)
  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)
Meta logo
Meta
Dec 30, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
2
0
Loading...

You are given an array words of lowercase English strings. Choose a subset of words such that:

  • each chosen word contains no repeated letter within itself, and
  • no letter appears in more than one chosen word.

The score of a subset is the number of distinct letters covered by all chosen words combined. Return the maximum possible score. If multiple subsets achieve the same score, any one of them is acceptable.

Example:

  • Input: the 12 month abbreviations such as jan , feb , ..., dec
  • The subset {jan, feb, may} is invalid because the letter a appears in both jan and may .
  • A valid answer must use words whose character sets are pairwise disjoint.

Design an efficient algorithm. You may assume all characters come from the 26 lowercase English letters.

Submit Your Answer to Earn 20XP

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,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
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.