Solving Frontend Interview Question for Practice | JavaScript Coding Challenge

  Рет қаралды 2,859

Devtools Tech

Devtools Tech

Күн бұрын

Пікірлер: 29
@DevtoolsTech
@DevtoolsTech 15 күн бұрын
Question link: devtools.tech/questions/s/how-to-build-color-memory-game-in-react-js-frontend-coding-challenge---qid---1wFNDiwjxcKwrHL65SN5 Practice with us: devtools.tech/questions/s/how-to-build-color-memory-game-in-react-js-frontend-coding-challenge---qid---1wFNDiwjxcKwrHL65SN5 Updates: 1. We can improve the handle click logic by adding `isRevealed` to the condition. 2. We can add a `disabled` property to the button with the value isRevealed.
@jaidhingra2811
@jaidhingra2811 14 күн бұрын
Yes, using some flag makes it easier to handle. We can make something like this: { id: 1, bg: '#ffff', isRevealed: false } for each box state. By this we can prevent handleClick from clicking the box again as you mentioned in above comment and easily manage other things in handleClick. I just stuck while shuffling part because I don't know any algo by which I can achieve this in O(N). So, on google search I found algo named 'Fisher-Yates shuffle' Thanks for this great question
@yomeshgupta
@yomeshgupta 14 күн бұрын
@@jaidhingra2811Lodash shuffe uses the same algorithm for shuffling!
@meghabathla7167
@meghabathla7167 10 күн бұрын
That is a good explanation, though the question link has no utilis file. While showing the utilis file it was partially seen becs' the browser was open on another side.
@DevtoolsTech
@DevtoolsTech 10 күн бұрын
Question link has a utils file. Go to the question link then check the Files section in the left sidebar. I solve questions on the platform so that I have same setup as everyone else. Please check.
@meghabathla7167
@meghabathla7167 10 күн бұрын
@@DevtoolsTech thanks for sharing
@Sv2059J
@Sv2059J 3 күн бұрын
Namaste sir 🙏🏻 Although my comment is not related to video but I want suggestion from you I am a fresher (BCA passed out 2024) looking for job. To get a react developer job by year end, if I make 4 big deployed projects. Out of those 4 1) How many should be in Vanilla react 2) How many with React + NextJS I am proficient in JavaScript and have some knowledge of react As a fresher how much can i expect purely based on techstack knowledge Dhanyawad 🙏🙏
@DevtoolsTech
@DevtoolsTech 3 күн бұрын
Namaste 🙏🏻 You can one big project if you have the time using React + Next.js which should be actual meaningful web-app. Deploy it and try to have some users on it. Take inspiration from existing products to build a clean and delightful UI.
@Sv2059J
@Sv2059J 2 күн бұрын
@@DevtoolsTech Dhanyavad for your kind reply sir 🙏🙏 I have one more doubt. Hope you will clear that too I am proficient in Javascript. Like completed all the important topics of CSS and JavaScript and made an Amazon clone in JavaScript during my sixth semester in BCA. Since I want a job by THE YEAR END (3 MONTHS LEFT), Two kinds of videos are on my KZbin learning list. 1) 25 machine-coding round-react projects 2) ReactJs topicwise theory videos HOW SHOULD I APPROACH REACTJS TO COMPLETE MY FRONTEND PREPARATION JOURNEY? I am more comfortable with the project videos, but that way I might miss some theory-related topics.
@Sv2059J
@Sv2059J 2 күн бұрын
@@DevtoolsTech For the resume, I have 1 vanilla JavaScript-based Amazon clone. On Udemy, I have 2 projects of John Smilga. 1) Job-searching website (CRUD) 2) Github user search-based short website Are these projects appropriate for the freshers role and can be COMPLETED IN 2 MONTHS OR YOU WILL GIVE OTHER SUGGESTIONS?
@DevtoolsTech
@DevtoolsTech 2 күн бұрын
For any level, I would say ask yourself the following questions 1. Is my project impressive? If someone else made it then would I be impressed by it? 2. When I see a product like Netflix, Amazon, Flipkart, and so on then I see my project, do I get a similar wow feeling from the whole UI and UX of my work? 3. Are my projects useful or just did for the sake of doing it? You will get an answer yourself from the above questions.
@DevtoolsTech
@DevtoolsTech 2 күн бұрын
For freshers, 1. Prepare DSA 2. Solve machine coding round questions using vanilla js and a framework. 3. Prepare fundamentals with good examples. For example, closure and where you used it in your project? 4. Learn to explain your project and what learnings you had. Do these and refine your approach may be in a month!
@snehalyelkar
@snehalyelkar 14 күн бұрын
In the handleClick method of the Box component, is it a quirk that the DEFAULT_BG_COLOR can be one of the possible grid bgColors, and by explicitly returning it, we won't handle its match?
@DevtoolsTech
@DevtoolsTech 14 күн бұрын
Yes, that is correct! Good catch! Two things to handle in that functiom We can add a check if isRevealed is true then explicit return as an early escape. We can update our getRandomColors method to handle blacklisted colors. You can also do some custom logic in the component if we don't want blacklisted colors change.
@somnathsahoo5547
@somnathsahoo5547 15 күн бұрын
Great problem sir❤
@DevtoolsTech
@DevtoolsTech 15 күн бұрын
Thank you sir!
@somnathsahoo5547
@somnathsahoo5547 12 күн бұрын
Sir can you guide me?
@somnathsahoo5547
@somnathsahoo5547 12 күн бұрын
Please 🙏
@DevtoolsTech
@DevtoolsTech 12 күн бұрын
Guide how?
@prabhatkashyap8333
@prabhatkashyap8333 3 күн бұрын
when we practice should we practice in vanilla js or with some framework like react??
@DevtoolsTech
@DevtoolsTech 3 күн бұрын
You should practice in both. Some questions in frameworks and some in vanilla.
@prabhatkashyap8333
@prabhatkashyap8333 10 сағат бұрын
@@DevtoolsTech and if we are preparing for senior frontend then, how much time should be given to 1 question to get it solved?
@DevtoolsTech
@DevtoolsTech 10 сағат бұрын
Totally depends upon the question's complexity level. Usually a machine coding round interview lasts 60 mins max. You should always try to finish a question 10 mins prior to the allocated time so that you can a buffer for questions, enhancements, or any unexpected issues.
@prabhatkashyap8333
@prabhatkashyap8333 9 сағат бұрын
@@DevtoolsTech ok cool thanks
Touching Act of Kindness Brings Hope to the Homeless #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 18 МЛН
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 841 М.
HOC Pattern in React
20:51
Cosden Solutions
Рет қаралды 9 М.
Solving Uber Frontend Interview Question | Interactive Shape
26:11
Devtools Tech
Рет қаралды 49 М.
Higher-Order Components Are Misunderstood In React
17:38
Jan Hesters
Рет қаралды 1,2 М.
You're Probably Using Nuxt Wrong
5:16
LearnVue
Рет қаралды 24 М.
How I Mastered System Design Interviews
10:22
Ashish Pratap Singh
Рет қаралды 171 М.
How I would learn to code (if I could start over)
10:52
PIRATE KING
Рет қаралды 1,3 МЛН
AI company just raised 1 billion dollar in seed round
14:52
Hitesh Choudhary
Рет қаралды 19 М.
Build an e-commerce site... with a twist - Web Dev Challenge S1E3
26:20
Learn With Jason
Рет қаралды 138 М.