PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Validate near-palindrome and course prerequisite feasibility

Last updated: Mar 29, 2026

Quick Overview

These problems evaluate string-processing and graph-theoretic competencies, testing algorithmic reasoning about near-palindrome validation with edge-case handling and course-prerequisite feasibility via cycle and ordering concepts, and are commonly asked to assess correctness, efficiency, and robustness under input constraints.

  • medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Validate near-palindrome and course prerequisite feasibility

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

## Coding round (40 minutes): two problems You do **not** need to run code, but you should: - Explain your approach clearly. - Walk through the logic on examples. - Propose test cases and edge cases. ### Problem 1: Near-palindrome after deleting at most one character Given a string `s` containing lowercase English letters, determine whether `s` can become a palindrome after deleting **at most one** character. - **Input:** `s` - **Output:** `true` if `s` is already a palindrome or can be made into one by deleting at most one character; otherwise `false`. - **Constraints (typical):** `1 <= len(s) <= 1e5` ### Problem 2: Can all courses be completed? You are given: - An integer `n` representing courses labeled `0..n-1` - A list `prerequisites`, where each pair `[a, b]` means you must complete course `b` **before** course `a`. Determine whether it is possible to finish all courses. - **Input:** `n`, `prerequisites` - **Output:** `true` if there exists an ordering of all courses that satisfies prerequisites; otherwise `false`. - **Constraints (typical):** `1 <= n <= 1e5`, `0 <= len(prerequisites) <= 2e5`

Quick Answer: These problems evaluate string-processing and graph-theoretic competencies, testing algorithmic reasoning about near-palindrome validation with edge-case handling and course-prerequisite feasibility via cycle and ordering concepts, and are commonly asked to assess correctness, efficiency, and robustness under input constraints.

Related Interview Questions

  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)
  • Solve a Key-Door Corridor Maze - Meta (medium)
  • Solve Array Merge and Parentheses Cleanup - Meta (medium)
Meta logo
Meta
Dec 15, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
1
0

Coding round (40 minutes): two problems

You do not need to run code, but you should:

  • Explain your approach clearly.
  • Walk through the logic on examples.
  • Propose test cases and edge cases.

Problem 1: Near-palindrome after deleting at most one character

Given a string s containing lowercase English letters, determine whether s can become a palindrome after deleting at most one character.

  • Input: s
  • Output: true if s is already a palindrome or can be made into one by deleting at most one character; otherwise false .
  • Constraints (typical): 1 <= len(s) <= 1e5

Problem 2: Can all courses be completed?

You are given:

  • An integer n representing courses labeled 0..n-1
  • A list prerequisites , where each pair [a, b] means you must complete course b before course a .

Determine whether it is possible to finish all courses.

  • Input: n , prerequisites
  • Output: true if there exists an ordering of all courses that satisfies prerequisites; otherwise false .
  • Constraints (typical): 1 <= n <= 1e5 , 0 <= len(prerequisites) <= 2e5

Submit Your Answer

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 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • 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.