Sample exam questions

by Mateusz Pawełkiewicz published 2025/04/10 21:49:00 GMT+1, last modified 2025-05-29T07:23:33+01:00

Sample exam questions

Authorization and Data Storage

What are cookies in the context of web applications?
What attributes can we set for cookies and what do they mean (Secure, HttpOnly, SameSite, etc.)?
What is the difference between localStorage and sessionStorage?
What is a JWT token and how does it work in a frontend application?
What is the process of token refreshing (refresh token) on the frontend side?
How can the frontend detect that an access token has expired and automatically refresh it?

Components and Architecture

What is component-based architecture in a frontend application?
What is the difference between a “dumb” (presentational) component and a “smart” (container) component?
How to pass data from a parent component to a child component?
How to pass a callback (e.g., a method) from a parent component to a child component?
How can a child component send data back to the parent?
How to communicate between two sibling components?
What is the component lifecycle and what are its stages?
When is the best time to fetch data in the component lifecycle?

State and Logic

What are good practices for state management in a frontend application?
What is "lifting state up" and when should it be used?
When is it worth using the Context API?
How to create a component with a custom hook?

Backend Communication

What is the difference between synchronous and asynchronous requests?
What is the difference between fetch and the Axios library?
How to make a GET and POST request to an API using fetch?
How to handle errors in fetch or Axios requests?
How to send a JWT token in the request header?
How to set up a proxy in the frontend dev server and why would you do that?

JavaScript and TypeScript

What is the difference between an arrow function and a regular function?
What is the spread operator (...) and how can it be used in arrays and objects?
How to merge two JavaScript objects into one?
What are array and object destructuring in JavaScript?
How does "use strict" work and what changes in JavaScript behavior?
How to define and use types in TypeScript (number, string, array)?
What is the difference between type and interface in TypeScript?
How to type functions in TypeScript (parameters and return type)?
How to define a generic type in TypeScript?
How to set a type for a component with props in TypeScript?