Last active
August 11, 2024 10:26
-
-
Save mag002/9aa893fad0f97e0e69120c69077f1786 to your computer and use it in GitHub Desktop.
Front-end Fresher/Junior/Middle Interview (with ReactJS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#fe-fresher-interview (50%) | |
#fe-junior-interview (40%) | |
#fe-middle-interview (10%) | |
#Interview example (Part 3 pick randomly) |
Order Stuffs
- Git flow?
- Design? (Figma, AdobeXD, Sketch…)
- Mock API?
- webpack
- NodeJS, npm, RESTfulsAPI...
- JWT?
- Unit Test?
- Postman, swagger, ...
Interview Example
Part 1: Multiple Choice Questions (MCQs)
Section 1: HTML & CSS (10 Questions)
- Which of the following is the correct syntax for a self-closing HTML tag?
- a)
<div></div>
- b)
<img>
- c)
<a />
- d)
<br>
- a)
- What does the CSS z-index property control?
- a)
Font size
- b)
The layering of elements
- c)
Padding
- d)
Text alignment
- a)
- Which of the following HTML elements is used to create a dropdown list?
- a)
<select>
- b)
<input type="dropdown">
- c)
<textarea>
- d)
<ul>
- a)
- Which CSS property is used to change the text color of an element?
- a)
font-color
- b)
text-color
- c)
color
- d)
background-color
- a)
- What is the default value of the position property in CSS?
- a)
relative
- b)
absolute
- c)
static
- d)
fixed
- a)
Section 2: JavaScript (10 Questions)
-
Which of the following is a primitive data type in JavaScript?
- a)
Array
- b)
Object
- c)
String
- d)
Function
- a)
-
What is the output of the following JavaScript code?
console.log(typeof null);
- a)
null
- b)
object
- c)
undefined
- d)
string
- a)
-
Which of the following is NOT a valid JavaScript variable name?
- a)
\_name
- b)
2ndName
- c)
name2
- d)
$name
- a)
-
How do you create a function in JavaScript?
- a)
function myFunction() {}
- b)
function:myFunction() {}
- c)
function = myFunction() {}
- d)
myFunction function() {}
- a)
-
Which method is used to add elements to the end of an array in JavaScript?
- a)
push()
- b)
pop()
- c)
shift()
- d)
unshift()
- a)
Section 3: ReactJS (10 Questions)
- What is a React component?
- a) A function that returns HTML
- b) A JavaScript function or class that returns JSX
- c) A CSS class
- d) An HTML tag
- Which method in a React class component is used to handle side effects, like fetching data?
- a) componentWillMount
- b) componentDidUpdate
- c) componentDidMount
- d) render
- What is the purpose of the key prop in React?
- a) To uniquely identify elements in a list
- b) To trigger re-renders
- c) To handle events
- d) To style components
- Which of the following hooks is used to manage state in a functional component?
- a) useState
- b) useEffect
- c) useRef
- d) useContext
- What is JSX in React?
- a) A syntax extension that looks similar to HTML
- b) A CSS preprocessor
- c) A JavaScript library
- d) A JSON format
Part 2: Essay Questions
Section 1: HTML/CSS
- Explain the difference between block-level and inline-level elements in HTML. Provide examples of each.
- Describe the CSS box model. How does the box-sizing property affect element sizing?
Section 2: JavaScript
- What is the difference between == and === in JavaScript? Provide examples of when to use each.
- Explain closures in JavaScript. How do they work, and why are they useful? Provide an example.
Section 3: ReactJS
- Describe the virtual DOM and how it differs from the real DOM. Why is the virtual DOM important in ReactJS?
- Explain how props and state are used in ReactJS. How do they differ? Provide examples.
Part 3: Hands-On Coding Tasks
Create a Comprehensive ReactJS Application:
Part 1: Build a Weather Forecast Application
- Objective: Develop a ReactJS application that displays weather information based on user input.
- Requirements:
- Component Structure: Break down the application into multiple components (e.g., WeatherSearch, WeatherDisplay, WeatherDetails).
- State Management: Use useState and useEffect hooks to manage the application’s state.
- Features:
- Allow users to search for a city’s weather.
- Fetch weather data from a public API (e.g., OpenWeatherMap API).
- Display current weather information (temperature, humidity, wind speed, etc.).
- Show a 5-day weather forecast.
- Persist the last searched city using local storage.
- Styling: Use CSS or a CSS-in-JS library (e.g., styled-components) to style the application.
- Bonus: Implement a dark/light mode toggle.
Part 2: Create a Recipe Finder Application
- Objective: Build a ReactJS application that helps users find and save recipes.
- Requirements:
- Recipe Search: Allow users to search for recipes by ingredient or recipe name.
- API Integration: Fetch recipe data from a public API (e.g., Edamam Recipe API).
- Recipe Display: Display a list of recipes with images, ingredients, and preparation instructions.
- Favorite Recipes: Implement functionality to save favorite recipes to local storage.
- Recipe Details: Create a detailed view for each recipe that includes nutritional information.
- Responsive Design: Ensure the application is fully responsive on different devices.
Part 3: Implement a Blogging Platform
- Objective: Create a basic blogging platform where users can create, edit, and delete posts.
- Requirements:
- Component Structure: Organize the application into components such as BlogList, BlogPost, CreatePost, and EditPost.
- State Management: Use useState and useReducer hooks for managing posts.
- Features:
- Users can create new blog posts with a title, content, and tags.
- Posts are displayed in a list format, with options to edit or delete each post.
- Implement a search function to filter posts by title or tags.
- Use local storage to persist blog posts.
- Routing: Set up routing to navigate between different sections of the application (e.g., Home, Create Post, Edit Post).
- Form Validation: Add form validation to ensure that posts contain a title and content.
Part 4: E-commerce Product Catalog
- Objective: Develop a product catalog for a fictional e-commerce website.
- Requirements:
- Product Display: Fetch and display a list of products from a public API (e.g., Fake Store API).
- Product Details: Create a detailed view for each product, displaying information like price, description, and reviews.
- Search and Filter: Implement search and filter options to allow users to find products by category, price range, or rating.
- Shopping Cart: Create a simple shopping cart that allows users to add and remove products, and calculate the total price.
- Routing: Use React Router to navigate between the product list, product details, and cart views.
- Bonus: Implement pagination for the product list.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReactJS
INPUT:
OUTPUT: