Samsara Interview Question

Given a string, write a function to convert it to HTML (markdown). A string like : 'This is a paragraph. -this is - a block quote This is another paragraph with a BOLD word.' Solution would be : <p>This is a paragraph.</p> <blockquote>this is </br> a block quote </blockquote> <p>This is another paragraph with a <strong>BOLD</strong> word. </p>

Interview Answer

Anonymous

Nov 10, 2019

Tried to look at it with a bigger picture by breaking it into separate paragraphs, then within the paragraphs look for other key identifiers such as '~', '-', '\n'

1