All fields

“Data Fetching” in Information Technology

51 questions across 3 technologies.

Information Technology

51 questions in 3 technologies

#QuestionTechnologyTopicLevel
1What is request deduplication in Next.js, and how does it help with data fetching? Next.js › Data FetchingNext.jsData FetchingAdvanced
2Why is it usually better to use a data fetching library instead of writing your own fetch logic in every component? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Beginner
3If you are migrating a page from getStaticProps to the App Router, how do the equivalent data fetching patterns compare? Next.js › Pages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Next.jsPages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Advanced
4How do you fetch data inside a client component that needs to run in the browser? Next.js › Data FetchingNext.jsData FetchingBeginner
5How do you fetch data inside a server component in the App Router? Next.js › Data FetchingNext.jsData FetchingBeginner
6How do you fetch multiple pieces of data in parallel to avoid slow, sequential loading? Next.js › Data FetchingNext.jsData FetchingIntermediate
7How can you pass data fetched on the server down into a client component? Next.js › Data FetchingNext.jsData FetchingIntermediate
8How does data fetching work differently in a Next.js Server Component compared to fetching data in a regular client rendered React app? React › Server-Side Rendering (SSR) & Next.jsReactServer-Side Rendering (SSR) & Next.jsAdvanced
9How can Suspense be used directly for data fetching, beyond just code splitting? React › Suspense & Concurrent RenderingReactSuspense & Concurrent RenderingAdvanced
10What problem do libraries like React Query and SWR solve compared to fetching data with plain useEffect? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Beginner
11How would you handle a mutation, such as creating a new item, using React Query? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Intermediate
12How would you refresh data shown on a page after a server action successfully changes something in the database? React › Server Actions & Data MutationsReactServer Actions & Data MutationsIntermediate
13How do you generate dynamic metadata for a page based on data fetched at request time, such as a product page? Next.js › Metadata API & SEO OptimizationNext.jsMetadata API & SEO OptimizationIntermediate
14What does getStaticProps do in the Next.js Pages Router? Next.js › Pages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Next.jsPages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Beginner
15What does getServerSideProps do, and how is it different from getStaticProps? Next.js › Pages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Next.jsPages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Beginner
16How does automatic caching work in React Query, and why does it make an app feel faster? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Intermediate
17How does getStaticPaths work together with getStaticProps for dynamic routes in the Pages Router? Next.js › Pages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Next.jsPages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Intermediate
18What are the different fallback options available in getStaticPaths, and how do they behave differently? Next.js › Pages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Next.jsPages Router Data Fetching (getStaticProps, getServerSideProps & getStaticPaths)Intermediate
19How does SWR's stale while revalidate strategy work, and why is it useful? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Advanced
20What is the difference between using a resolver and simply fetching data inside a component's ngOnInit method? Angular › Router Guards & ResolversAngularRouter Guards & ResolversBeginner
21How do you show a loading state automatically while a page's data is being fetched in the App Router? Next.js › Loading UI & Streaming with SuspenseNext.jsLoading UI & Streaming with SuspenseBeginner
22How would you write a custom hook to fetch data from an API and share that logic across components? React › Custom HooksReactCustom HooksIntermediate
23How would you test a component that fetches data when it first appears on the screen? React › TestingReactTestingIntermediate
24How would you manually trigger a not found response when a specific piece of data, like a product, does not exist? Next.js › Error Handling & Not Found PagesNext.jsError Handling & Not Found PagesIntermediate
25How do server actions automatically update the user interface after making a change to data? Next.js › Server Actions & MutationsNext.jsServer Actions & MutationsIntermediate
26How would you test a server component that fetches data asynchronously? Next.js › Testing Next.js ApplicationsNext.jsTesting Next.js ApplicationsIntermediate
27How do you type the data returned from an API call inside a server component to get proper autocomplete and error checking? Next.js › TypeScript with Next.jsNext.jsTypeScript with Next.jsIntermediate
28How would you fetch data safely inside useEffect while avoiding a common bug called a race condition? React › Effects & LifecycleReactEffects & LifecycleAdvanced
29How do you fetch and share data across a layout and all of its nested pages efficiently? Next.js › Layouts & TemplatesNext.jsLayouts & TemplatesAdvanced
30What is Suspense in React and what basic problem does it solve? React › Suspense & Concurrent RenderingReactSuspense & Concurrent RenderingBeginner
31What are API routes in Next.js and why would you use them? Next.js › API RoutesNext.jsAPI RoutesBeginner
32How do you read query parameters and the request body inside an API route? Next.js › API RoutesNext.jsAPI RoutesBeginner
33What is a dynamic route in Next.js, and how do you create one? Next.js › Dynamic Routes & Catch-All SegmentsNext.jsDynamic Routes & Catch-All SegmentsBeginner
34How do you render a fallback message when a list is empty? React › Conditional Rendering & Lists (Keys)ReactConditional Rendering & Lists (Keys)Intermediate
35How do you read a dynamic value from the URL, such as a product id, using React Router? React › RoutingReactRoutingIntermediate
36What is a React Server Component and how is it different from a regular component? React › Server ComponentsReactServer ComponentsIntermediate
37How do middleware, such as Redux Thunk, help handle asynchronous operations like API calls in Redux? React › State Management Libraries (Redux, Zustand & Recoil)ReactState Management Libraries (Redux, Zustand & Recoil)Intermediate
38What is incremental static regeneration and how does it solve the problem of static content becoming outdated? React › Static Site Generation (SSG) & HydrationReactStatic Site Generation (SSG) & HydrationIntermediate
39What are the main caching layers in the Next.js App Router? Next.js › CachingNext.jsCachingIntermediate
40How do client components and server components work together in the same page? Next.js › Client Components & HydrationNext.jsClient Components & HydrationIntermediate
41How do you fetch draft or unpublished content differently from published content when Draft Mode is enabled? Next.js › Draft Mode & Preview ModeNext.jsDraft Mode & Preview ModeIntermediate
42What is streaming in Next.js, and how does it improve the user experience? Next.js › Loading UI & Streaming with SuspenseNext.jsLoading UI & Streaming with SuspenseIntermediate
43How do you use multiple Suspense boundaries on the same page to stream different sections independently? Next.js › Loading UI & Streaming with SuspenseNext.jsLoading UI & Streaming with SuspenseIntermediate
44How do you use revalidateTag to refresh multiple related pieces of cached content at once? Next.js › On-Demand Revalidation StrategiesNext.jsOn-Demand Revalidation StrategiesIntermediate
45When would server side rendering be the better choice over static site generation or incremental static regeneration? Next.js › Rendering (SSR/SSG/ISR)Next.jsRendering (SSR/SSG/ISR)Intermediate
46How would you build a custom hook that debounces a fast changing value, such as text typed into a search box? React › Custom HooksReactCustom HooksAdvanced
47How would you safely display user generated HTML content, such as a rich text comment, without exposing your app to XSS attacks? React › Security in React (XSS & dangerouslySetInnerHTML)ReactSecurity in React (XSS & dangerouslySetInnerHTML)Advanced
48How do Server Components and Client Components work together in the same app? React › Server ComponentsReactServer ComponentsAdvanced
49How would you decide between static site generation and server side rendering for a specific page? React › Static Site Generation (SSG) & HydrationReactStatic Site Generation (SSG) & HydrationAdvanced
50What are best practices for managing translation content at scale in a large, multilingual Next.js application? Next.js › Internationalization (i18n) in Next.jsNext.jsInternationalization (i18n) in Next.jsAdvanced
51How does the concept of state management differ in Next.js compared to a purely client side React application, given the presence of server components? Next.js › State Management in Next.js AppsNext.jsState Management in Next.js AppsAdvanced