FastPrepCount Repeated Characters in a String
Problems/Count Repeated Characters in a String

Count Repeated Characters in a String

Adobe logoAdobe● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: This problem counts the different letters that show up more than once in one string. It comes from an entry (a copy of a review) about a senior QA automation interview in Hyderabad, India, in April 2022 that ended without an offer. Besides this item, the entry's question list holds a parity check and two puzzles. Its account of round one names puzzles plus coding, so placing the items there is our reading. The item is a single phrase with no input rules, output form, limits or examples.

Our choices: the answer counts the different letters that appear at least twice. Each such letter counts once, not once per extra copy. The string holds 1 to 10^4 lowercase English letters. The examples are new.

Our version is about 75% the same as the reported question.

Given a string s, return how many different letters appear in it two or more times.

Each repeated letter counts once, no matter how many copies of it there are. For example, in "kayak" the letters k and a repeat and y does not, so the answer is 2.

Function

countRepeatedLetters(s: String) → int

Examples

Example 1

s = "abracadabra"return = 3

The letter a appears 5 times, b twice and r twice; c and d appear once. Three different letters repeat, so the answer is 3.

Example 2

s = "xyz"return = 0

Every letter appears once, so no letter repeats. The answer is 0.

Example 3

s = "zzzz"return = 1

Only one letter, z, and it appears 4 times. It counts once, so the answer is 1.

Constraints

  • 1 <= s.length <= 10^4
  • s consists of lowercase English letters only.

More Adobe Phone Screen questions

  • Evaluate a Parenthesized Integer ExpressionPHONE SCREEN · Seen Oct 2026
  • All Elements of Two BSTs in OrderPHONE SCREEN · Seen Aug 2026
  • Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
  • Binary Tree Level-Order Traversal by LevelsPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2026
  • Count Occurrences in a Sorted ArrayPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026
  • Count Pairs with Absolute Difference KPHONE SCREEN · Seen Jul 2026
  • Count Subsets with Sum KPHONE SCREEN · Seen Jul 2026
  • Numbers with Exactly Three DivisorsPHONE SCREEN · Seen Jul 2026
  • Sum of Even Nodes on a Path in a Numbered Binary TreePHONE SCREEN · Seen Jul 2026
  • Largest Value in Every Sliding WindowPHONE SCREEN · Seen Jul 2026

Similar questions at other companies

  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • First Letter to Appear TwiceCisco · PHONE SCREENCisco interview questions
  • Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Portfolio Valuation, Part 1Stripe · PHONE SCREENStripe interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Known Words Matching Phone DigitsLinkedIn · PHONE SCREENLinkedIn interview questions
  • First Non-Repeated CharacterDell Technologies · PHONE SCREENDell Technologies interview questions
  • Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
  • First Non-Repeating CharacterGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions

Interview reports that mention this question

  • Adobe Frontend and QA Interviews: 14 Experiences (Part 6 of 6)

Adobe interview experiences

  • Adobe Web, QA, DevOps, ML Roles: 13 Experiences (Part 3 of 3)
  • Adobe SWE Interviews, Level Unknown: 25 Experiences (Part 2 of 3)
  • Adobe Interviews, Level Unknown: 38 Experiences (Part 1 of 3)
  • Adobe New Grad MTS Interview Questions: 7 Experiences
  • Adobe ML/Research Intern Interviews: 12 Experiences (Part 4 of 4)
All Adobe interview questionsSee Adobe hiring insights
Saved
class Solution {
    public int countRepeatedLetters(String s) {
        // Write your code here.
    }
}
Checking account…