Check palindrome number and next palindrome
Company: Microsoft
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
## Problem
You are given a **non-negative integer** `n`.
1. Determine whether `n` is a palindrome in base-10 (it reads the same forward and backward).
2. **Follow-up:** Return the **smallest palindrome integer strictly greater than `n`**.
### Examples
- `n = 1221` → palindrome: `true`
- `n = 999` → palindrome: `true`
- `n = 132` → next palindrome: `141`
- `n = 9` → next palindrome: `11`
- `n = 10` → next palindrome: `11`
### Input / Output
- Input: integer `n`
- Output:
- Part (1): boolean
- Part (2): integer
### Constraints (assume)
- `0 ≤ n ≤ 10^18` (so solutions should not rely on converting to a fixed-size 32-bit int)
- The follow-up should be efficient for large `n` (avoid incrementing one-by-one).
Quick Answer: This question evaluates understanding of numeric and string manipulation along with algorithmic problem-solving for palindrome detection and generation, including handling large integers and edge cases.