Failed a Technical Interview Because of This Code

  Рет қаралды 6,314

Cosden Solutions

Cosden Solutions

Күн бұрын

Пікірлер: 32
@versaleyoutubevanced8647
@versaleyoutubevanced8647 16 сағат бұрын
I think the main point I would evaluate is how easy it is for other developers to maintain your code. Not inventing new patterns, using well-known libraries, sticking to established standards, naming variables properly, and splitting code when it needs to be split. The part of the code that threw me off was the "handleOrderBookData" function. When the logic of the code is complex, that’s when you need to ensure the reading is easy, and anyone else can jump in and continue from where it left off. Instead of accessing hard-coded array indexes, it could have destructured and named them appropriately, named the if conditions, moved the code inside the ifs to handlers, and paid attention to typing
@TheRichNuke
@TheRichNuke 16 сағат бұрын
Prices can be unique, and probably even must be unique since there is bid functionality. So probably searching by price can be correct and not buggy
@cosdensolutions
@cosdensolutions 14 сағат бұрын
interesting
@palyanytsia
@palyanytsia 10 сағат бұрын
you can't rely on users/admins that they will always make the price unique, even if they have to. Users are dump. Code should be protected from that errors
@omarhassan2124
@omarhassan2124 5 сағат бұрын
​@@palyanytsiaprobably users can't even bid with the same price and the backend will validate first if the price is used (or if it is higher than the latest price) before adding it to the db
@TheRichNuke
@TheRichNuke 2 сағат бұрын
@@palyanytsia but you can rely on system which requires unique value and throws in case it's not
@seba9260
@seba9260 16 сағат бұрын
for junior or mid, I would have let him pass - there's some really good thinking in the code. senior maybe not. dead code is no criteria for me - I wouldn't expect a highly optimized application. but it depends on the interview situation.
@coders-oasis
@coders-oasis 2 сағат бұрын
Based purely on this one review, I would be more than happy to hire this person at the junior level, fine with intermediate if other fit-style interviews went well and they were able to show a willingness to learn and grow, and a no for senior and up based primarily on the lack of re-use (I consider this a bit of a miss in the places where it wasn't present), proper typing, and the likely bug you identified (can only assume to be a bug since it doesn't seem like price is enforced to be unique elsewhere in the project). Without knowing the prompt its hard to say anything further really, if it was open ended I would love to see some basic tests that could potentially have caught some of the buggy code in such a critical portion of the project or at least demonstrate the attempt to do so. Thanks for demonstrating the review!
@trung_ai
@trung_ai 6 сағат бұрын
On an order book each price is a unique price level with volume corresponding to it so updating it should not be an error ( I worked with crypto market data for a few years so quite familiar with it). Though I agree he should define types and handle response data better, for example websocket can return different message types like an update (to append to a snapshot) or an entire snapshot, and it can changes depending on the pair/ pairs subcribed to, or the depth of the order book etc. One more thing I notice is that his bids and asks are defined as Order[], which is usually reserved for orders placed by account.
@IgorKravets81
@IgorKravets81 15 сағат бұрын
I remember I did same test but in nuxt3 and there was an event bus usage requirement.
@siya.abc123
@siya.abc123 10 сағат бұрын
I would hire the applicant for a junior - mid role. They clearly know react, all they need is a little bit more real world experience with it
@reallegendcode
@reallegendcode 16 сағат бұрын
I would have hired the candidate
@jakubfrei3757
@jakubfrei3757 11 сағат бұрын
I dont see a reason why not for Junior/Medior position
@yeinsdavidllanohernandez1228
@yeinsdavidllanohernandez1228 9 сағат бұрын
Depends on the seniority level they were looking for. For a beginer or even intermediate the core is completely ok, the lack of types is just a matter of feedback. Quite sure after this reviewng he wont forget anymore to type everything
@IgorKravets81
@IgorKravets81 15 сағат бұрын
Dude by price might not be wrong. Bids and asks are the "order book" - which represents commulative volume by the price.
@cosdensolutions
@cosdensolutions 14 сағат бұрын
interesting
@TheRichNuke
@TheRichNuke 16 сағат бұрын
I prefer to use old function syntax instead of arrow. This doesn't require additional React.FC import. Not sure here but probably there is a way to use generics instead of creating useTSelector.
@a-yon_n
@a-yon_n 9 сағат бұрын
And you don't need an extra line for default export. Actually, I use this code style to distinguish a person who knows React and a person who really knows JavaScript. Well, one factor.
@snatvb
@snatvb 10 сағат бұрын
it looks like strong junior code, maybe early middle one more thing: i don't see any work with memorization, on every action on the page u will get rerender whole the app
@cosdensolutions
@cosdensolutions 2 сағат бұрын
That's okay, nothing expensive is re-rendering
@ptolemyhenson6838
@ptolemyhenson6838 16 сағат бұрын
Through what method is this code submitted to you?
@cosdensolutions
@cosdensolutions 14 сағат бұрын
discord
@jakubfrei3757
@jakubfrei3757 11 сағат бұрын
I would hire him for Junior/Medior position, most of the code was ok.
@elmersupersonic
@elmersupersonic 16 сағат бұрын
Please put on another color of t-shirt 😅
@vladimirs.josans
@vladimirs.josans 16 сағат бұрын
haha why
@lucke46
@lucke46 14 сағат бұрын
Great content!
@RADIOSCATRACHASUTAN
@RADIOSCATRACHASUTAN 8 сағат бұрын
Lol, gonna have to clean up code after all works.. I am very dirty..
@MohammedWaseemAnjum
@MohammedWaseemAnjum 6 сағат бұрын
Hi sir can you review my code too? i really want to improve as a react developer really means alot if you will respond thanks!
@holup5035
@holup5035 16 сағат бұрын
I had failed tech interview last week as well... I had to edit code in case so it works. It was useState question, I can't live with that embarassment.. Basic shit and I couldn't do a thing, I forgot about everything. And I have done big projects for years now almost without thinking or using google, yet bombed it on some basic state stuff...
@cosdensolutions
@cosdensolutions 14 сағат бұрын
it happens, don't worry about and focus on the next one! 🤙
How to Build Effective AI Agents (without the hype)
24:27
Dave Ebbelaar
Рет қаралды 19 М.
The Biggest Mistake Intermediate React Developers Make
18:32
Cosden Solutions
Рет қаралды 47 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
PirateSoftware is right, this needs to stop
15:14
Theo - t3․gg
Рет қаралды 916 М.
The Most Important Rule for Clean Code in React
16:52
Cosden Solutions
Рет қаралды 31 М.
Inertia 2.0: It's like Next but better (and you can use React!)
19:02
Theo - t3․gg
Рет қаралды 60 М.
This VS Code theme is threatening people?
14:26
Theo - t3․gg
Рет қаралды 145 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
FASTER JavaScript In 2025 With Sets
13:13
Jack Herrington
Рет қаралды 25 М.
Become a Master at Reusable Components in React
19:51
Cosden Solutions
Рет қаралды 25 М.
The Most Important Design Pattern in React
35:04
Cosden Solutions
Рет қаралды 122 М.
Introducing Clay - High Performance UI Layout in C
35:19
Nic Barker
Рет қаралды 238 М.