PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Maximize concatenation length with unique chars

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of string manipulation, set-based uniqueness constraints, and combinatorial subset selection for maximizing concatenation length.

  • medium
  • Meta
  • Coding & Algorithms
  • Machine Learning Engineer

Maximize concatenation length with unique chars

Company: Meta

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

## Coding: Maximum-length unique-character string You are given an array of strings `arr`. You may choose **any subset** of these strings and concatenate them in any order. The resulting concatenated string must contain **only unique characters** (i.e., no character appears more than once in the final string). Return the **maximum possible length** of such a concatenated string. ### Notes / constraints - Strings contain lowercase English letters `a`–`z`. - You cannot reorder characters *within* a string, but you may choose the order of concatenation by choosing strings in some order. - If a string contains duplicate characters internally (e.g., `"aa"`), it can never be part of a valid concatenation. ### Example - Input: `arr = ["un","iq","ue"]` - Output: `4` (choose `"un" + "iq"` or `"iq" + "ue"`)

Quick Answer: This question evaluates understanding of string manipulation, set-based uniqueness constraints, and combinatorial subset selection for maximizing concatenation length.

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
Feb 11, 2026, 12:00 AM
Machine Learning Engineer
Onsite
Coding & Algorithms
2
0
Loading...

Coding: Maximum-length unique-character string

You are given an array of strings arr.

You may choose any subset of these strings and concatenate them in any order. The resulting concatenated string must contain only unique characters (i.e., no character appears more than once in the final string).

Return the maximum possible length of such a concatenated string.

Notes / constraints

  • Strings contain lowercase English letters a – z .
  • You cannot reorder characters within a string, but you may choose the order of concatenation by choosing strings in some order.
  • If a string contains duplicate characters internally (e.g., "aa" ), it can never be part of a valid concatenation.

Example

  • Input: arr = ["un","iq","ue"]
  • Output: 4 (choose "un" + "iq" or "iq" + "ue" )

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Machine Learning Engineer•Meta Machine Learning Engineer•Meta Coding & Algorithms•Machine Learning 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.