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...
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!! πŸ˜„

 
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
 
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

@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

@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.

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 .

 
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
 
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
 
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
 
sobingt profile image
Sobin George Thomas β€’

Great ebook :)

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
 
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
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
 
knopkem profile image
Michael Knopke β€’

Awesome pdf, very useful. Thanks!

Collapse
 
pramit_marattha profile image
Pramit Marattha β€’

πŸ™ŒπŸ™Œ

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
 
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
 
adithya15966988 profile image
Adithyan β€’

Quite insightful!

Collapse
 
pramit_marattha profile image
Pramit Marattha β€’

πŸ™ŒπŸ™Œ

Collapse
 
ankithatech11 profile image
AnkithaTech11 β€’

Great content, very useful!

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
 
teresapeteti profile image
Chanda Teresa Peteti β€’

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

Collapse
 
pramit_marattha profile image
Pramit Marattha β€’

πŸ™ŒπŸ™Œ

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