PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates string-processing skills, the ability to count character multiplicities case-insensitively, and understanding of algorithmic time-complexity.

  • Medium
  • Meta
  • Coding & Algorithms
  • Data Engineer

Compute missing letters to form original string

Company: Meta

Role: Data Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Implement a function that, given two strings original and typed (typed is a misspelled/partial version of original), returns the number of additional letters that must be added to typed so that some rearrangement of typed equals original. Treat letters case-insensitively and count multiplicities. Examples: original = "Fiction", typed = "fin" -> 4; original = "reference", typed = "fence" -> 4. Aim for O(n) time using a character-frequency map.

Quick Answer: This question evaluates string-processing skills, the ability to count character multiplicities case-insensitively, and understanding of algorithmic time-complexity.

Return how many additional letters must be added to typed so its letters can be rearranged to cover original, case-insensitively.

Constraints

  • Inputs are Python literals matching the function signature.
  • Return a deterministic exact-match value.

Examples

Input: ('Fiction','fin')

Expected Output: 4

Explanation: Missing c,t,i,o.

Input: ('reference','fence')

Expected Output: 4

Explanation: Missing two r letters and two e letters.

Input: ('AaBb','bbaa')

Expected Output: 0

Explanation: Case-insensitive counts already match.

Hints

  1. Clarify edge cases before coding.
  2. Keep the return value deterministic.
Last updated: Jun 27, 2026

Loading coding console...

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.

Related Coding 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)