PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Statistics & Math/Optiver

Compute permutations with repeated letters

Last updated: Mar 29, 2026

Quick Overview

This question evaluates combinatorics and counting principles within the Statistics & Math domain, focusing on permutations with repeated characters and the generalization to multiple symbol counts.

  • easy
  • Optiver
  • Statistics & Math
  • Software Engineer

Compute permutations with repeated letters

Company: Optiver

Role: Software Engineer

Category: Statistics & Math

Difficulty: easy

Interview Round: Take-home Project

Given two nonnegative integers m and n, how many distinct strings can be formed that contain exactly m copies of the character 'a' and n copies of the character 'b'? Provide the closed-form count and a short justification. Then generalize your answer to an alphabet with k distinct characters occurring with counts c1, c2, ..., ck (sum ci = N), and give the corresponding formula.

Quick Answer: This question evaluates combinatorics and counting principles within the Statistics & Math domain, focusing on permutations with repeated characters and the generalization to multiple symbol counts.

Related Interview Questions

  • Compute probabilities and expectations in random processes - Optiver (easy)
  • Solve probability and expectation problems - Optiver (hard)
  • Compute odds under time pressure - Optiver (medium)
  • Find next terms in sequences - Optiver (hard)
  • Plan for timed probability assessment - Optiver (medium)
Optiver logo
Optiver
Aug 13, 2025, 12:00 AM
Software Engineer
Take-home Project
Statistics & Math
4
0

Counting Strings with Repeated Characters

Problem

Given two nonnegative integers m and n, how many distinct strings can be formed that contain exactly m copies of the character 'a' and n copies of the character 'b'? Provide the closed-form count and a short justification.

Then generalize your answer to an alphabet with k distinct characters occurring with counts c1, c2, ..., ck (with c1 + c2 + ... + ck = N), and give the corresponding formula.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Statistics & Math•More Optiver•More Software Engineer•Optiver Software Engineer•Optiver Statistics & Math•Software Engineer Statistics & Math
PracHub

Master your tech interviews with 7,500+ 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.