[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:frontend\u002Ftypescript-generics":4,"config":232},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","","typescript-generics","Typescript Generics","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,75,78,81,84,87,90,93,96,99,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":73,"name":74,"count":11},"react-context-state","React Context State",{"key":76,"name":77,"count":11},"react-effects-lifecycle","React Effects Lifecycle",{"key":79,"name":80,"count":11},"react-forms-suspense","React Forms Suspense",{"key":82,"name":83,"count":11},"react-hooks-state","React Hooks State",{"key":85,"name":86,"count":11},"react-rendering-performance","React Rendering Performance",{"key":88,"name":89,"count":11},"rendering-reactivity","Rendering Reactivity",{"key":91,"name":92,"count":11},"state-management","State Management",{"key":94,"name":95,"count":11},"testing","Testing",{"key":97,"name":98,"count":11},"typescript-advanced-types","Typescript Advanced Types",{"key":8,"name":9,"count":11},{"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,182,195,209,219],{"id":152,"topic":9,"difficulty":153,"body":154,"options":155,"correct_key":160,"explanation":168},"019f7611-bd09-7b8f-ad2b-a4e142fe1c39",1,"What is the main benefit of writing `function identity\u003CT>(x: T): T { return x; }` instead of `function identity(x: any): any { return x; }`?",[156,159,162,165],{"key":157,"text":158},"a","The generic version runs faster at runtime",{"key":160,"text":161},"b","The generic version preserves the input's specific type in the return value",{"key":163,"text":164},"c","The generic version allows any type to be passed without restriction, exactly like `any`",{"key":166,"text":167},"d","The generic version is only needed for class methods, not plain functions","With `any`, the function's return type is always `any` — TypeScript loses track of what was actually passed in, so `identity(5) + 1` and `identity(5).toUpperCase()` both type-check with no error. With `T`, the compiler captures the actual argument's type and returns that same type, so calling `identity(5)` gives back `number`, letting the compiler catch `identity(5).toUpperCase()` as an error.",{"id":170,"topic":9,"difficulty":153,"body":171,"options":172,"correct_key":163,"explanation":181},"019f7611-bd0a-738e-8848-a8f9a5d8cfed","```typescript\nfunction first\u003CT>(arr: T[]): T {\n  return arr[0];\n}\nconst result = first([1, 2, 3]);\n```\nWhat type does TypeScript infer for `result`?",[173,175,177,179],{"key":157,"text":174},"`any`",{"key":160,"text":176},"`T`",{"key":163,"text":178},"`number`",{"key":166,"text":180},"`number[]`","TypeScript infers `T` from the argument passed to `first` — since `[1, 2, 3]` is `number[]`, `T` is inferred as `number`, so `first`'s return type resolves to `number`. No explicit type argument is needed; inference does this automatically from the call site.",{"id":183,"topic":9,"difficulty":153,"body":184,"options":185,"correct_key":157,"explanation":194},"019f7611-bd0a-7b02-95e0-9ccc3a2a1710","```typescript\nfunction wrap\u003CT>(x: T): T[] {\n  return [x];\n}\nconst result = wrap(\"hi\");\n```\nWhat type does `result` have?",[186,188,190,192],{"key":157,"text":187},"`string[]`",{"key":160,"text":189},"`string`",{"key":163,"text":191},"`T[]`",{"key":166,"text":193},"`any[]`","`T` is inferred from the argument `\"hi\"`, which has type `string`, so `T` becomes `string` and the return type `T[]` resolves to `string[]`. TypeScript's inference happens per call — a later call `wrap(5)` would independently infer `T` as `number`, giving `number[]`.",{"id":196,"topic":9,"difficulty":197,"body":198,"options":199,"correct_key":166,"explanation":208},"019f7611-bd0b-721f-8159-237431c644da",2,"```typescript\nfunction identity\u003CT>(x: T): T {\n  return x;\n}\nidentity\u003Cstring>(5);\n```\nWhat happens when this line is type-checked?",[200,202,204,206],{"key":157,"text":201},"It compiles fine; `T` is inferred as `number` regardless of the explicit `\u003Cstring>`",{"key":160,"text":203},"It compiles fine; TypeScript silently converts `5` to `\"5\"`",{"key":163,"text":205},"It only errors at runtime, not during compilation",{"key":166,"text":207},"It is a type error","When a type argument is explicitly supplied (`identity\u003Cstring>`), TypeScript uses that instead of inferring from the argument, and then checks the actual argument against it. Since `5` (type `number`) isn't assignable to `string`, this fails to compile — it's a compile-time type error, not a silent conversion or a runtime-only issue.",{"id":210,"topic":9,"difficulty":197,"body":211,"options":212,"correct_key":160,"explanation":218},"019f7611-bd0b-798e-8f92-0649b6dc13f9","```typescript\nclass Box\u003CT> {\n  constructor(public value: T) {}\n}\nconst b = new Box(5);\n```\nWhat type does `b.value` have?",[213,214,215,216],{"key":157,"text":176},{"key":160,"text":178},{"key":163,"text":174},{"key":166,"text":217},"`Box\u003CT>`","`Box\u003CT>` is a generic class; when constructed as `new Box(5)`, TypeScript infers `T` from the constructor argument `5` (type `number`), so this instance is `Box\u003Cnumber>` and `b.value` has type `number`. No explicit `new Box\u003Cnumber>(5)` was needed — inference works the same way for class constructors as for functions.",{"id":220,"topic":9,"difficulty":197,"body":221,"options":222,"correct_key":163,"explanation":231},"019f7611-bd0c-71ee-82a4-1e66343760b1","In `function pick\u003CT extends { id: number }>(x: T): number { return x.id; }`, what does `T extends { id: number }` mean?",[223,225,227,229],{"key":157,"text":224},"`T` must be exactly the type `{ id: number }`, with no other properties allowed",{"key":160,"text":226},"`T` is optional and defaults to `{ id: number }` if not provided",{"key":163,"text":228},"`T` can be any type, as long as it has at least an `id` property of type `number`",{"key":166,"text":230},"`T` must be a subclass of a class named `{ id: number }`","A generic constraint (`extends`) restricts what `T` is allowed to be, but doesn't require an exact match — `T` just needs to be *assignable to* the constraint, meaning it must have (at minimum) an `id: number` property. Extra properties are fine: `{ id: number, name: string }` satisfies this constraint too.",{"fields":233,"seniorities":407,"interview_shapes":408,"locales":413,"oauth":415,"question_count":418,"coach_enabled":419,"jd_match_enabled":419},[234,259,267,284,308,321,340,359,381,388,394,401],{"key":235,"name_tr":236,"name_en":236,"sort":153,"specializations":237},"backend","Backend",[238,241,244,247,250,253,256],{"key":239,"name":240,"field":235},"general","Genel",{"key":242,"name":243,"field":235},"go","Go",{"key":245,"name":246,"field":235},"python","Python",{"key":248,"name":249,"field":235},"java","Java",{"key":251,"name":252,"field":235},"csharp","C#\u002F.NET",{"key":254,"name":255,"field":235},"nodejs","Node.js",{"key":257,"name":258,"field":235},"php","PHP",{"key":5,"name_tr":6,"name_en":6,"sort":197,"specializations":260},[261,262,263,264,265,266],{"key":239,"name":240,"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":268,"name_tr":269,"name_en":269,"sort":270,"specializations":271},"fullstack","Fullstack",3,[272,273,274,275,276,277,278,279,280,281,282,283],{"key":239,"name":240,"field":268},{"key":242,"name":243,"field":235},{"key":245,"name":246,"field":235},{"key":248,"name":249,"field":235},{"key":251,"name":252,"field":235},{"key":254,"name":255,"field":235},{"key":257,"name":258,"field":235},{"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":285,"name_tr":286,"name_en":286,"sort":287,"specializations":288},"devops-cloud","DevOps \u002F Cloud",4,[289,290,293,296,299,302,305],{"key":239,"name":240,"field":285},{"key":291,"name":292,"field":285},"aws","AWS",{"key":294,"name":295,"field":285},"gcp","GCP",{"key":297,"name":298,"field":285},"azure","Azure",{"key":300,"name":301,"field":285},"kubernetes","Kubernetes",{"key":303,"name":304,"field":285},"terraform","Terraform",{"key":306,"name":307,"field":285},"linux","Linux",{"key":309,"name_tr":310,"name_en":310,"sort":311,"specializations":312},"ai-engineer","AI Engineer",5,[313,314,315,318],{"key":239,"name":240,"field":309},{"key":245,"name":246,"field":309},{"key":316,"name":317,"field":309},"llm-rag","LLM\u002FRAG",{"key":319,"name":320,"field":309},"mlops","MLOps",{"key":322,"name_tr":323,"name_en":324,"sort":325,"specializations":326},"database","Veritabanı","Database",6,[327,328,331,334,337],{"key":239,"name":240,"field":322},{"key":329,"name":330,"field":322},"postgresql","PostgreSQL",{"key":332,"name":333,"field":322},"mysql","MySQL",{"key":335,"name":336,"field":322},"mongodb","MongoDB",{"key":338,"name":339,"field":322},"redis","Redis",{"key":341,"name_tr":342,"name_en":343,"sort":344,"specializations":345},"mobile","Mobil","Mobile",7,[346,347,350,353,356],{"key":239,"name":240,"field":341},{"key":348,"name":349,"field":341},"ios-swift","iOS (Swift)",{"key":351,"name":352,"field":341},"android-kotlin","Android (Kotlin)",{"key":354,"name":355,"field":341},"flutter","Flutter",{"key":357,"name":358,"field":341},"react-native","React Native",{"key":360,"name_tr":361,"name_en":362,"sort":363,"specializations":364},"security","Güvenlik","Security",8,[365,366,369,372,375,378],{"key":239,"name":240,"field":360},{"key":367,"name":368,"field":360},"appsec","AppSec",{"key":370,"name":371,"field":360},"offensive-pentest","Offensive \u002F Pentest",{"key":373,"name":374,"field":360},"cloud-security","Cloud Security",{"key":376,"name":377,"field":360},"devsecops","DevSecOps",{"key":379,"name":380,"field":360},"blue-team-incident","Blue Team \u002F Incident",{"key":382,"name_tr":383,"name_en":384,"sort":385,"specializations":386},"qa-test-automation","QA \u002F Test Otomasyonu","QA \u002F Test Automation",9,[387],{"key":239,"name":240,"field":382},{"key":389,"name_tr":390,"name_en":390,"sort":391,"specializations":392},"data-engineer","Data Engineer",10,[393],{"key":239,"name":240,"field":389},{"key":395,"name_tr":396,"name_en":397,"sort":398,"specializations":399},"game-dev","Oyun Geliştirme","Game Development",11,[400],{"key":239,"name":240,"field":395},{"key":402,"name_tr":403,"name_en":403,"sort":404,"specializations":405},"ml-engineer","ML Engineer",12,[406],{"key":239,"name":240,"field":402},[14,15,16],{"junior":409,"mid":411,"senior":412},{"questions":410,"median_sec":3},20,{"questions":410,"median_sec":3},{"questions":410,"median_sec":3},[414,10],"tr",[416,417],"google","github",21750,true]