Longest Increasing Subarray After Changing One Element
Asked at Google · Coding & Leetcode-style Questions · Difficulty: Medium
You are given an array of integers. You may change at most one element to any integer you like (negative, zero or positive, with no limit), or leave the array unchanged. After that, find the longest strictly increasing contiguous subarray and report its length. Choose the change that makes this length as large as possible.
Loading the problem…
More Google interview questions
- LLM conceptual questions
- Implement a Nested Tic-Tac-Toe Game Engine
- ML Fundamentals Deep Dive (AI/ML & MLE Roles)
- ML System Design: Recsys, Chatbot, Image Classifier
- ML Coding: Implement a Simple Attention / Layer Forward Pass
- Longest-Match Greedy Tokenization with Dictionary ID Replacement