[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:frontend\u002Freact-context-state":4,"config":235},null,{"field_key":5,"field_name":6,"seniority":7,"topic_key":8,"topic_name":9,"spec_key":7,"spec_name":7,"locale":10,"cell_total":11,"field_total":12,"seniorities":13,"topics":17,"specs":133,"samples":150},"frontend","Frontend","","react-context-state","React Context State","en",75,2925,[14,15,16],"junior","mid","senior",[18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130],{"key":19,"name":20,"count":11},"accessibility","Accessibility",{"key":22,"name":23,"count":11},"angular-change-detection","Angular Change Detection",{"key":25,"name":26,"count":11},"angular-components-lifecycle","Angular Components Lifecycle",{"key":28,"name":29,"count":11},"angular-dependency-injection","Angular Dependency Injection",{"key":31,"name":32,"count":11},"angular-directives-pipes","Angular Directives Pipes",{"key":34,"name":35,"count":11},"angular-router-forms","Angular Router Forms",{"key":37,"name":38,"count":11},"angular-testing-performance","Angular Testing Performance",{"key":40,"name":41,"count":11},"css-layout","Css Layout",{"key":43,"name":44,"count":11},"dom-browser-apis","Dom Browser Apis",{"key":46,"name":47,"count":11},"javascript-async-concurrency","Javascript Async Concurrency",{"key":49,"name":50,"count":11},"javascript-language","Javascript Language",{"key":52,"name":53,"count":11},"javascript-memory-performance","Javascript Memory Performance",{"key":55,"name":56,"count":11},"javascript-modules-bundling","Javascript Modules Bundling",{"key":58,"name":59,"count":11},"javascript-prototypes-oop","Javascript Prototypes Oop",{"key":61,"name":62,"count":11},"javascript-runtime-apis","Javascript Runtime Apis",{"key":64,"name":65,"count":11},"javascript-testing-tooling","Javascript Testing Tooling",{"key":67,"name":68,"count":11},"performance","Performance",{"key":70,"name":71,"count":11},"react-components-jsx","React Components Jsx",{"key":8,"name":9,"count":11},{"key":74,"name":75,"count":11},"react-effects-lifecycle","React Effects Lifecycle",{"key":77,"name":78,"count":11},"react-forms-suspense","React Forms Suspense",{"key":80,"name":81,"count":11},"react-hooks-state","React Hooks State",{"key":83,"name":84,"count":11},"react-rendering-performance","React Rendering Performance",{"key":86,"name":87,"count":11},"rendering-reactivity","Rendering Reactivity",{"key":89,"name":90,"count":11},"state-management","State Management",{"key":92,"name":93,"count":11},"testing","Testing",{"key":95,"name":96,"count":11},"typescript-advanced-types","Typescript Advanced Types",{"key":98,"name":99,"count":11},"typescript-generics","Typescript Generics",{"key":101,"name":102,"count":11},"typescript-modules-declarations","Typescript Modules Declarations",{"key":104,"name":105,"count":11},"typescript-narrowing-control-flow","Typescript Narrowing Control Flow",{"key":107,"name":108,"count":11},"typescript-tooling-config","Typescript Tooling Config",{"key":110,"name":111,"count":11},"typescript-type-fundamentals","Typescript Type Fundamentals",{"key":113,"name":114,"count":11},"vue-components-props","Vue Components Props",{"key":116,"name":117,"count":11},"vue-composition-api","Vue Composition Api",{"key":119,"name":120,"count":11},"vue-directives-templates","Vue Directives Templates",{"key":122,"name":123,"count":11},"vue-performance-testing","Vue Performance Testing",{"key":125,"name":126,"count":11},"vue-reactivity-system","Vue Reactivity System",{"key":128,"name":129,"count":11},"vue-router-state-management","Vue Router State Management",{"key":131,"name":132,"count":11},"web-security","Web Security",[134,138,141,144,147],{"key":135,"name":136,"count":137},"angular","Angular",450,{"key":139,"name":140,"count":137},"javascript","JavaScript",{"key":142,"name":143,"count":137},"react","React",{"key":145,"name":146,"count":137},"typescript","TypeScript",{"key":148,"name":149,"count":137},"vue","Vue",[151,169,183,196,209,222],{"id":152,"topic":9,"difficulty":153,"body":154,"options":155,"correct_key":157,"explanation":168},"019f5be4-0a8b-7b44-8e66-afbf9684b7c4",1,"Two sibling components, `SearchBox` and `ResultsList`, both need the same `query` string — `SearchBox` writes it, `ResultsList` reads it. Right now each has its own local `useState`, so they drift out of sync. What is the idiomatic React fix?",[156,159,162,165],{"key":157,"text":158},"a","Move `query` state up to the shared parent and pass it plus an updater down as props to both children",{"key":160,"text":161},"b","Give `ResultsList` a `useEffect` that polls `SearchBox`'s DOM node to read its current input value",{"key":163,"text":164},"c","Store `query` in a global mutable variable that `ResultsList` reads on every render",{"key":166,"text":167},"d","Wrap each sibling in its own separate `Context.Provider` so they broadcast state directly to each other","Siblings can't share state by talking to each other directly — React data flows down through props, not sideways. The standard fix is 'lifting state up': move the state to the nearest common ancestor, then pass the value and a setter down to both children as props. That guarantees a single source of truth. Reaching for Context here is overkill for two siblings one level apart; Context earns its keep once a value needs to cross many levels or many unrelated branches, not for a simple parent-of-two case.",{"id":170,"topic":9,"difficulty":171,"body":172,"options":173,"correct_key":160,"explanation":182},"019f5be4-0a8c-7d12-a77e-896ed8dbb58c",2,"In React's data flow, a child component needs to tell its parent that something happened (e.g. a button was clicked). Which statement correctly describes how this fits the \"props down, events up\" model?",[174,176,178,180],{"key":157,"text":175},"The child mutates a prop object directly, and the parent re-renders because the object changed",{"key":160,"text":177},"Parent passes a callback prop down; child calls it, and parent updates its own state in response",{"key":163,"text":179},"The child dispatches a native DOM `CustomEvent` that the parent's own listener happens to catch",{"key":166,"text":181},"The child imports the parent component's module and calls its internal state setter directly","Data flows down as props; anything going the other way has to travel through a function the parent handed down, not through the child reaching backward into the parent. The parent defines a callback (e.g. `onSearch`), passes it down, the child calls it when the event happens, and the parent's own `useState` update is what actually causes the re-render. Mutating a passed-in prop object (a) breaks React's rules for props, and reaching into another module's internals (d) isn't how components communicate.",{"id":184,"topic":9,"difficulty":153,"body":185,"options":186,"correct_key":163,"explanation":195},"019f5be4-0a8d-789b-99a8-d63ccebd332e","In React, `createContext('light')` sets `'light'` as the context's default value. Precisely when does a component reading this context via `useContext` actually receive that default `'light'` value?",[187,189,191,193],{"key":157,"text":188},"Whenever there is at least one Provider for this context mounted anywhere in the app, regardless of what `value` it was given",{"key":160,"text":190},"Only when a Provider passes `value={null}`; a Provider passing `value={undefined}` still falls back to `'light'`",{"key":163,"text":192},"Only when there is no enclosing Provider at all; a Provider that passes `value={undefined}` still wins and the component reads `undefined`, not `'light'`",{"key":166,"text":194},"Only on the component's very first render; later renders keep returning `'light'` even once a Provider with a real value mounts above it","The default argument to `createContext` is a fallback used only when `useContext` finds no enclosing Provider whatsoever — it is not merged with, or used to fill in for, an explicit `value`. A `\u003CThemeContext.Provider value={undefined}>` is still a Provider: it wins over the default, so `useContext` reads `undefined`, not `'light'`. Verified by rendering three siblings side by side in React 19 — one with no Provider (reads `'light'`), one wrapped in a Provider with `value={undefined}` (reads `undefined`), and one wrapped in a Provider with `value='dark'` (reads `'dark'`) — confirming the default only applies to the first case.",{"id":197,"topic":9,"difficulty":171,"body":198,"options":199,"correct_key":166,"explanation":208},"019f5be4-0a8d-7f1e-86ae-91aafbc4edbd","A tree is `App -> Page -> Section` (only one level of passthrough), and `Section` needs a `currentUser` value that `App` holds. A teammate insists this already justifies a full Context setup. What's the most reasonable junior-level take?",[200,202,204,206],{"key":157,"text":201},"Agreed — any prop passed through even one component is prop drilling and must use Context",{"key":160,"text":203},"Disagreed — Context should never be used unless the app also uses Redux",{"key":163,"text":205},"Agreed — Context is required whenever a value is read by more than one component anywhere in the tree",{"key":166,"text":207},"Disagreed — passing through one intermediate component is cheap; Context adds indirection not worth it yet","One hop through one intermediate component is a cheap, easy-to-follow case, not the kind of deep or wide chain that Context is meant to solve. Introducing Context here adds a Provider, a consumer hook, and an extra layer of indirection for a problem that a single prop already solves cleanly. Context starts paying off once the chain gets several levels deep or the value needs to reach many unrelated branches at once.",{"id":210,"topic":9,"difficulty":153,"body":211,"options":212,"correct_key":157,"explanation":221},"019f5be4-0a8e-79a6-9371-0541a137fd50","```\nconst ThemeContext = createContext('light')\n\nfunction Toolbar() {\n  return \u003CButton \u002F>\n}\n\nfunction Button() {\n  const theme = useContext(ThemeContext)\n  return \u003Cbutton className={theme}>Save\u003C\u002Fbutton>\n}\n\nfunction App() {\n  return (\n    \u003CThemeContext.Provider value=\"dark\">\n      \u003CToolbar \u002F>\n    \u003C\u002FThemeContext.Provider>\n  )\n}\n```\nWhat `className` does the rendered `\u003Cbutton>` end up with?",[213,215,217,219],{"key":157,"text":214},"\"dark\" — `Button` reads from the nearest Provider above it, regardless of `Toolbar` in between",{"key":160,"text":216},"`\"light\"` — `Button` always gets `createContext`'s default value since `Toolbar` didn't forward it as a prop",{"key":163,"text":218},"`undefined` — `useContext` only works when the calling component is a direct child of the Provider",{"key":166,"text":220},"`\"dark\"`, but only starting from the second render","Context is not passed through props at all — any descendant, no matter how deeply nested, can call `useContext` and get the value from the nearest enclosing Provider. `Toolbar` in between never needs to know the context exists. So `Button` reads `\"dark\"` on the very first render, correctly, without `Toolbar` forwarding anything.",{"id":223,"topic":9,"difficulty":171,"body":224,"options":225,"correct_key":160,"explanation":234},"019f5be4-0a8f-7339-8477-dd9d1b647e97","```\nconst ThemeContext = createContext('light')\n\nfunction Label() {\n  const theme = useContext(ThemeContext)\n  return \u003Cspan>{theme}\u003C\u002Fspan>\n}\n\nfunction App() {\n  return (\n    \u003Cdiv>\n      \u003CThemeContext.Provider value=\"dark\">\n        {\u002F* Label is NOT placed here *\u002F}\n      \u003C\u002FThemeContext.Provider>\n      \u003CLabel \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n```\nWhat text does `\u003CLabel \u002F>` render?",[226,228,230,232],{"key":157,"text":227},"`\"dark\"` — a Provider for `ThemeContext` exists somewhere in the `App` tree",{"key":160,"text":229},"\"light\" — `Label` isn't a descendant of that Provider, so it falls back to the default value",{"key":163,"text":231},"An error is thrown at render time because `Label` isn't wrapped by any Provider",{"key":166,"text":233},"An empty string, since context values only resolve inside effects, not during render","A Provider only affects components rendered inside it. Here `Label` is a sibling of the `ThemeContext.Provider`, not a child of it, so from `Label`'s point of view there is no enclosing Provider at all — `useContext` returns the default value passed to `createContext('light')`. This is the classic silent-bug shape: the Provider exists in the file, but the wiring puts the consumer outside its subtree, and nothing errors — it just quietly falls back to the default.",{"fields":236,"seniorities":410,"interview_shapes":411,"locales":416,"oauth":418,"question_count":421,"coach_enabled":422,"jd_match_enabled":422},[237,262,270,287,311,324,343,362,384,391,397,404],{"key":238,"name_tr":239,"name_en":239,"sort":153,"specializations":240},"backend","Backend",[241,244,247,250,253,256,259],{"key":242,"name":243,"field":238},"general","Genel",{"key":245,"name":246,"field":238},"go","Go",{"key":248,"name":249,"field":238},"python","Python",{"key":251,"name":252,"field":238},"java","Java",{"key":254,"name":255,"field":238},"csharp","C#\u002F.NET",{"key":257,"name":258,"field":238},"nodejs","Node.js",{"key":260,"name":261,"field":238},"php","PHP",{"key":5,"name_tr":6,"name_en":6,"sort":171,"specializations":263},[264,265,266,267,268,269],{"key":242,"name":243,"field":5},{"key":139,"name":140,"field":5},{"key":145,"name":146,"field":5},{"key":142,"name":143,"field":5},{"key":148,"name":149,"field":5},{"key":135,"name":136,"field":5},{"key":271,"name_tr":272,"name_en":272,"sort":273,"specializations":274},"fullstack","Fullstack",3,[275,276,277,278,279,280,281,282,283,284,285,286],{"key":242,"name":243,"field":271},{"key":245,"name":246,"field":238},{"key":248,"name":249,"field":238},{"key":251,"name":252,"field":238},{"key":254,"name":255,"field":238},{"key":257,"name":258,"field":238},{"key":260,"name":261,"field":238},{"key":139,"name":140,"field":5},{"key":145,"name":146,"field":5},{"key":142,"name":143,"field":5},{"key":148,"name":149,"field":5},{"key":135,"name":136,"field":5},{"key":288,"name_tr":289,"name_en":289,"sort":290,"specializations":291},"devops-cloud","DevOps \u002F Cloud",4,[292,293,296,299,302,305,308],{"key":242,"name":243,"field":288},{"key":294,"name":295,"field":288},"aws","AWS",{"key":297,"name":298,"field":288},"gcp","GCP",{"key":300,"name":301,"field":288},"azure","Azure",{"key":303,"name":304,"field":288},"kubernetes","Kubernetes",{"key":306,"name":307,"field":288},"terraform","Terraform",{"key":309,"name":310,"field":288},"linux","Linux",{"key":312,"name_tr":313,"name_en":313,"sort":314,"specializations":315},"ai-engineer","AI Engineer",5,[316,317,318,321],{"key":242,"name":243,"field":312},{"key":248,"name":249,"field":312},{"key":319,"name":320,"field":312},"llm-rag","LLM\u002FRAG",{"key":322,"name":323,"field":312},"mlops","MLOps",{"key":325,"name_tr":326,"name_en":327,"sort":328,"specializations":329},"database","Veritabanı","Database",6,[330,331,334,337,340],{"key":242,"name":243,"field":325},{"key":332,"name":333,"field":325},"postgresql","PostgreSQL",{"key":335,"name":336,"field":325},"mysql","MySQL",{"key":338,"name":339,"field":325},"mongodb","MongoDB",{"key":341,"name":342,"field":325},"redis","Redis",{"key":344,"name_tr":345,"name_en":346,"sort":347,"specializations":348},"mobile","Mobil","Mobile",7,[349,350,353,356,359],{"key":242,"name":243,"field":344},{"key":351,"name":352,"field":344},"ios-swift","iOS (Swift)",{"key":354,"name":355,"field":344},"android-kotlin","Android (Kotlin)",{"key":357,"name":358,"field":344},"flutter","Flutter",{"key":360,"name":361,"field":344},"react-native","React Native",{"key":363,"name_tr":364,"name_en":365,"sort":366,"specializations":367},"security","Güvenlik","Security",8,[368,369,372,375,378,381],{"key":242,"name":243,"field":363},{"key":370,"name":371,"field":363},"appsec","AppSec",{"key":373,"name":374,"field":363},"offensive-pentest","Offensive \u002F Pentest",{"key":376,"name":377,"field":363},"cloud-security","Cloud Security",{"key":379,"name":380,"field":363},"devsecops","DevSecOps",{"key":382,"name":383,"field":363},"blue-team-incident","Blue Team \u002F Incident",{"key":385,"name_tr":386,"name_en":387,"sort":388,"specializations":389},"qa-test-automation","QA \u002F Test Otomasyonu","QA \u002F Test Automation",9,[390],{"key":242,"name":243,"field":385},{"key":392,"name_tr":393,"name_en":393,"sort":394,"specializations":395},"data-engineer","Data Engineer",10,[396],{"key":242,"name":243,"field":392},{"key":398,"name_tr":399,"name_en":400,"sort":401,"specializations":402},"game-dev","Oyun Geliştirme","Game Development",11,[403],{"key":242,"name":243,"field":398},{"key":405,"name_tr":406,"name_en":406,"sort":407,"specializations":408},"ml-engineer","ML Engineer",12,[409],{"key":242,"name":243,"field":405},[14,15,16],{"junior":412,"mid":414,"senior":415},{"questions":413,"median_sec":3},20,{"questions":413,"median_sec":3},{"questions":413,"median_sec":3},[417,10],"tr",[419,420],"google","github",21750,true]