Skip to main content

All 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? ...
Selman Keskin's user avatar
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 + ...
Scott Skiles's user avatar
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 ...
Ugur Yilmaz's user avatar
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. ...
coder's user avatar
  • 2,449
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 ...
pacmaninbw's user avatar
  • 24k
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 ...
NinjaG's user avatar
  • 2,469
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: ...
user avatar
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 ...
smartname1's user avatar
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 ...
Harsha's user avatar
  • 1,291
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 ...
Harsha's user avatar
  • 1,291
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 ...
Mona Jalal's user avatar
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: ...
Mona Jalal's user avatar
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. ...
saneGuy's user avatar
  • 363
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) ...
WinchenzoMagnifico's user avatar
6 votes
1 answer
1k views

Longest palindromic subsequence by memoization

I've written some code to solve the longest palindromic subsequence problem. ...
rookie's user avatar
  • 1,233

15 30 50 per page