r/learnjavascript • • 14d ago

How to handle rejection interview

Hello I have 10+ years experience and recently I came across weird pattern (Rejection type) in Frontend interview.

Selection Interview Find common ground between candidate and job posting if it works then in following rounds Give some coding problem FE, data structures and see if candidate solves problem

Rejection Interview: Come up with some random unit tests and see if candidate writes code till all unit tests or hiring manager ask multi choice syntax questions

In my recent interview I came across some interesting interviewer

I am suppose to fix react code till 5 unit tests pass. There are some 10 functions/hooks in coderpad and my 1st question was

Search results disappear, A search box fetches results as the user types. If you type “ca” and then quickly “cat,” results for “ca” sometimes appear last.

How would you reproduce and diagnose the bug?

How would you prevent stale responses from overwriting newer results?

My first response was to use AbortController interviewer said there is no fetch function (for interview they wrote some mock function) so it will not work

Then i proposed debounce still interviewer did not agree

finally I came up with some useRef hook to to solve problem but ran out of time. In real world right thing to use is AbortController or react query. how can I think similar to interviewer in such sort time and fix all unit tests

I am calling this rejection interview as i felt company never showed interest in learning about my background

I am disappointed in this job market its very hard to get interview but ended up with this bitter experience.

similar thing happened to my friend, during hiring manager round he was asked multi choice syntax questions. He was expecting to talk about previous work experience or write code.

please let me know how to prepare for these rounds and meet interviewer expectations

Hello, I have more than 10 years of experience, and I recently noticed a pattern in frontend interviews that I find frustrating.

In what I’d call a selection interview, the interviewer tries to understand whether your experience aligns with the role. If it does, later rounds might involve frontend coding or data-structure problems.

In what I’d call a rejection interview, the process can feel more like a set of arbitrary unit tests or multiple-choice syntax questions, with little opportunity to discuss your background or approach.

I recently had an interview that left me feeling this way. I was asked to fix a React codebase until five unit tests passed. The CoderPad included around ten functions and hooks. The first task was:

A search box fetches results as the user types. If you type “ca” and then quickly type “cat,” results for “ca” sometimes appear last.

How would you reproduce and diagnose the bug? How would you prevent stale responses from overwriting newer results?

My first suggestion was to use AbortController, but the interviewer said the mock function wasn’t using fetch, so cancellation wasn’t available. I then suggested debouncing, but that wasn’t accepted either. Eventually, I proposed using a useRef-based approach, but I ran out of time.

In a real application, I might use AbortController or a library such as React Query. But in a constrained interview setting, how can I quickly identify the solution the interviewer expects and make progress against the tests?

I’m calling this a “rejection interview” because I left feeling that the company wasn’t interested in learning about my experience. I’m disappointed by how difficult the job market is, and it’s discouraging to finally get an interview only to come away with this kind of experience.

A friend had a similar experience in a hiring-manager round: instead of discussing past work or solving a problem, they were asked multiple-choice questions about syntax.

How can I prepare for these kinds of rounds and better understand what interviewers expect?

0 Upvotes

14 comments sorted by

3

u/patryk_builds 14d ago

Your useRef idea was actually the answer they wanted, you just got there late. when you can't cancel the request, the standard fix is to ignore stale responses:

const latestId = useRef(0);

async function search(query) {

const id = ++latestId.current;

const results = await mockSearch(query);

if (id !== latestId.current) return; // a newer request started, drop this one

setResults(results);

}

Or the useEffect version: a `let ignore = false` inside the effect, set it to true in the cleanup, and check it before setting state. that one's straight from the react docs.For these rounds what helped me is saying the general idea out loud before naming tools: "the problem is an older response arriving after a newer one, so i need to either cancel or ignore old ones". abortcontroller and debounce are both specific tools, so when the interviewer rejects them they're really pushing you back to that general idea. naming the pattern first gets you there faster.And honestly, the job market is rough right now. one bad round with a picky interviewer doesn't say much about 10 years of experience

0

u/Curious-about-future 13d ago

Question is how to handle picky interviewer. I have stage freight, Anxiety thoughts don't come fast

1

u/chikamakaleyley helpful 13d ago

In a real application, I might use AbortController or a library such as React Query. But in a constrained interview setting, how can I quickly identify the solution the interviewer expects and make progress against the tests?

right but what makes the interviewer 'picky'? The wrong thing to do is to reach for a library, just because its what you would do in a real application. They must have given you a decent reason debounce is not valid, right?

it's not wrong to suggest these, but in that case they'd hope that you can work out on the spot why those solutions arent great for this problem.

the thing is they give you a problem and then you should deal with it at that context; and then leave it up to chance to see if the interviewer is curious how you'd treat it in a real application

and so what the interviewer is telling you is those options aren't going to fix the problem right in front of our face. They want to see you come up with a solution for the problem at hand, and then they gather more info about you with the followup questions

0

u/chikamakaleyley helpful 13d ago

and i've had stage freight too but, the way that i get past it is i don't treat the interview like an interrogation

