PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Coding & Algorithms/Meta

Solve palindrome-check and vertical-order traversal

Last updated: Mar 29, 2026

Quick Overview

This prompt evaluates string-processing and tree-traversal competencies by asking whether a string can become a palindrome after at most one deletion and by requiring a vertical-order traversal of a binary tree, testing understanding of palindrome properties, node ordering, and handling of edge cases in the coding and algorithms domain.

  • easy
  • Meta
  • Coding & Algorithms
  • Software Engineer

Solve palindrome-check and vertical-order traversal

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

You are asked to solve **two separate coding questions**. You do not need to run code; be prepared to explain your approach and walk through examples. ## Question 1: Near-palindrome with one deletion Given a string `s`, determine whether it can become a palindrome after deleting **at most one** character. - **Input:** a string `s` (consisting of lowercase English letters) - **Output:** `true` if `s` can be made a palindrome by removing 0 or 1 character; otherwise `false` - **Constraints (typical):** `1 <= len(s) <= 1e5` **Example:** - `s = "abca"` → `true` (delete `'b'` or `'c'`) - `s = "abc"` → `false` ## Question 2: Binary tree vertical order traversal Given the root of a binary tree, return its **vertical order traversal**. Define a node’s **column** as follows: - Root is at column `0` - Left child is column `col - 1` - Right child is column `col + 1` Return a list of columns from **leftmost to rightmost**. Within each column, list nodes in **top-to-bottom** order. If multiple nodes share the same row and column, order them in the same order they would appear in a **level-order (BFS) traversal from left to right**. - **Input:** `root` of a binary tree - **Output:** `List[List[int]]` (values grouped by column) - **Constraints (typical):** up to `1e4`–`1e5` nodes **Example:** For the tree: - `3` as root - left child `9`, right child `8` - `9` has children `4` and `0` - `8` has children `1` and `7` Vertical order output: - `[[4], [9], [3, 0, 1], [8], [7]]` Explain your algorithm and its time/space complexity.

Quick Answer: This prompt evaluates string-processing and tree-traversal competencies by asking whether a string can become a palindrome after at most one deletion and by requiring a vertical-order traversal of a binary tree, testing understanding of palindrome properties, node ordering, and handling of edge cases in the coding and algorithms domain.

Related Interview Questions

  • Solve Two Backtracking Array Problems - Meta (hard)
  • Find a String Containing Another - Meta (medium)
  • Solve Subarray Sum and Local Minimum - Meta (hard)
  • Validate abbreviations and brackets - Meta (medium)
  • Solve Two String Problems - Meta (medium)
Meta logo
Meta
Oct 13, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
0
0

You are asked to solve two separate coding questions. You do not need to run code; be prepared to explain your approach and walk through examples.

Question 1: Near-palindrome with one deletion

Given a string s, determine whether it can become a palindrome after deleting at most one character.

  • Input: a string s (consisting of lowercase English letters)
  • Output: true if s can be made a palindrome by removing 0 or 1 character; otherwise false
  • Constraints (typical): 1 <= len(s) <= 1e5

Example:

  • s = "abca" → true (delete 'b' or 'c' )
  • s = "abc" → false

Question 2: Binary tree vertical order traversal

Given the root of a binary tree, return its vertical order traversal.

Define a node’s column as follows:

  • Root is at column 0
  • Left child is column col - 1
  • Right child is column col + 1

Return a list of columns from leftmost to rightmost. Within each column, list nodes in top-to-bottom order. If multiple nodes share the same row and column, order them in the same order they would appear in a level-order (BFS) traversal from left to right.

  • Input: root of a binary tree
  • Output: List[List[int]] (values grouped by column)
  • Constraints (typical): up to 1e4 – 1e5 nodes

Example: For the tree:

  • 3 as root
  • left child 9 , right child 8
  • 9 has children 4 and 0
  • 8 has children 1 and 7

Vertical order output:

  • [[4], [9], [3, 0, 1], [8], [7]]

Explain your algorithm and its time/space complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Software Engineer•Meta Software Engineer•Meta Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.