TikTok Interview Problem #5 — Check if a String Is a Palindrome|Interview Prep|Coding Challenge

41 Views
No Comments

Given a string s, return true if it is a palindrome, or false otherwise.

Input:
s = "aba"

Output:
true

This problem checks whether a string is a palindrome, meaning it reads the same forward and backward.

Typical approach:

  • Use two pointers, comparing characters from the beginning and end.
  • If all pairs match, return true; otherwise return false.

Runs in O(n) time and O(1) space (two-pointer approach).

The VOprep team has long accompanied candidates through various major company OAs and VOs, including Tiktok, Google, Amazon, Citadel, SIG, providing real-time voice assistance, remote practice, and interview pacing reminders to help you stay smooth during critical moments. If you are preparing for Tiktok or similar engineering-focused companies, you can check out our customized support plans—from coding interviews to system design, we offer full guidance to help you succeed.

END
 0