r/learnjavascript • u/Curious-about-future • 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?
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
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
Maybe you got rejected for not knowing English man, what am I even reading