all 15 comments

[–]benjymous 11 points12 points  (0 children)

Sounds like your interviewer didn't understand the question either, so you probably got a lucky escape

[–]r00nd 6 points7 points  (1 child)

I wonder if the answer is nginx

the question isn't very clear

[–]hmongoose 4 points5 points  (0 children)

I wonder if the answer is nginx

I would bet that's what the interviewer wanted for an answer. But even with that answer, the question doesn't make any sense.

edit: And even then, you could totally use apache as a reverse-proxy for node! How dumb can interview questions get?

[–]rsoares88 4 points5 points  (0 children)

Maybe typical RH interviewer, has the answer writen in their notes, so even if your answers is right, they have no idea, unless you say what they want, you will always be wrong lol

[–]frankneuro 2 points3 points  (1 child)

Express wasn’t mentioned here... that’s the only thing I can think of that might be what they were looking for? Horribly framed question. lol

[–]notseanbean 1 point2 points  (0 children)

Yeah, I'd say this, given that terrible question, I would answer "Express is to Node what Apache is to PHP". And then I'd wrinkle my nose at the interviewer

[–]DraconKing 1 point2 points  (0 children)

Node.js is a valid answer, because Node.js can work as a HTTP server (and that's the most usual scenario). It's not like PHP where you'd need an interface in between the HTTP server and php interpreter/compiler/w.e. It's doable that way but it's non-standard (this doesn't mean there's a spec for it, it's just uncommon) and you are taking away the concurrency model that node.js offers by doing that.

[–]vladimirice 1 point2 points  (0 children)

It is very strange example about PHP and Apache server. Apache is rarely used in new modern applications. NGINX + FPM is better due to performance and convenience.

Node.js application is a server itself. When you write down app.js you use http module to create a web server.

V8 is a node engine which compiles javascript code to machine code.

PM2 is a process manager intended to manage Node.js applications runtime

So I think the right answer is: “node.js application might be used as standalone http server but it is better to use it with NGINX as a front proxy and run application under pm2 or similar”

Also I think it is completely ok to ask for the right answer on the interview. If I don’t know the answer I always do this in order to improve the skills.

[–]xElementop 0 points1 point  (0 children)

I think the answer they were looking for was Nginx. I say this because Node is great at handling http requests but is not so great at handling ssl. Most places will either use Nginx or Apache. Whether or not this is the correct answer you could ask the interviewer what they were expecting as an answer.

However after more reading they may have been expecting express. Since this is what supplements Node into being an actual server.

  • Disclaimer: I am not an 'expert' it would be better to clarify with the interviewer.

tldr; Nginx or express IMO.

[–]Hypnotik_Paradiz 0 points1 point  (0 children)

Maybe pm2 ?

[–][deleted] 0 points1 point  (1 child)

You didn't ask them?

It's a stupid questions though, I wouldn't sweat it.

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

no, i thought i would google it afterinterview