Spatial Focus Navigation for a Controller-Driven Tile Grid

Last updated: November 29, 2026

Quick Overview

Given the screen rectangles of focusable tiles, the currently focused tile, and a D-pad direction, return the tile that should receive focus next, or None if nothing lies in that direction.

PlayStation
Coding & Algorithms
Frontend Engineer
PlayStation
November 29, 2026
Frontend Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given the screen rectangles of focusable tiles, the currently focused tile, and a D-pad direction, return the tile that should receive focus next, or None if nothing lies in that direction.

The PS5 home screen, Store and PlayStation App TV experiences are navigated with a controller, and the UI framework is built with React and TypeScript, so spatial navigation logic is core client work. The interviewer checks a sensible scoring rule, clean geometry, and awareness of the UX edge cases that make D-pad navigation feel right.

What the Interviewer Expects
  • Filter candidates to those whose center lies strictly in the pressed direction
  • Score by primary-axis distance plus a weighted orthogonal offset
  • Break ties deterministically
  • Discuss irregular layouts such as a wide banner below a row
  • Mention focus memory when returning to a row
Key Topics to Cover
Geometry
Spatial navigation
Scoring heuristics
Accessibility
10-foot UI
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • When the user goes down then up again, they expect to return to the same tile; how would you add focus memory?
  • How would you make this fast for a screen with thousands of virtualized tiles?
  • How would you handle wrap-around at the end of a horizontal rail?
  • How would you test navigation behavior without a real controller?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Tiles are id -> (x, y, w, h) with y growing downward. Given a current id and one of up, down, left, right, return the best next tile. A tile is a candidate only if its center is strictly further in ...

High-Level Design

For each candidate compute primary (distance along the pressed axis) and ortho (absolute offset on the other axis). Score primary + 2 * ortho, weighting misalignment so pressing right prefers th...


Submit Your Answer
Markdown supported

Related Questions