Limited Time Offer:Up to 20% off Hello Interview Premium
Up to 20% off Hello Interview Premium 🎉
Hello Interview
Your Dashboard
System Design
Code
Low Level Design
Behavioral
AI Coding
New
ML System Design
Salary Negotiation
Interview Guides
Blog
System Design
Low Level Design
AI Coding
Behavioral
New
Interview Questions
Success Stories
System Design
Low-Level Design
New
Ask The Community
Discord
Mock Interviews
1:1 Mentorship
Refer a Friend
Pricing
Sign in / Sign up
Search
⌘K
Pricing

Tutor

Count Special Palindromic Substrings

Given a string, count the number of special palindromic substrings where a special palindrome is defined as either having all identical characters or having all characters identical except for the middle character. Return the total count of such substrings that can be formed from the input string.

Asked at:

6sense


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Company
​
Level
All Regions
Region

Mid February, 2026

6sense

Senior

A string is a special palindrome string if either of two conditions is met: all of the characters are the same, all of the characters except the middle are the same. A special palindromic substring is any substring of a string which meets one of those criteria. Given determine how many special palindromic substrings can be formed from it. For example, given the string m, n, o, p, o, o, we have the special palindromic substrings: m, n, o, n, o, p, o, o, n, o, o, n, o, o, p, o, o. Find the count of special palindromic substrings in the given string.

Your account is free and you can post anonymously if you choose.

Hello Interview Premium

Recent interview questions
System Design Guided Practice
Exclusive content
Learn More
Questions
Meta SWE Interview QuestionsAmazon SWE Interview QuestionsGoogle SWE Interview QuestionsOpenAI SWE Interview QuestionsEngineering Manager (EM) Interview Questions
Learn
Learn System DesignLearn DSALearn BehavioralLearn ML System DesignLearn Low Level DesignGuided Practice
Links
FAQPricingGift PremiumHello Interview Premium
Legal
Terms and ConditionsPrivacy PolicySecurity
Contact
About UsProduct Support

7511 Greenwood Ave North Unit #4238 Seattle WA 98103


© 2026 Optick Labs Inc. All rights reserved.

6sense
6sense