State Management and Data Fetching interview questions
100 Frontend Engineering practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise State Management and Data Fetching questionsBeginner
- Adding pagination to a long list of orders
- API calls are scattered across components
- Data reloads every time users go back to a list
- Debouncing and throttling requests
- Deciding where a new piece of state should live
- Derived data and selectors
- Fetching data with the Fetch API
- Getting real-time updates: polling, SSE and WebSockets
- GraphQL basics for frontend developers
- Handling HTTP errors in the frontend
- Lightweight stores like Zustand
- Loading spinners flash briefly and look jarring
- Loading, error and empty states
- Mutations in data fetching
- Offset vs cursor pagination from the frontend's perspective
- Persisting state in localStorage
- Query keys in data fetching libraries
- React context vs a state library
- Requests occasionally fail due to flaky networks
- REST API basics for frontend developers
- Saving a long form draft so users don't lose work
- Server state vs client state
- Sharing shopping cart state across pages
- Submitting a form to an API and showing the result
- Telling users the difference between "no results" and "something broke"
- The same API request is made several times on one page
- The stale-while-revalidate idea
- Types of state in a frontend app
- Users see outdated data after returning to a tab
- What Redux is
- What state management means in frontend apps
- What TanStack Query does
- Why client-side caching of API data helps
- Why immutable updates matter for state
Intermediate
- A GraphQL page loads slowly due to many nested queries
- A list doesn't show a newly created item
- A Redux codebase with too much boilerplate
- A store selector causes components to re-render on every change
- Atomic state management
- Cache invalidation strategies on the frontend
- Cascading dropdowns that load options from an API
- Concurrency problems with overlapping mutations
- Dependent and parallel queries
- Filtering a large dataset: client or server?
- GraphQL client caching
- Handling expired access tokens during API calls
- Implementing undo and redo
- Infinite list loses items or duplicates after updates
- Keeping a dashboard updated without overloading the server
- Mutations are lost when users go offline briefly
- Normalised vs document caches
- Offline-first data strategies
- Optimistic updates with rollback
- Pages download far more data than they display
- Persisting and rehydrating client stores
- Placeholder data vs initial data in query libraries
- Prefetching data before navigation
- Redux Toolkit and RTK Query
- Request waterfalls
- Showing a live unread notification count
- Signals and fine-grained reactivity
- State machines for UI logic
- The global store contains everything
- The same item shows different values in different places
- Treating the URL as state
- Two admins edit the same record and one overwrites the other
- Uploading large files with progress and cancellation
Experienced
- A data-heavy page is slow to show anything
- A deploy causes all clients to refetch at once
- Adding real-time collaboration to a document editor
- An unexpected API change crashes the frontend
- Backend-for-frontend pattern
- Building a field app that works offline
- Building an analytics dashboard with heavy aggregations
- Comparing reactivity models across frameworks
- Consistency trade-offs in client-side caches
- CRDTs and sync engines
- Data fetching with React Server Components
- Data from a previous user appears after switching accounts
- Data is fetched twice: on the server and again on the client
- Deciding whether to adopt GraphQL for a frontend
- Designing a client cache for a complex domain
- Designing a fast type-ahead search for millions of records
- Designing the data layer for a large frontend app
- Event-driven state on the client
- Evolving API contracts safely with frontends
- Hard-to-reproduce state bugs reported by users
- Managing cache memory in long-running apps
- Migrating hand-rolled fetching to a data library
- Normalising relational data in client state
- Old frontend versions break after a backend deploy
- Optimistic reordering in a drag-and-drop list
- Parsing a huge API response freezes the page
- Real-time updates cause excessive re-renders and memory use
- Request cancellation and resource cleanup
- Streaming and incremental data delivery
- Teams step on each other's cached data
- The local-first software approach
- WebSocket connections drop and data gets out of sync
- Your frontend hits third-party API rate limits