Facebook | Onsite | Markdown-Html converter

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2019-11-13Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: unknown
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

The question was to create a Markdown-Html converter.

Given the following input:
"This is a sample \\n"
"~~input~~.\\n\\n"
"> This is \\n"
"> a \\n"
"> blockquote.\\n\\n"
"Another paragraph.\\n\\n"

Generate this expected output:
<p>This is a sample <br /> <del>input</del></p>
<p><blockquote>This is <br /> a <br /> blockquote.</p>
<p>Another paragraph.</p>

Comments