InterviewDB
Experience
Markup Processor: Parse and Render a Subset of Markdown to HTML
phone
Interview Experience
Round 1 Coding
Problem
Implement a markup processor that converts a simplified markdown string to HTML. Support: headers (#, ##, ###), bold (**text**), italic (*text*), and unordered lists (- item).
python
def markdown_to_html(md: str) -> str:
...
Example
md = """# Title
## Subtitle
Hello **world** and *everyone*.
- Item one
- Item two
"""
markdown_to_html(md)
# ->
# <h1>Title</h1>
# <h2>Subtitle</h2>
# <p>Hello <strong>world</strong> and <em>everyone</em>.</p>
# <ul><li>Item one</li><li>Item two</li></ul>
Follow-ups
- How do you handle inline formatting (
**bold**) that spans across what looks like a word boundary? - How would you support nested lists (indented
- subitem)? - What happens with malformed input like unclosed
**bold— how do you handle that gracefully? - How would you extend the processor to support hyperlinks in the format
[text](url)?
Full Details
Round 1 Coding
Problem
Implement a markup processor that converts a simplified markdown string to HTML. Support: headers (#, ##, ###), bold (**text**), italic (*text*), and unordered lists (- item).
python
def markdown_to_html(md: str) -> str:
...
Example
md = """# Title
## Subtitle
Hello **world** and *everyone*.
- Item one
- Item two
"""
markdown_to_html(md)
# ->
# <h1>Title</h1>
# <h2>Subtitle</h2>
# <p>Hello <strong>world</strong> and <em>everyone</em>.</p>
# <ul><li>Item one</li><li>Item two</li></ul>
Follow-ups
- How do you handle inline formatting (
**bold**) that spans across what looks like a word boundary? - How would you support nested lists (indented
- subitem)? - What happens with malformed input like unclosed
**bold— how do you handle that gracefully? - How would you extend the processor to support hyperlinks in the format
[text](url)?
Free preview. Unlock all Samsara questions →
About This Question
This is a candidate experience report from a samsara interview during the phone round.
More Samsara Interview Questions
InterviewDB
Samsara SWE Phone - Axis Permutation
InterviewDB
Command Parser: Parse and Dispatch Shell-Like Commands from User Input
InterviewDB
Samsara SWE Phone - Concurrent Meetings
InterviewDB
Engine States: Model a Vehicle Engine Using a Finite State Machine
InterviewDB
Engine Utilization: Compute and Report Resource Utilization Across Processing Engines