PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates skills in binary-to-text data representation, bitmap rendering, and efficient string and array manipulation for output formatting.

  • Medium
  • Stripe
  • Coding & Algorithms
  • Software Engineer

Convert bitmap into ASCII characters

Company: Stripe

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

##### Question Given an array/string of 0-1 bits representing a bitmap font, write code to render each character as a grid using '.' for 0 and '#' for 1, and concatenate multiple characters to print whole words efficiently.

Quick Answer: This question evaluates skills in binary-to-text data representation, bitmap rendering, and efficient string and array manipulation for output formatting.

You are given a bitmap font and a text to render. The font is a mapping from single characters to a row-major bitstring of length width * height. Each bit '1' renders as '#', and each bit '0' renders as '.'. Render the given text by placing glyphs side-by-side, inserting exactly one '.' column between adjacent characters. The space character ' ' is treated as a blank glyph of width columns (all '.'). If any non-space character in text is missing from the font or has an invalid bitstring length, raise a ValueError. Return the rendered result as a list of height strings (top to bottom).

Constraints

  • 1 <= width <= 32
  • 1 <= height <= 32
  • 1 <= len(text) <= 10000
  • Each font entry's bitstring length is exactly width * height
  • Bits are only '0' or '1'
  • Space ' ' renders as a blank glyph of width columns (all '.')

Hints

  1. Interpret each glyph's bitstring in row-major order: rows of length width, from top to bottom.
  2. Build the output row-by-row: append each glyph's row to the corresponding output row, then add a '.' separator if not the last character.
  3. Cache decoded glyph rows to avoid repeated conversions when characters repeat.
Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Assign Reviewers from Changed Files - Stripe (medium)
  • Generate Account Email Notifications - Stripe (medium)
  • Calculate Transaction Fees - Stripe (medium)
  • Build an Account Transfer Ledger - Stripe (medium)
  • Implement Validation and String Compression - Stripe (hard)