← Back
00:00

BitFont Renderer

Stripe interview questions · Medium · Coding round · reported 10× · 7 tests

In a bitmap font, every supported character is drawn as its own bitmap - a grid whose rows contain 0s and 1s. You receive the font as two arrays of equal length: the bitmap at bitmaps[i] belongs to the character characters[i].

To draw a word, lay the bitmaps of its characters next to each other from left to right, without inserting any spacer columns. Assemble the picture one output row at a time, and finally turn each 0 into '.' and each 1 into '#'.

Interface

renderWord(
  characters: string[],
  bitmaps: number[][][],  // bitmaps[i] is a 2D 0/1 grid for characters[i]
  text: string,
): string[]

Requirements

Idle