-4

I started with React when function components were already widely established, so I never got to work much with class components and therefore don't know a lot about them. I would say the general feeling in the industry is also that class components are somewhat deprecated in favor of function components, and new projects are almost guaranteed to use those.

A company I'm interviewing at is putting me through a live coding "challenge". For the challenge, they present me with a dummy chat app codebase which consists entirely of class components, along with some WebSocket connection/disconnection logic in onComponentDismount etc. They then ask about what specific parts of the code do, and also ask to find and fix some bugs that they sprinkled around the code.

The difference between class and function components aren't huge, but the whole lifecycle (onComponent* vs. useEffect) and also how the state works (setState vs useState) have some subtle differences, and getting them wrong in an interview on accident if you're not very familiar with them can give off a bad impression. Also, extracting shared business logic into a hook is impossible with class components and I have no idea what the class component alternative would be.

I'm guessing since the company's developers deemed it acceptable to ask questions about class components, that their codebase is heavily invested into class components as well, therefore it is understandable that they are interested in testing the interviewee's class component knowledge. On the other hand, it doesn't do much justice to my otherwise quite good React knowledge if they only ask about a component style that I've never worked with, and frankly, is sort of obsolete in 2022.

Of course, I could sit down a couple of evenings and learn class components, but putting all of that work just for a coding challenge, passing which does not guarantee that I will get the job, seems like a disproportionate amount of effort, also considering that if I don't get the job, this knowledge is very unlikely to benefit me in other companies and projects, especially as the years go by.

I've mentioned my feelings to the HR guy, who obviously didn't understand much of it and told me to write down a couple of sentences that he would forward to the developers preparing the challenge for me. How would I suggest to the developers to focus on function components in the challenge instead in a polite way, without making it seem that I'm unfit for the position?

4
  • 1
    Keep in mind that "C" (not even "C++") regular shows up in the top 5 most popular programming languages. It's about 50 years old and has been made obsolete many times. And yet, there is a huge amount of code out there in the field and many people use it everyday. Only knowing the "latest and greatest" of today will not make you very employable.. Companies need people that can work on their existing code base and they not going to rewrite for every new flash in the pants IT trend that comes along.
    – Hilmar
    Commented Jul 10, 2022 at 18:52
  • 7
    So am I reading this correctly? You're presuming to tell a company which skillsets they need without having seen their code base or you're indicating that if their code base uses class components it's in some way inferior. I can't imagine this kind of arrogance is going to carry you much farther trig the process. Commented Jul 10, 2022 at 20:10
  • Honestly, this question needs to be made more generic. Commented Jul 11, 2022 at 12:12
  • Are you trying to tell that company how to run their business? I suggest you to have your own startup doing the business your way.
    – Nobody
    Commented Jul 15, 2022 at 14:03

5 Answers 5

15

