DEV Community

Cover image for React Interview Questions πŸ”₯

React Interview Questions πŸ”₯

Pramit Marattha on November 16, 2021

Do you want to make a career change to something more lucrative? Or have you been putting in a lot of time and effort in preparation for an intervi...
 
sobingt profile image
Sobin George Thomas

@lukeshiru True. React Hooks are a complete and better replacement for Classes. But that doesn't mean we have to rewrite tens of thousands of components written as classes. Instead, we use Hooks in the new code side by side with classes. Also, I don't think React has any plan to deprecate classes. Also long as there is legacy code support, someone has to maintain them. The best example is COBOL and FORTRAN, they refuse to die. Some poor developer is surviving on them.

Source

Thread Thread
 
jwhenry3 profile image
Justin Henry

The Legacy Code Problem is one that ultimately needs to be addressed first. Any decent Software company will take it seriously and move away from as much legacy code as possible. If you don't, you risk dependency vulnerabilities, version incompatibilities, performance bottle-necking, and increased maintenance cost just from it sitting stale for long periods of time without eyes on it. I can't tell you how many times I've been told "we have to do it this way because of legacy code" and that is not a sufficient answer to any problem. You're supposed to keep your code up to date and as clean as possible as you grow as a developer, otherwise you will end up resenting the legacy code and lose willpower to touch it.

Collapse
 
dastasoft profile image
dastasoft

Awesome contribution! If you want to expand it further or do a part 2 maybe useMemo, useCallback and other optimization techniques will be good issues to cover.

Thanks for sharing!

Collapse
 
pramit_marattha profile image
Pramit Marattha

Absolutely!! πŸ˜„

Collapse
 
adamaslan profile image
Adam Aslan • Edited
class User extends React.Component {
  constructor(props) {
    super(props)

    this.state = {
      message: 'Welcome to React world'
    }
  }

Enter fullscreen mode Exit fullscreen mode

Also isnt talking about State like this ^ and with setstate no longer best practices?

Collapse
 
sobingt profile image
Sobin George Thomas • Edited

@adamaslan Well, you should not call setState() in the constructor(). Instead, if your component needs to use local state, assign the initial state to this.state directly in the constructor.
src: reactjs.org/docs/react-component.h...

React Screenshot

Collapse
 
sobingt profile image
Sobin George Thomas • Edited

@lukeshiru Looks like the author has added a pdf of all the 300+ questions at the end.
snippet

But, I strongly agree that the author should have added React Router v6 questions. It's already been 13 days from today(17th Nov 2021) that React Router v6 has been the new stable version.
github

The author should also consider React Location. As it may soon kill React Router. I believe, it was last week, Tanner Linsley (the creator of React Query, React Table, React Charts, React Virtual - AKA the TanStack) released React Location.

 
sobingt profile image
Sobin George Thomas

@lukestuts I strongly agree. The title should be something else. Even I was expecting a hellishly long article that can challenge my scroll bar. The author should have added all 300+ questions and answers in one article or created 10+ posts with ~30 questions each.

Thread Thread
 
pramit_marattha profile image
Pramit Marattha

Most sincere apologies; I won't be repeating this on my future blogs/articles.

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
blaiseai profile image
Blaise Sebagabo

Awesome resource

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ˜„

Collapse
 
thecodealchemist profile image
Nyasha Chiroro

Thank you for the amazing article and ebook. I was wondering, what software did you use to make the pdf? Also what did you use to design the cover page? I'm planning on releasing a series of ebooks and blog posts myself.

Collapse
 
pramit_marattha profile image
Pramit Marattha

Excalidraw, canva and Adobe illustrator .

Collapse
 
pramit_marattha profile image
Pramit Marattha

Duly Noted !! I've been working on updating it . I'll be updating everything with latest and greatest changes.
I'll also be posting complete/full articles and resources here starting next time.
Most sincere apologies for any inconvenience caused

Collapse
 
bestinterviewquestions123 profile image
Best Interview Question

"Wow, this is an excellent compilation of React interview questions! As a React developer, I'm always looking to brush up on my knowledge and stay updated with the latest trends in the ecosystem. This article covers a wide range of topics, from React fundamentals to more advanced concepts like hooks and context.

Collapse
 
kerthin profile image
Roden

Thanks for the link

Collapse
 
bestinterviewquestions123 profile image
Best Interview Question

Great article on React interview questions! React is a popular JavaScript library for building user interfaces, and it's essential for aspiring front-end developers to have a solid understanding of React concepts and best practices. Your article provides a valuable resource for those preparing for React interviews, as it covers key topics such as component lifecycle, state management, virtual DOM, and performance optimization. I particularly appreciate the detailed explanations and code examples provided, which make it easier to grasp these concepts. Thank you for sharing this insightful guide – it will undoubtedly help many developers ace their React interviews! Keep up the good work!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
prashpra profile image
prashpra

Awesome set of questionnaire! I suggested one HR friend of mine hiring React developers.

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
adithya15966988 profile image
Adithyan

Quite insightful!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
evanpaul90 profile image
evanpaul

Bookmarked!! Very useful stuff
Thank you for sharing
Cheers 🍻

Collapse
 
pramit_marattha profile image
Pramit Marattha

🍻 πŸ™Œ

Collapse
 
hamza18694258 profile image
hamza

Appreciate your Efforts!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
otienosteve profile image
Otieno

Thanks for the info

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
devzubair profile image
Md Zubair Ahmed

Why I can't Download the eBook. Can anyone send me the link please

Collapse
 
pramit_marattha profile image
Pramit Marattha

Gumroad link is not working ?
Can you share the screenshot ?

Collapse
 
devzubair profile image
Md Zubair Ahmed

Could you please take a look : loom.com/share/36b3ccad98a148b5920...

Thread Thread
 
sobingt profile image
Sobin George Thomas
Thread Thread
 
devzubair profile image
Md Zubair Ahmed

Thank you ! Its been working after using VPN - prnt.sc/1zzov2v

Thread Thread
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
sobingt profile image
Sobin George Thomas

Great ebook :)

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
knopkem profile image
Michael Knopke

Awesome pdf, very useful. Thanks!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
ankithatech11 profile image
AnkithaTech11

Great content, very useful!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
teresapeteti profile image
Chanda Teresa Peteti

This is very insightful, Thank you so much for sharing!!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
pradeepradyumna profile image
Pradeep Pradyumna

Saved! Thank you for sharing

Collapse
 
pramit_marattha profile image
Pramit Marattha

If the above link does not work, go here to download:
aviyel.gumroad.com/l/300-plus-reac...

Collapse
 
russelmelroydsouza8 profile image
RusselMelroydsouza8

Very Useful article!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
ramkumar_rk_r profile image
Ram Kumar

Very insightful.

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Collapse
 
charuthekutty profile image
Charu Veluthoor

Great Stuff!

Collapse
 
pramit_marattha profile image
Pramit Marattha

πŸ™ŒπŸ™Œ

Some comments have been hidden by the post's author - find out more