All Questions
Tagged with palindrome interview-questions
17
questions
3
votes
2
answers
689
views
Calculate the largest palindromic number from the product of two 6-digit numbers (100000 to 999999)
Are there any efficient ways to solve this problem,
for example using bitwise operator?
...
3
votes
0
answers
229
views
Longest Palindrome Substring: Where is the dynamic programming? [closed]
In this LeetCode problem, Longest Palindromic Substring, it is listed under Dynamic Programming for Google interview preparation. My understanding of dynamic programming is roughly "recursion + ...
4
votes
2
answers
499
views
Longest Palindromic Substring better approach
I have encountered to this question and applied a brute force algorithm off top of my head and couldn't find a better optimized solution.
I was hoping I could get some insight to implement a better ...
3
votes
4
answers
3k
views
Find longest Palindrome substring
I am preparing for technical interview and I found this question on geeksforgeeks, but I did not understand their solution. So, I have written my own solution. I want to optimize this code.
...
13
votes
10
answers
8k
views
Tests for palindromes in C and C++
A question I've been asked on interactive phone screens is to code a test to determine whether a string is
a palindrome or not. I am providing two examples here: one in C and one in C++. They both ...
3
votes
1
answer
2k
views
Palindrome implementations - iterative and recursive
I got asked this palindrome question when the interviewer wants to make sure that my palindrome can check if "Taco! Cat!" is a palindrome. In this example, my palindromes implementation needs to ...
0
votes
1
answer
345
views
Checking if a number is palindrome or not in Java
Got this question in a technical interview and here is my solution:
...
12
votes
4
answers
12k
views
Palindrome-testing Java program for an interview
In an interview I was asked to write a function that would take an input word and return true if the word is a palindrome. At first I used an approach using ...
6
votes
2
answers
2k
views
Length of longest palindrome subsequence
I had an interview, where I was asked to solve to this question:
Given an string str, find the maximum length of palindrome subsequence.
Example: >if str = 'abcda':
maximum_length = 3 'aca'
How ...
4
votes
1
answer
3k
views
Find all sub matrices of type N*M in it which are palindromic
Today I had an interview, where I was asked to solve this question.
A \$N*M\$ matrix is called a palindromic matrix, if for all of its rows and columns, elements read from left to right in a row are ...
4
votes
1
answer
579
views
Improving time complexity of finding the longest palindrome in Python
The Longest Palindromic Substring challenge from InterviewBit:
Given a string S, find the longest palindromic substring in S.
where a "substring" must be contiguous, and in case of ties ...
3
votes
1
answer
3k
views
Faster palindrome checker in Java
I wonder if there could be a faster palindrome checker in Java. The best one I have is O(n/2) which is O(n) eventually:
...
0
votes
1
answer
2k
views
Determining whether a string can be rearranged into a palindrome
For a string, count the number of occurences of each character. If at most one character has odd count then the string can be a palindrome else it's not.
...
1
vote
2
answers
1k
views
Check if a linked list is a palindrome in O(n) time and O(1) space
I liked this problem because there are so many sub-problems that are interview problems in their own right-- (reverse linked list, find midpoint)
...
6
votes
1
answer
1k
views
Longest palindromic subsequence by memoization
I've written some code to solve the longest palindromic subsequence problem.
...