Remap Logical Core Columns Around Defective Cores Per Row

Last updated: November 29, 2026

Quick Overview

A wafer has rows of physical cores, each `width` wide, and some cores in each row are defective. Given the logical width the compiler needs, return for every row the physical column that backs each logical column (skipping defects in order), or None if any row has too few good cores.

Cerebras
Coding & Algorithms
Software Engineer
Cerebras
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


A wafer has rows of physical cores, each `width` wide, and some cores in each row are defective. Given the logical width the compiler needs, return for every row the physical column that backs each logical column (skipping defects in order), or None if any row has too few good cores.

Wafer-scale chips are only manufacturable because spare cores let the hardware hide defects behind a uniform logical grid. A phone screen version of this checks that you can turn that idea into clean, correct array code and reason about the failure case.

What the Interviewer Expects
  • Clarifies whether order of logical columns must be preserved (it must, so neighbors stay adjacent)
  • Builds each row's mapping in one pass over physical columns
  • Returns a clear failure value when a row lacks enough good cores
  • States O(rows x width) time and why it is optimal
  • Mentions that preserving order keeps logical neighbors physically close
Key Topics to Cover
arrays
defect tolerance
mapping
wafer-scale redundancy
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
  • What if the logical grid also needs columns to line up vertically so north-south links stay short?
  • How would you minimize the worst-case physical distance between logical neighbors?
  • How would you handle defective links rather than defective cores?
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

Input: width physical columns per row, logical_width columns the program needs, and defects[r], a set of bad physical columns for row r. Output: a list per row of length logical_width where en...

High-Level Design

Each row is independent. Walk physical columns left to right, keep the good ones, and take the first logical_width. Any good cores past that are spares that remain unused. Taking the leftmost good c...


Submit Your Answer
Markdown supported

Related Questions