Find a Local Minimum in One and Two Dimensions

Quick Overview

This Hudson River Trading software engineering question covers finding a local minimum in one and two dimensions. It prepares candidates to compare search strategies, reason about termination, and communicate correctness for nontrivial array and matrix prompts.

Find a Local Minimum in One and Two Dimensions

Company: Hudson River Trading

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Technical Screen

Given an array of unique numbers, return any element that is smaller than its neighbors. Then discuss the two-dimensional follow-up where you need to find a cell smaller than its adjacent neighbors. ### Constraints & Assumptions - For the 1D problem, neighbors are immediate left and right elements. - Boundary elements have only one neighbor unless clarified. - Array elements are unique. - For 2D, adjacency means up, down, left, and right. ### Clarifying Questions to Ask - Can boundary elements be local minima? - What should be returned: value or index? - Are all values unique in 2D? - Is O(log n) expected for 1D? - What constraints apply to the matrix? ### What a Strong Answer Covers ```premium-lock What a Strong Answer Covers ``` ### Follow-up Questions - How would duplicates change the solution? - How would you return all local minima? - Can 2D be solved with divide and conquer? - What if diagonal neighbors count too?

Quick Answer: This Hudson River Trading software engineering question covers finding a local minimum in one and two dimensions. It prepares candidates to compare search strategies, reason about termination, and communicate correctness for nontrivial array and matrix prompts.

|Home/Software Engineering Fundamentals/Hudson River Trading
Hudson River Trading logo
Hudson River Trading
Jul 2, 2026, 7:02 PM
hardSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
20
0

Given an array of unique numbers, return any element that is smaller than its neighbors. Then discuss the two-dimensional follow-up where you need to find a cell smaller than its adjacent neighbors.

Constraints & Assumptions

  • For the 1D problem, neighbors are immediate left and right elements.
  • Boundary elements have only one neighbor unless clarified.
  • Array elements are unique.
  • For 2D, adjacency means up, down, left, and right.

Clarifying Questions to Ask Guidance

  • Can boundary elements be local minima?
  • What should be returned: value or index?
  • Are all values unique in 2D?
  • Is O(log n) expected for 1D?
  • What constraints apply to the matrix?

What a Strong Answer Covers Premium

Follow-up Questions Guidance

  • How would duplicates change the solution?
  • How would you return all local minima?
  • Can 2D be solved with divide and conquer?
  • What if diagonal neighbors count too?
Loading comments...