Tech IndustryNov 4, 2019
Expedia Groupgetmesfjob

Got asked LC hard for Samsara phone

Basically i had a phone interview. The interviewer told me there will be 2 questions and i should complete both in 30 minutes. I couldn't even complete the first question. To me it's an LC Hard but i feel like i missed something out. Basically i approached in an iterative way where for everything nested i push it to a stack then process it. Obviously didn't have time to finish it all. Someone on here told me this is a simple OOP question but I don't see how. What am I missing here? This is the question: We're going to build the beginnings of a markdown processor. Markdown is a markup language that allows you to easily create HTML. > > We ll provide some sample input and desired output. Dont worry too much about edge cases, but feel free to ask if you re unsure or think there s something we ought to consider. Part 1 A markdown processor is capable of handling a multitude of string to html tag formats. For now, we just want to focus on supporting <p/>, <br/>, <blockquote/>, and <del/> tags. Input: String input = "This is a paragraph with a soft\n" + "line break.\n\n" + "This is another paragraph that has\n" + "> Some text that\n" + "> is in a\n" + "> block quote.\n\n" + "This is another paragraph with a ~~strikethrough~~ word."; Expected Output: "<p>This is a paragraph with a soft<br />line break.</p> <p>This is another paragraph that has <br /> <blockquote>Some text that<br />is in a<br />block quote</blockquote> </p> <p>This is another paragraph with a <del>strikethrough</del> word.</p>" Note: It's not important to produce this specific output! We only care if the HTML is valid. */

Add a comment
Uber fijdejbwbe Nov 4, 2019

lol that is not LC hard

Expedia Group getmesfjob OP Nov 4, 2019

The closest one i found is https://leetcode.com/problems/tag-validator/

Expedia Group getmesfjob OP Nov 4, 2019

It's also very similar to calculator which is also LC hard

Walmart tinG18 Nov 4, 2019

That is definitely not LC hard. Just looks like replacing characters lol...

Expedia Group getmesfjob OP Nov 4, 2019

How do you do a nested one?

Walmart tinG18 Nov 4, 2019

Using a stack?

Northrop Grumman sad-panda Nov 4, 2019

Use of a stack. More like LC med or easy. Similar to parentheses bracket question. With tokenization and character replacements.

Amazon ๐Ÿ’ฒ|| ๐Ÿ‘‹๐Ÿ‘‰ Nov 4, 2019

This โ˜๏ธ

Expedia Group getmesfjob OP Nov 5, 2019

I find them quite different. I don't usually deal with string replacement. So i went ahead with character processing and storing them in a string. How do you exactly solve this?

Salesforce heimer Nov 4, 2019

Definitely not LC hard.

Capital One not_Rich Nov 4, 2019

i had this on onsite and solved with recursive function very quickly, got offer

Intel leetp Feb 7, 2020

How did you solve it? Can you share your solution logic?

Ease blindDarius Mar 14, 2020

nice bro sick tip didn't even drop tc smh

ViaSat uqxi77 Nov 5, 2019

Was asked the same question this week. Itโ€™s not a hard question but itโ€™s time consuming. Ran out of time as well.

Microsoft Dlva04 Nov 6, 2019

Sorry to be rude but perhaps your definition of leetcode hard and what their definition of hard are an order of magnitude different. GL on your recruiting.

Samsara barbell3 Nov 9, 2019

Donโ€™t listen to the haters , this question is confusing and very easy to over think

Salesforce TC:๐Ÿฅœ Jan 14, 2020

Got asked this as well. Interesting that at the end the interviewer said "don't worry about this question we're still calibrating it".

Rally Health KlkM66 May 3, 2021

Does anyone have a solution to this?