Asked inIQVIA,SDE-2

Palindromic Numbers Finder

Given an integer 'N', your task is to identify all palindromic numbers from 1 to 'N'. These are numbers that read the same way forwards and backwards.

Input:

The first line provides a single integer 'T', indicating the number of test cases.

Each test case contains a single integer 'N' located on a new line.

Output:

For each test case, print all palindromic numbers from 1 to 'N' in ascending order, separated by spaces.
Print the results for each test case on a separate line.

Example:

Input:
1
12
Output:
1 2 3 4 5 6 7 8 9 11
Explanation:

Every single-digit number qualifies as a palindrome, and additionally, the number 11 also qualifies as a palindrome.

Constraints:

  • 1 <= T <= 10
  • 1 <= N <= 10^9
  • Time Limit: 1 second
Note:

Your solution should not include printing logic, focus on implementing the function logic only.

AnswerBot
4mo

Implement a function to find all palindromic numbers from 1 to N.

  • Iterate from 1 to N and check if each number is a palindrome

  • Use string manipulation to check if a number is a palindrome

  • Consider single...read more

Help your peers!
Select
Add answer anonymously...
IQVIA SDE-2 Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits