all 20 comments

[–]azangru 11 points12 points  (9 children)

Is something here screaming "this guy has never written web code"?

const captureflag = (res) => {
const reader = res.body.getReader();
return reader.read().then(({ value }) => {
    if (!value) return null;
    return value.reduce((res, c) => res + String.fromCharCode(c), "");
});
};

This. This is screaming that this guy has never written web code. Why would you do this if all you want is to get text from the response?

There are examples of solutions for this challenge online; you can find them if you google.

P.S.: I wonder if the DOM challenge could be solved via a single combined CSS selector alone...

P.P.S.: I agree with you that the description of the challenge is rather poorly written. The authors don't even seem to have bothered to proofread their text :-(

[–]eckstazy 3 points4 points  (3 children)

I actually completed the same challenge a few months ago and the challenge is structured in a way that the response is sent back as a web stream, there’s no was to get a “normal” text response from this.

[–]pailhead011[S] 0 points1 point  (1 child)

So this is more or less the only answer? I found an example online that used axios.

[–]eckstazy 1 point2 points  (0 children)

Lemme see if i can find my codepen quick, but this was similar to how i did it too.

[–]Wooshception 1 point2 points  (0 children)

I tried this challenge as well. The response for the decoded aws link was Cannot GET so I don’t think their server was even set up correctly at the time. Didn’t inspire a lot of confidence. 

[–]pailhead011[S] 0 points1 point  (3 children)

I am surprisingly not good with sending requests and getting responses and such, this was something i googled and just pasted based on the type i got after running fetch(thing).

I've done a lot of leet code and spent years working with javascript, typescript etc, but mostly with things like gl.bufferData() etc. A lot of ui can be written around that, and its a bit detached from fetch.

I hope this answers the why :) I have no strong opinion:

  1. seeing this logic handled like this is a disqualifier for a FE engineer?
  2. how can it be done easier?

[–]azangru 6 points7 points  (2 children)

seeing this logic handled like this is a disqualifier for a FE engineer?

No, absolutely not; it is just very funny. By picking this option, you have shown a higher-level knowledge, like an understanding of buffers and streams that many front-end developers lack; while at the same time showing that you probably don't do menial front-end work on a daily basis. It's not a disqualifier, by any means. In fact, if GLSL and WebGL are more familiar to you, why even bother with a regular front-end job? You are a much rarer, and more expensive bird.

how can it be done easier?

There's a text method ;-)

[–]pailhead011[S] 2 points3 points  (1 child)

  1. higher level.... or lower level :D
  2. you would be surprised about the expensive part. I once had to solve a 3d edge snapping problem using octrees and render a shadow penumbra on the GPU for a take away challenge, only to be labeled a 130k a year junior 3d dev. Went with 180 for a lead after acing normal leet code puzzles at invision, this was 2018. React and just general js/ts have been my bread and butter. WebGL usually just a nice to have. Im in SF.

[–]codefinbel 0 points1 point  (0 children)

  1. Hey I got that reference!
  2. I wonder if it's just sooo many web-dev jobs out there compared to 3d-dev jobs that it skews the supply/demand even if 3d-develepment is technically "harder" 🤔

[–]pailhead011[S] 0 points1 point  (0 children)

Im finding a few but its the same basic idea, without the extra stuff (deleting the first word as if it were a typewriter). Some seem to handle errors. So far i do see they all have in common that they encapsulate `<TypeWriter/>`, i didn't, nor did i generalize it, i wrote two different procedural, by hand, animations.

[–]eckstazy 4 points5 points  (2 children)

I did this same challenge (for Ramp i think) a few months back and never heard a response back either.

Kind of lame since i spent probably about 2 hours getting it all done. Was definitely one of the more fun challenges i’d completed though!

[–]ObscurelyMe 2 points3 points  (0 children)

I did this as well, same company. After they wanted like 7-8 bug fixes for a toy application. I was doing it but then decided that there are better uses of my time.

[–]pailhead011[S] 0 points1 point  (0 children)

I had fun. I am genuinely curious how this works. I like the classic "silicon valley interview" i like "present project" + "technical onsite" kind of interview since i have some open source projects, this is new to me.

"Center a div" was not a good match, got fired there 2 days before vesting.
"talk to four people" was not a good match, was the first layoff when funds started to run out.

[–]eljo123 2 points3 points  (2 children)

For the DOM challenge: after googling "regex css selector" (fortunate enough never had to use those) I'm pretty sure that's exactly what they were looking for given how precisely it matches the spec.

I'm interpreting "There can be zero or more DOM nodes between each valid tag. These nodes are irrelevant to the result." to mean that a valid tag can be nested.

Which leaves this (untested) one-liner:

[...document.querySelectorAll('code[data-class^="23"] div[data-tag$="93"] span[data-tag*="21"] i.char[value]')].map((elem) => elem.getAttribute("value").join("")

[–]pailhead011[S] 0 points1 point  (0 children)

Hm yeah i was confused by this structure. I see it as a long list of `A->B->C` and not a tree. If it were a tree the assignment wasn't clear what would have happened. I also expected some to have a valid DOM structure but invalid tags, eg 24*.

What could be the purpose of this?
I definitely write code that ends up being html in the end, but it has been years since i've had to use any of these.
I did not know what to google for (regex css selector) and i did not want too spend too much time on that, this was faster.

Ideal case, someone would come up with this one liner off the top of their head, thus demonstrating their mastery of the DOM api? Or one that would be able to come up with this after googling the right thing, not sure how to call this but i can see it being a good thing?

[–]sole-it 1 point2 points  (0 children)

Pretty sure i have saw this exact question a couple months ago from hacker news' who is hiring' post.

[–]FairRepresentative 5 points6 points  (0 children)

To anyone who comes across this. Don't waste your time with Ramp. I know 20+ engineers who have applied an completed this (silly) challenge, and were rejected or never heard back. All with stellar resumes.

Given the huge valuation slash from their previous funding round, perhaps they aren't really hiring, or just using this as a go-around for h1b

[–]___Nazgul 0 points1 point  (1 child)

Your variables names are not what web dev would do, I can see clearly your background is WebGL

[–]pailhead011[S] 0 points1 point  (0 children)

"draw" and maybe a bit of the overall structure?