At least 10 questions — mix of concept, syntax, practical, and logic. Score ≥80% (enforced by the API) to save progress.
15 questions · concept 5 · syntax 3 · practical 4 · logic 3
1. What is an RTK client draft? Concept
A Nest ticket row already saved A Query cache entry for GET /tickets A JWT stored for Axios Client-only unfinished input that survives navigation until submit or discard
2. After Nest successfully creates a ticket from a draft, what should you do? Syntax
Keep the draft forever for audit dispatch(reset) and invalidateQueries for the list Push the ticket into both Redux and Query arrays Store the JWT in the draft slice
3. Why not render draft rows inside the Nest-backed list UI? Practical
Query cannot show Nest data otherwise Drafts are encrypted by Redux Private routes forbid lists It creates a second fake source of truth for entities Nest owns
4. Which pattern submits a draft with Query while RTK holds the fields? Logic
BrowserRouter navigate during render useQuery to POST the draft useMutation({ mutationFn: () => api.create(draft), onSuccess: reset+invalidate }) createSlice.mutation
5. On mutation failure, what should happen to the draft? Concept
Reset it immediately to a blank draft Keep it so the user can fix and retry Copy it into the Query cache as if it succeeded Discard it and navigate the user back to the list
6. Why is useEffect(() => setDraft(ticket), [ticket]) often a bug? Practical
Effects cannot call setState, so it never runs It makes the draft slice read-only after the first render It forces the mutation to fire on every keystroke It creates ping-pong sync; prefer key remount or intentional init
7. Should JWTs live in an RTK slice in this academy? Syntax
No — prefer httpOnly cookies Nest sets Yes — put them in initialState Yes — Redux is the safest token store Only if using createAsyncThunk
8. How do you read the wizard title in a component? Logic
document.getElementById useAppSelector(s => s.ticketWizard.title) useParams() useQuery(['title'])
9. Where should you practice the draft → Nest → invalidate flow in this course? Concept
In the Week 1 Tic-Tac-Toe mini-project In the Week 3 Next.js blog dashboard shell Week 4 Notes UI mini-projects (RTK draft + Query list) Only inside Nest end-to-end tests
10. What does surviving client navigation imply for a draft slice? Practical
Every route change must reset Redux Next always full-reloads on Link Provider stays mounted so Redux state persists across client route changes Drafts are stored in the URL only
11. What is this slice modeling? Concept intermediate
const draftSlice = createSlice({
name: 'ticketDraft',
initialState: { title: '', body: '' },
reducers: {
setTitle: (s, a) => { s.title = a.payload; },
reset: () => ({ title: '', body: '' }),
},
});The server’s ticket list A Query cache entry JWT claims Client-only draft fields for an unsaved ticket
12. Why call both reset() and invalidateQueries on success? Syntax advanced
const mutation = useMutation({
mutationFn: () => api.create(draft),
onSuccess: () => {
dispatch(reset());
queryClient.invalidateQueries({ queryKey: ['tickets'] });
},
});To store the ticket twice Clear the client draft and refresh the server-owned list To sign a new JWT invalidateQueries resets the draft
13. What should happen to the draft on mutation error? Practical intermediate
onError: () => { /* ??? */ }Reset it immediately Push it into the Query cache Keep it so the user can fix the input and retry Clear the database
14. Why is merging draft rows into the server list a smell? Logic advanced
const rows = [...queryTickets, ...draftTickets];It creates a second source of truth for entities Nest owns Query can’t render arrays Drafts are encrypted Arrays can’t be spread
15. How is the component reading the draft title? Concept intermediate
const title = useAppSelector((s) => s.ticketDraft.title);With useParams() With useQuery(["title"]) With a selector into the RTK slice state With document.getElementById
Submit quiz Checking your session…