Exam questions
Frontend Exam January 2025
Question 1
JS
- What are higher-order functions in JavaScript and what are the benefits? Show some examples in your own code.
REACT
- What is the main concept of an React component? Show and explain in your own code.
- Explain the benefits of using components compared to how you would build a web application in vanilla javascript.
Security/Routing/Styling
- Explain what React-Router is and which problems does it solve?
- Show and explain the essential building blocks like
BrowserRouter, Routes, Route, Outlet, path, element, errorElement, useNavigate etc.
.
Question 2
JS
- Show some examples where you used a higher order function (that takes a callback function as argument). Explain the benefits of doing that.
REACT
- What is JSX? Provide an example.
- How would you write the same functionality if you only used Javascript, HTML and DOM manipulation?
Security/Routing/Styling
- Describe the purpose of
flexbox
andgrid
in css, and show some examples of what can be achieved by applying them.
Question 3
JS
- What is the purpose of the package.json file and what can you do with it?
REACT
- Show and describe the purpose of
props
includingchildren
. - Show and explain the role of state in a React component.
Security/Routing/Styling
- Describe conceptually how we deploy a React frontend application to the Caddy server through the CI/CD pipeling.
Question 4
JS
- Show and explain the concept of promises in JavaScript.
REACT
- How do you handle errors (HTTP or JS errors) in React? Show examples in you own code.
Security/Routing/Styling
- What is the purpose of Caddy? Explain how we use it in our deployment pipeline (reverse proxy / serving static files / HTTPS certificate handling).
Question 5
JS
- Show the difference between synchronous and asynchronous programming and how does async and await fit into this?
REACT
- Provide examples for different ways of doing conditional rendering.
Security/Routing/Styling
- Show and explain conceptually a typical flow of using JWTs for user authentication in a React application.
Question 6
JS
- What is the difference between localStorage and sessionStorage in JavaScript?
- Show the use of different storage options in browsers developer tools.
REACT
- Show and explain the useEffect hook (eg. callback, dependency array etc.)
Security/Routing/Styling
- Show and explain the different parts of a JWT token.
Question 7
JS
- Show an example of DOM manipulation in JavaScript.
REACT
- Show and describe event handling in React (eg. onClick, onChange, onSubmit etc.)
- Show examples of how to handle form submit events.
Security/Routing/Styling
- Describe and show the login process using JWT
Question 8
JS
- Show and explain the concept of event bubbling in JavaScript.
REACT
- Show and explain how the map function is used for rendering lists in React and explain the purpose of the
key
attribute in React lists?
Security/Routing/Styling
- Describe conceptually what HTTPS is and how we got it working on our deployed websites.
Question 9
JS
- What is the scope of a variable in JavaScript? Explain the difference between global and local scope.
REACT
- Show and explain how controlled components are different from uncontrolled components in React forms?
Security/Routing/Styling
- Show and explain an example of sub-routing.
Question 10
JS
- Show and explain the spread operator in JavaScript and how it differs from the rest operator?
REACT
- What are React Hooks? Provide examples of at least two built-in hooks.
- Show example of how you handle errors in React.
Security/Routing/Styling
- Describe conceptually what Same Origin Policy (SOP) and Cross Origin Ressource Sharing (CORS) are, and how we avoid getting CORS errors when fetching data from your API.
Question 11
JS
- Show and explain the difference between synchronous and asynchronous programming and how
async and await
fit into this?
REACT
- Show and explain the purpose of
lifting state up
in React.
Security/Routing/Styling
- Show how you can use
flexbox
inStyled-Components
.
Question 12
JS
- Show and explain the concept of promises in JavaScript.
REACT
- Provide examples for different ways of doing conditional rendering.
Security/Routing/Styling
- Describe the purpose of
flexbox
andgrid
in css, and show some examples of what can be achieved by applying them.
Question 13
JS
- What are higher-order functions in JavaScript and what are the benefits? Show some examples in your own code.
REACT
- Show and describe the purpose of props including
children
. - Show and explain the role of state in a React component.
Security/Routing/Styling
- Describe and show the login process using JWT.