twipped,
@twipped@twipped.social avatar

Tomorrow I have to interview a job applicant about their React experience, and I'm looking at #React interview question guides.

They're bullshit, it's all absolutely bullshit. Most of it is just testing if someone knows the term for a particular pattern.

> What is the difference between a controlled and uncontrolled component

WHO CARES!? If you code it right it doesn't fucking matter!

twipped,
@twipped@twipped.social avatar

> What is the VDOM?

Unless you are actually working in react internals, you don't need to know this.

Better question: What is the difference between a Component and an Element?

> What is Fiber?

Again, unless you're working in the internals, this is completely irrelevant.

Better question: How does the JSX that a component produces become content on the page?

twipped,
@twipped@twipped.social avatar

> How do you implement Server Side Rendering or SSR?

Easy, you don't. Don't look up guides, don't try to figure it out yourself, there are so many gotchas that you will never be successful. React on the server is horrible. Yes, even in Next. Don't do it.

> How do you enable production mode in React?

This isn't a React question, it's a bundler question, which is something you do once per project and never touch again until it breaks. Why are we asking this?

twipped,
@twipped@twipped.social avatar

> What is a switching component?

Seriously? Why did we need a term for this? It's an if statement, for fucks sake.

> Why shouldn't you use prop spreading?

That's just, like, your opinion, man!

> What are the advantages of React?

Compared to what?

> What are the limitations of React?

This question is cursed.

rick,
@rick@ricko.social avatar

@twipped

"In practical terms, what makes unit testing a React component different from unit testing a vanilla JS function or class?"

"Give an example of an app or site where SSR would be a great idea, an an example where it would be a horrible idea. For each, explain why."

"When adding dependencies to a useEffect call, what are the pros and cons of passing in an object versus passing in decomposed fields from that object?"

twipped,
@twipped@twipped.social avatar

@rick ooo, those are good!

rick,
@rick@ricko.social avatar

@twipped If the candidate can screen share, I love to do: "Pick an Open Source library you use regularly. Let's go find the source or API docs. Show me one thing you think is really clever about the library or its API. And what's one thing about it that you always forget or misremember or think is klunky?"

twipped,
@twipped@twipped.social avatar

@rick That's brilliant, love it.

twipped,
@twipped@twipped.social avatar

@rick I've come up with a code review trial. It's a basic tabs switcher composed of two components. There's a little bit of advanced react engineering in it, in the way I've used the Children toolset.

The code works, but I have deliberately written it badly, there's just a TON of really bad practices in it and ways it can break super easily. I'm gonna ask him to point out what's wrong, and fix it.

https://gist.github.com/Twipped/99c4cdb293c202b1f8c8c2b1d56cdfa2

rick,
@rick@ricko.social avatar

@twipped Seems pretty reasonable to me.

My own React skills are poor/new enough that I doubt I'd do well on that question. But it's a small enough code snippet that it's not overwhelming.

twipped,
@twipped@twipped.social avatar

@rick Yeah, there's a lot here I don't actually expect him to catch. That's why it'll be a fun exercise.

rick,
@rick@ricko.social avatar

@twipped But also: "Give an example of a case where CSS-in-JS is a good idea and explain why that's a total lie and the correct answer is never."

/troll

twipped,
@twipped@twipped.social avatar

@rick A few years ago I'd have agreed with that, I used to do a ton of tooling to enable css modules so that I didn't have to do css-in-js, but I've come to actually really like Emotion in the last two years. It's very powerful.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • react
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines