So few days ago I applied to a MNC and I had some interesting problems to solve in given amount of time. So let me share one with you, see if you c...
For further actions, you may consider blocking this person and/or reporting abuse
Yes I can solve the interview problem (as in, the problem with interviews in the industry in general!).
I would look at the person interviewing me dead in the eyes and ask "who hurt them". What made them think in any way this question remotely resembles something you would need to do in the real world?
I would look at them asking why on Earth they thought it was a good interview question, what skills it proved I had that I would need to learn and just generally ask them why we can't create an interview process that actually proves talent.
I would ask them what happened to our industry where they thought this question is remotely useful and then would slowly rise from my seat, thank them for the opportunity and walk to the door.
Just as the door is about to close I would say "And please can I have the 🍬 treat 🍬 you promised me for solving it" and walk away, still searching for a company that doesn't ask dumb interview questions. 😉🤣
Being Serious for a second, besides the dig at our industry and it's stupid interview practices it was a fun little brain teaser. Have a ❤🦄 for a nice morning wake up challenge!
Yeah, I would run away from there as fast as possible. Can't imagine what the interviewer could do, seems like a psychopath really.
Just kidding, but I agree, this is not the type of question we should be asking in an interview, it shows nothing of value for the real world. I think this is more of a practice exercise for begginers more than anything. Though it's a fun little problem
Actually it was really interesting
Because the like you'd finally decode would lead you to the next step of recruitment
Haha now this would make it more interesting as remote interview technique, you can only proceed to the next step if you can decode the link.
You could also make it time sensitive so if they take too long to complete the task the link expires!
Still hate questions like this (yet again, not a stab at you, just our industry), but that line of thinking, a "follow the breadcrumbs" type of coding interview, that is an awesome and fun idea 🤣
That's really cool, gamifing it and making it somewhat of a puzzle. I guess the complexity would increment as you solved more steps right?
Yup, that's quite cool actually, making the process a bit more fun.
If nothing is known about the URL beforehand, this seems underspecified. There are multiple valid URLs that can be constructed from the fragments.
Yields:
You can take those multiple URLs as a challenge as well
Like sending https request to see the status
Those are additional assumption about the URL, though:
Hey, I got the solution. The only thing is that I'm more familiar with python but the same logic applied in other languages too.
Great
Some people just want to see the world burn lol!!!!
Fun exercise nonetheless, here is what I came up with in 5 minutes. I did it in NodeJS though.
A couple of notes on the solution:
isValidUrlfunction to do so, without changing anything elseBut basically the logic is this:
Nice 💓
This is the worst implementation here, but it workd
Output:
A Perl solution I was able to write in less than 5 minutes:
Nice
Savage
This sounds like some of the 'oldschool' brain teasers (example: 'Why are manhole covers round?' -- which of course I answer 'because manholes are round, any other shape would be silly')
At least this is asking for you to code something vs. just ask if you know trivia.
Here's my not-so-fancy recursive solution :)
Outputs:
Convert the strings in each array element back to base64, then iterate through each possible combination until you find one that, converted back into a string, starts with http. This is aided by the fact the last array element will always end in ==.
You solved it? Great 👏
Have a treat 🍬
Sarcastic and snarky comments? 😜🤣
stop being so nice to me, my head won’t fit through the door 😉❤️
My solution:
codepen.io/d3skdev/pen/JjyMQBR?edi...
Seems like your code only works is it elements of array is in a particular order
I shuffled the array again and its not working
i see, please check my update
It works
Pro tip: you can optimize it by first getting the permutation of the array
Quick question, why did you use
sort(() => 0 - Math.random())?to reverse sort?
No, it shuffles the array elements. Basically he is shuffling the array again and again till he gets it right
I fail to see how this interview problem does anything other than play "stump the chump." Realistically interviews are about determining if a person's skills, and personality are a fit for the team, and the work being done. How does this accomplish any of that? I can't think of a single time that this scenario would be applicable to an actual project. And I am of the belief that at any interview, "you are interviewing them, as much as they are interviewing you." This would speak volumes to me as part of a terrible "Know-it-all" / gate keeper culture that I would not want to be a part of.
I don't want to code but is it...
?
Can probably shorten it by always putting the string with an equal sign at the end and just looping the rest.
Yes but there might be multiple valid URL tho
Actually it doesn't decode to dev.to/0shuvo0
And you won't know the expected URL beforehand
This was a fun problem I haven't crossed paths with before, please consider sharing more like this!
Many thanks.
🤣 “great minds think alike”…or is it “fools seldom differ”, I will go for “great minds” as I don’t want to drag you down with me 😜
Ignore the input and ddos their site with random urls until you find the correct url.
Personally I would decline to solve their challenge and show them source code I've written in the past, though honestly, this specific question sounds like a big red flag.
What a ridiculous interview question.
I sincerely hope nobody is being asked questions like this in interviews.
/ends
and don't even tell them about the problem at all
Solved it in 30 mins :)
That's great 🚤
Glad you liked it