Interview questions with answers
TanStack interview questions and answers
The headless, type-safe, framework-agnostic library family. Open any question to read its model answer; the multiple-choice set marks the right option and explains it.
- Subjective
- 30
- Objective
- 30
Subjective questions 30
1What is TanStack?Asked almost every time
TanStack is a family of open-source, headless, type-safe libraries led by Tanner Linsley: Query (server state), Router (type-safe routing), Start (full-stack framework), Table (data grids), Form (forms), Virtual (virtualised lists), Store, Pacer (debouncing and rate limiting), DB (reactive client store) and AI. Most are framework-agnostic with adapters for React, Vue, Solid, Svelte and Angular.
2What does 'headless' mean for TanStack libraries?Asked almost every time
They provide logic and state, not markup or styles. TanStack Table, for example, computes sorting, filtering and pagination and gives you rows and cells; you render them with your own HTML, CSS or design system. You get full control of the UI and accessibility at the cost of writing the markup.
3Why is server state different from client state?Asked almost every time
Server state lives elsewhere, can change without you knowing, is shared, and must be fetched, cached, refreshed and kept in sync. Client state (a modal being open) is owned by the browser. Putting server data in a client store means rebuilding caching, deduplication and refetching by hand; TanStack Query handles server state.
4How would you choose TanStack libraries for a new dashboard app?Asked almost every time
Query for server data and caching, Router (or Start for SSR) for type-safe routes and URL search-param filters, Table with Virtual for large grids, Form for editing records, and Pacer for debounced search inputs. Each is optional; pick the ones that remove real pain.
5What does TanStack Query replace in a typical React app?Asked almost every time
Hand-written fetching in useEffect with loading and error flags, ad-hoc global caches for API data, manual refetch logic, deduplication and retry code, and much of the server data previously stored in Redux.
6How do TanStack Router search params improve state management?Asked almost every time
Filters, sorting, pagination and tabs live in the URL as validated, typed state. Users can share and bookmark views, back and forward work naturally, and no separate global store is needed for that UI state.
7Why does type safety matter so much in TanStack libraries?Very often asked
They infer types end to end: Router infers path and search params from route definitions, Query infers data from query functions, Table from column definitions and Form from default values. Mistakes such as a wrong param name or field path become compile errors instead of runtime bugs.
8How do TanStack libraries fit together in an app?Very often asked
A common stack: TanStack Start (or Router alone) for routing and server functions, Query for fetching and caching with loaders prefetching data, Table to display it, Form for editing with validation, and Virtual for long lists. Each also works alone with other tools.
9What is TanStack Virtual for?Very often asked
Rendering only the visible items of a very long list or grid (plus a small overscan), positioning them in a scroll container of the full size. It keeps DOM size and memory small for thousands of rows, and supports dynamic item sizes, horizontal lists and grids.
10What does TanStack Pacer do?Very often asked
It provides utilities to control how often functions run: debouncing, throttling, rate limiting, queuing and batching, both sync and async, with framework adapters and reactive state such as pending counts.
11How does TanStack Virtual work?Very often asked
Given a scroll container, item count and estimated size, useVirtualizer calculates which items are visible and their offsets, and you render only those, positioned inside a container sized for all items. It measures real sizes dynamically and supports horizontal lists and grids.
12What are adapters in the TanStack ecosystem?Very often asked
Small framework-specific packages (@tanstack/react-query, @tanstack/vue-query, @tanstack/solid-table) that connect the framework-agnostic core to each framework's reactivity system, so logic is shared and behaviour is consistent across frameworks.
13How do TanStack Query and Router share a cache-first navigation?Very often asked
Route loaders call queryClient.ensureQueryData so data is cached before render; links preload on intent, so the data and code arrive before the click; components read the same query with useSuspenseQuery, avoiding duplicate requests.
14When would you not use TanStack Query?Very often asked
For apps whose data comes entirely from a sync engine or local database, very simple static sites, or when a framework already provides equivalent caching you rely on (for example data fetched only in Server Components). Even then, it is useful for client-side mutations.
15What does TanStack Pacer offer beyond lodash debounce?Very often asked
Framework hooks and utilities for debounce, throttle, rate limiting, queuing and batching, with state you can observe (pending, executions), async support with cancellation, and type safety.
16How do TanStack Devtools help debugging?Very often asked
They show live state inside the app: Query's cache entries, their status and data, and actions like refetch or invalidate; Router's matched routes, params, search and loader state; with a unified devtools shell for several libraries.
17How do you migrate from React Router to TanStack Router?Very often asked
Introduce TanStack Router route by route or in one switch for small apps: define the route tree (file-based is easiest), move data loading into loaders, convert search params to validated schemas and update links to typed Link components.
18How do you choose between TanStack Router and other routers?Often asked
TanStack Router offers fully inferred type-safe routes, search params validated as state, built-in loaders with caching, and code splitting. Choose it for client-heavy SPAs or with Start; Next.js or React Router may suit teams wanting their conventions or ecosystem.
19What is TanStack Store?Often asked
A small framework-agnostic reactive store with derived state and subscriptions that powers the internal state of other TanStack libraries (Form, for example). It can be used directly for simple shared state with adapters such as useStore.
20How does TanStack DB relate to Query?Often asked
TanStack DB builds on Query collections: data is loaded into typed collections, live queries with joins and filters update incrementally as data changes, and optimistic mutations apply instantly and sync to the backend, rolling back on failure. It suits highly interactive, local-first-style apps.
21Are TanStack libraries only for React?Often asked
No. Their cores are framework-agnostic TypeScript. Official adapters exist for React, Vue, Solid, Svelte, Angular and others for many libraries, though coverage varies by library.
22How do TanStack libraries achieve strong type inference?Often asked
APIs are designed so types flow from what you pass: query functions' return types, route definitions, default form values and column accessors. You rarely write generic parameters by hand.
23What is TanStack Store used for directly?Often asked
A tiny framework-agnostic reactive store with derived values and effects. Apps can use it for small shared state, but it mainly powers other TanStack libraries such as Form.
24How do you persist TanStack Query's cache?Often asked
Use a persister (for example @tanstack/query-sync-storage-persister or async storage) with PersistQueryClientProvider, setting a maxAge and a buster version to discard incompatible caches after deployments.
25What is TanStack Ranger?Often asked
A headless library for range and multi-range slider logic, providing values, handles and steps while you render the UI.
26How are TanStack libraries funded and maintained?Often asked
They are open source under the MIT license, maintained by Tanner Linsley and a team of maintainers, funded through sponsors and partnerships, with active releases and large communities.
27What is TanStack AI?Sometimes asked
A newer, provider-agnostic TypeScript toolkit for building AI features, with type-safe tool definitions, streaming chat, and adapters for several model providers and frameworks. It is young, so check its current status before adopting it in production.
28How do TanStack Devtools help?Sometimes asked
Query, Router and Form have devtools panels (and a unified TanStack Devtools shell) that show the cache, query states, route matches and form state, which makes debugging data flow much easier.
29What licence are TanStack libraries under?Sometimes asked
They are open source under the MIT licence, maintained by the TanStack team and community with sponsorship.
30What does TanStack Config provide?Sometimes asked
Shared tooling and configuration used to build, test and publish TanStack packages consistently: build setup, linting and publishing scripts.
Objective questions 30
1Which TanStack library manages server state and caching?Asked almost every time
Why: Query fetches, caches and syncs server data.
2'Headless' means the library…Asked almost every time
Why: You render the markup yourself.
3Which TanStack feature replaces useEffect-based fetching?Asked almost every time
Why: It manages server state.
4Where should dashboard filters live with TanStack Router?Asked almost every time
Why: Shareable and typed.
5Which hook virtualises a long list?Asked almost every time
Why: From TanStack Virtual.
6Which library renders only visible rows of a huge list?Very often asked
Why: Virtualisation keeps the DOM small.
7Which is TanStack's full-stack framework?Very often asked
Why: Start builds on Router with SSR and server functions.
8Which library offers debounce, throttle and rate limiting?Very often asked
Why: Pacer controls execution timing.
9Which library builds data grids with sorting and filtering?Very often asked
Why: Table is a headless data-grid engine.
10What is an adapter package?Very often asked
Why: e.g. @tanstack/vue-query.
11Which provider persists Query's cache?Very often asked
Why: Uses a persister.
12TanStack Pacer provides…Very often asked
Why: Timing utilities.
13What does Query Devtools show?Very often asked
Why: With refetch and invalidate actions.
14Which library renders range sliders headlessly?Very often asked
Why: Values and handles only.
15TanStack Router is known for…Often asked
Why: Types are inferred from route definitions.
16Which state belongs in TanStack Query?Often asked
Why: Server data belongs in Query.
17Which library powers reactive internal state of other TanStack libraries?Often asked
Why: Store is the shared reactive core.
18TanStack libraries are…Often asked
Why: Cores are plain TypeScript.
19What does buster do in cache persistence?Often asked
Why: Change it on breaking deploys.
20Where do TanStack's types mostly come from?Often asked
Why: Inference-first APIs.
21What should you measure for Virtual to handle varying heights?Often asked
Why: measureElement updates sizes.
22Who maintains TanStack?Often asked
Why: Open source, sponsor-funded.
23Which preloads data before a link is clicked?Often asked
Why: Hover or focus starts loading.
24Which is NOT a TanStack library?Often asked
Why: There is no TanStack Redux.
25TanStack DB provides…Sometimes asked
Why: It runs in the client on top of collections.
26Who created TanStack?Sometimes asked
Why: It grew from React Query and React Table.
27Which library handles form state and validation?Sometimes asked
Why: Form is type-safe and headless.
28What does TanStack Config contain?Sometimes asked
Why: Used for TanStack packages.
29TanStack Store is mainly used to…Sometimes asked
Why: Also usable directly.
30What licence do TanStack libraries use?Rarely asked
Why: They are MIT licensed.
Track what you have practised and search every bank in your dashboard.
Start learning