I would suggest a slightly different approach. Rather than trying to get the company to change their challenge (which honestly, is pretty unlikely - they probably have a standard challenge they roll out to everybody and aren't going to rewrite it just for you), just explain what you've written here in terms of why you don't know class components - although tone the language down. It isn't going to help to describe their codebase as "sort of obsolete". In the challenge itself, you can ask sensible questions if there's things you don't understand and/or explain the assumptions you've made.

without making it seem that I'm unfit for the position?

There is a very real sense in which you are unfit for the position, or at the very least the position isn't a good fit for you. Their code is written in a style which you don't know, don't want to learn and are pretty scathing about. It's worth stepping back and considering if this is the job you want.

4
  • 5
    Also ask them about this at the interview. When given the opportunity say "I notice you've been asking about React class components rather than function components. I've worked primarily with function components which I find more effective. Does this mean your codebase uses mainly class components, and do you have any plans to change that? " Commented Jul 10, 2022 at 19:38
  • By "slightly different" you might mean "completely different". XD Commented Jul 10, 2022 at 20:11
  • @JoelEtherton It is much the same information, just with a different spin on it. Commented Jul 11, 2022 at 9:31
  • @PhilipKendall: Ask any electron - spin is everything. While the information remains largely the same, tone and objective completely change the narrative. For many people (likely OP though that may be an unfair judgment), that change is extremely difficult. I'm in full agreement with this answer. I just think the change in attitude and tone may be much harder than you indicate. Commented Jul 11, 2022 at 14:50
8

You don't get to choose what they test you on. They're asking you to demonstrate a particular skill, presumably because it's an important skill for the role that you're applying for. The fact that you know some other related paradigms is fine, but it's not what they're interested in. If you don't have those skills, you can either learn them (which may be useful more generally for your career), or look at other job openings.

The reality of development is that most projects are not on the bleeding edge, and a huge amount of developer effort goes into supporting existing codebases. In languages that move as fast as JS does, that means you often won't get to use the latest trendy features.

If that's not the kind of work you want to do, then this doesn't sound like the right job for you.

4

How would I suggest to the developers to focus on function components in the challenge instead in a polite way, without making it seem that I'm unfit for the position?

I don't think you can. As you yourself say if "their codebase is heavily invested into class components" then surely they want someone who knows class components well, even if it's just to migrate them to a newer way of doing things?

Just ask them if their codebase is heavily dependent on class components and explain you've haven't used them. If they say they are, then it sounds like that's a deal-breaker for you and walk away. Maybe they'll say it isn't but "we want someone who knows them" or "we have standard test, sorry, you have to do it" and then you can decide whether to proceed. And maybe they'll say "sure, here's a version using function components".

Whatever happens, it seems only fair to you and them to find out whether class component knowledge is a deal breaker for either of you.

4

I'm guessing since the company's developers deemed it acceptable to ask questions about class components, that their codebase is heavily invested into class components as well, therefore it is understandable that they are interested in testing the interviewee's class component knowledge. On the other hand, it doesn't do much justice to my otherwise quite good React knowledge if they only ask about a component style that I've never worked with, and frankly, is sort of obsolete in 2022.

Okay.. so for a little thought experiment let's say that they agree that testing you on class components isn't a good test of your React knowledge since you don't know it. They give you a test based on your own established knowledge and you pass it with flying colors and come away with a job offer and a spring in your step.

Day 1 at your new job rolls around and you arrive in the office to find (as you suspected) that their current codebase/architecture revolves heavily around class components. What's your plan?

Do you a) skill up on class components, b) tell all your new colleagues that they're doing it wrong, or c) explain to your new manager that you already told them you don't know class components and they shouldn't assign you any tasks involving them?

If your answer here is (b) or (c).. well, you're going to have a bad time. If it's (a) you're going to have to learn this way of working anyway to succeed at the job. I'm sure you're perfectly capable of doing that - but there's going to be a learning curve, and it's going to take a period of time before you're effective. Your manager and/or colleagues are maybe going to get frustrated at the situation. Maybe they're going to wonder if throwing out their perfectly reasonable strategy of testing for some basic knowledge of the methods they use before hiring wasn't the brightest idea. You aren't likely to be happy learning and using a technology that you've determined as not useful to your career going forwards and are going to resent them for "holding you back".

Option (a) can work out - if both parties are aware in advance that's going to be the plan and are happy to accept the skilling up phase, if not then basically it sounds like a bad time for all concerned.

Of course, I could sit down a couple of evenings and learn class components, but putting all of that work just for a coding challenge, passing which does not guarantee that I will get the job, seems like a disproportionate amount of effort, also considering that if I don't get the job, this knowledge is very unlikely to benefit me in other companies and projects, especially as the years go by.

This isn't an unreasonable line of thinking - but what you're missing here is that what this actually is about is not "should they change their coding test" but "should you be applying for this job". It's pretty clear that they're looking to recruit someone who already knows class components, and there's nothing wrong with that. Of course there's nothing wrong with you not wanting to be that person either - it just means that this isn't a match. And when you've got something that's fairly obviously not a good match before either side invests any significant time and effort why wouldn't you just walk away now? No harm, no foul.

0

I don't think there is a correct answer to your question.

But I think you should show your work to a friend (who has more experience with the deprecated way of doing things) before you send it back to them.

And no, I'm not even suggesting that you be deceitful about it. Once you're in front of the right person, you can tell that person what you did.

"Hey, I know this new api like the back of my hand, but since I have less experience with the older api, I had a friend look over my work (just in case)."

In other words, by saying this, you communicate the limits of your current knowledge, but you still show your willingness to work with the old stuff. And honestly, any hiring manager worth their salt will know that if you've mastered a new api, that you won't have any trouble mastering an older one (assuming you're enthusiastic enough to do so).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .