Decide palindrome within k deletions
MetaSoftware Engineer · Technical ScreenLast updated
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Decide palindrome within k deletions states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Given a string s and integer k, decide whether s can be transformed into a palindrome by deleting at most k characters. Provide an algorithm to compute the minimum number of deletions required to make s a palindrome and compare it with k. Discuss a DP solution and its time/space trade-offs, and outline optimizations for large inputs.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.