FastPrepFind Palindrome Sub-string
Problems/Find Palindrome Sub-string

Find Palindrome Sub-string

Cisco logoCisco● MediumFULLTIMEINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

You are given a string inputStr. Find a substring that reads the same forwards and backwards (a palindrome).

  • Only substrings of length 2 or more count.
  • Return the longest such substring.
  • If several have the same longest length, return the lexicographically smallest one (the one that comes first in alphabetical order).
  • If there is none, return "None".

Function

findPalindromeSubString(inputStr: String) → String

Examples

Example 1

inputStr = "YABCCBAZ"return = "ABCCBA"

Given string is "YABCCBAZ", in this only sub-string which is same when read forward and backward is "ABCCBA".

Example 2

inputStr = "ABC"return = "None"

Given string is "ABC", and no sub-string is present which is same when read forward and backward. So, the output is "None".

Constraints

  • 1 ≤ inputStr.length ≤ 1000
  • inputStr contains only uppercase English letters (A to Z).

More Cisco interview questions

  • Check if a String Is a PalindromePHONE SCREEN · Seen Nov 2026
  • Find Unique ElementsPHONE SCREEN · Seen Nov 2026
  • First Letter to Appear TwicePHONE SCREEN · Seen Nov 2026
  • Middle of a Linked ListPHONE SCREEN · Seen Nov 2026
  • Reverse a Linked ListPHONE SCREEN · Seen Nov 2026
  • Reverse a StringPHONE SCREEN · Seen Nov 2026
  • Valid ParenthesesPHONE SCREEN · Seen Nov 2026
  • K-Step Bit Flip with RetentionPHONE SCREEN · Seen Nov 2026
  • Todo Task Manager OperationsONSITE INTERVIEW · Seen Oct 2026
  • Find the Duplicate Number Without Modifying the ArrayONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Longest Palindromic SubsequenceAXQ Capital · OA
  • Maximum Equal-Bit Pairs in a SubsequenceAmazon · OA
  • Longest Subsequence That Is a SubstringBooking.com · OA
  • Count Digit Replacements with No Equal Adjacent DigitsMicrosoft · OAMicrosoft interview questions
  • Palindrome CounterGoldman Sachs · OAGoldman Sachs interview questions
  • Longest String ChainVisa · OAVisa interview questions
  • Minimum-Cost Digit String DecodingSquadStack.ai · OA
  • Maximum Redundancy After One Segment FlipBloomberg LP · OABloomberg LP interview questions
  • Substrings Without a Target SubsequencePhonePe · OAPhonePe interview questions
  • Minimum Edit-Distance String for Each QueryTarget · OA
All Cisco interview questionsSee Cisco hiring insights
Saved
class Solution {
    public String findPalindromeSubString(String inputStr) {
      // write your code here
    }

}
Checking account…