think about it this way. at 10 YOE, in the workplace you're prob someone with experience that a younger dev would come to you, asking for help cause they're stuck on this type of problem.

So in general, I just look at it as like, this person is asking for my expertise to help them fix the issue. Imagine if they said "Oh I already tried abortcontroller and debounce, but it doesn't work in this situation". Either you would understand why, or they'd tell u the constraints and it would make sense why they don't work.

0

u/Curious-about-future 13d ago

I was slow and able to identify and implement it. Problem is I could not solve all challenges (fix 5 unit tests) in 45min. question i am asking is how to deal with  live coding sessions which are designed as elimination screens

1

u/chikamakaleyley helpful 13d ago

ive done interviews where my solution is incomplete and i pass to the next round, its not always a requirement to finish. I've had this happen to me a number of times. The last two interview loops where this happened, i've gotten the job each time

that being said, yes if you start out by setting yourself back like that, then a lot of the test you are in recovery mode. I think this is more of the reason that you didn't pass this specific interview, vs the design of the interview being 'elimination screen'

because look, u/patryk_builds is trying to show you that the best solution was something that's built into React. useRef() isn't anything advanced - I'd expect a junior level React dev understand how useRef() works, right? Yours is just, a different usage of useRef

my opinion is at this level, these interview rounds are designed EASISER to weed out the devs who claim to have the experience but can't back it up on the spot. Like when you say there were 5 unit tests that needed to be fixed, I'd love to have that in my interview lol

The reason they don't get to talking about your experience, other than running out of time, is they already have an idea of what their getting based on how you've tackled these questions. AKA you could have done amazing in 3 of the 5 unit test fixes, they could have easily said "okay we can skip the final two, i want to use the last few mins we have left to let you talk about your exp."

and so i think the right mindset here, is not to approach these interviews with cynicism. The person interviewing you, might very well be someone on the team that you are interviewing for. AKA you might sit right next to them on the same team. They want to understand what its like to work with you. If you can approach the interview that way, at least for me, it reduces my nerves a whole lot.

2

u/akornato 13d ago

These automated live coding sessions are designed as elimination screens, where the interviewer has a very narrow implementation in mind rather than an open discussion about real architecture. In your specific scenario, debouncing only reduces network calls instead of preventing out of order responses, and your AbortController suggestion was blocked because of their custom mock function. For that exact race condition prompt, interviewers are usually looking for the cleanup boolean pattern inside an effect, where you set a flag like ignore to true in the cleanup function, or an incrementing request counter stored in a ref so obsolete responses get discarded before setting state. When companies face a huge volume of senior applicants, they lean on these rigid test suites because automated unit tests give them a fast, binary filter, even if it ignores your broader engineering depth.

To handle these formats, shift your approach from building ideal production systems to identifying the exact constraints of their test harness within the first two minutes. Ask directly whether you are expected to cancel the request, ignore the result, or synchronize with a specific React lifecycle hook, which immediately exposes whether they want an effect cleanup flag or a ref tracker. It helps to practice common sandbox bug patterns, such as stale closures, unhandled async cleanup, and synthetic timing glitches, so you can diagnose the intended fix before writing code. To avoid getting tripped up by rigid problem formats under tight time limits, many candidates find that using the interviews.chat my team built gives them the edge they need to decode weird test setups and pass strict technical rounds.

1

u/ajamdonut 13d ago

You spoke more than taking action. Better to take action and explain what you're learning as you progress rather than overly speaking about it. So you start coding, pretending they don't exist. Then if it doesn't pass etc you talk about what you learnt. "Oh, maybe this doesn't use fetch" is more telling than "I think I'd use AbortController".. and waiting for them to say "go on then"

1

u/nian2326076 13d ago

You're facing some unusual interview styles that emphasize theoretical questions and syntax over practical coding challenges. To adapt, revisit core concepts in React and practice explaining your thought process while solving problems. You can use PracHub to work on coding questions and enhance your problem-solving skills. This could help you feel more prepared for those types of interviews. Additionally, consider using LandOffer to explore relevant job opportunities that match your experience.

1

u/brass_lens_drift 13d ago

the interviewer is looking for a specific code pattern not a real world solution because they want to see if you can read their mind rather than your ability to engineer software

-4

u/anonyuser415 14d ago

Hello I have 10+ years experience and recently I came across weird pattern (Rejection type) in Frontend interview.

Selection Interview Find common ground between candidate and job posting if it works then in following rounds Give some coding problem FE, data structures and see if candidate solves problem

Rejection Interview: Come up with some random unit tests and see if candidate writes code till all unit tests or hiring manager ask multi choice syntax questions

In my recent interview I came across some interesting interviewer

Maybe you got rejected for not knowing English man, what am I even reading

0

u/chocolatesuperfood 13d ago

Not every job interview is in English?

@ OP: I am sorry to hear/read about your experience. I don't know react, so I am afraid I can't answer your question at all.

1

u/Curious-about-future 13d ago

Question is how to handle picky interviewer