{"id":12907,"date":"2024-09-20T10:00:54","date_gmt":"2024-09-20T04:30:54","guid":{"rendered":"https:\/\/www.placementpreparation.io\/blog\/?p=12907"},"modified":"2025-02-27T12:42:34","modified_gmt":"2025-02-27T07:12:34","slug":"typescript-interview-questions-for-freshers","status":"publish","type":"post","link":"https:\/\/www.placementpreparation.io\/blog\/typescript-interview-questions-for-freshers\/","title":{"rendered":"Top TypeScript Interview Questions for Freshers"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>Are you preparing for your first TypeScript interview and wondering what questions you might face?<\/p><p>Understanding the key TypeScript interview questions for freshers can give you more clarity.<\/p><p>With this guide, you&rsquo;ll be well-prepared to tackle these TypeScript interview questions and answers for freshers and make a strong impression in your interview.<\/p><p><a href=\"https:\/\/www.guvi.in\/mlp\/fsd-student-program-wp?utm_source=placement_preparation&amp;utm_medium=blog_banner&amp;utm_campaign=typescript_interview_questions_for_freshers_horizontal\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignnone wp-image-14310 size-full\" src=\"https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal.webp\" alt=\"fsd student program banner horizontal\" width=\"2270\" height=\"600\" srcset=\"https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal.webp 2270w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-300x79.webp 300w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-1024x271.webp 1024w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-768x203.webp 768w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-1536x406.webp 1536w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-2048x541.webp 2048w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-150x40.webp 150w\" sizes=\"(max-width: 2270px) 100vw, 2270px\"><\/a><\/p><h2 id=\"practice-typescript-interview-questions\">Practice TypeScript Interview Questions and Answers<\/h2><p>Below are the top 50 TypeScript interview questions for freshers with answers:<\/p><h3 id=\"what-is-typescript\">1. What is TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>TypeScript is a strongly typed, object-oriented, compiled language. It is a superset of JavaScript, meaning any valid JavaScript is also valid TypeScript. It adds features like static typing, classes, and interfaces to JavaScript.<\/p><h3 id=\"why-use-typescript\">2. Why do we use TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>TypeScript helps developers catch errors early during development, making the code more reliable and maintainable. It adds type definitions, which improve IDE support for autocompletion and refactoring. It also allows the use of modern JavaScript features, even on older JavaScript engines.<\/p><h3 id=\"key-features-of-typescript\">3. What are the key features of TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Some key features include static typing, interfaces, classes, and inheritance. It supports ES6 and ES7 features like async\/await and modules. TypeScript also compiles to JavaScript, ensuring compatibility with various browsers.<\/p><h3 id=\"typescript-vs-javascript-differences\">4. How is TypeScript different from JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>JavaScript is a loosely typed language, while TypeScript is strongly typed. TypeScript compiles to plain JavaScript and adds features like type checking, classes, and interfaces, which are not available in JavaScript by default.<\/p><h3 id=\"how-to-install-typescript\">5. How do you install TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>You can install TypeScript globally using npm with the following command:<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nnpm install -g typescript<br>\n<\/div><\/div><h3 id=\"what-is-a-.ts-file\">6. What is a .ts file?<\/h3><p><strong>Answer:<\/strong><\/p><p>A <strong>.ts file<\/strong> is a TypeScript file. It contains TypeScript code, which is eventually compiled into JavaScript. These files use TypeScript syntax and must be compiled into <strong>.js<\/strong> files before running in a browser or Node.js environment.<\/p><h3 id=\"what-are-typescript-types\">7. What are types in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Types define the kind of value a variable can hold. TypeScript uses static types like <strong>number<\/strong>, <strong>string<\/strong>, <strong>boolean<\/strong>, and custom types like <strong>interfaces<\/strong> or <strong>enums<\/strong>. They help to ensure variables are used in the intended manner.<\/p><h3 id=\"define-static-typing\">8. What is static typing?<\/h3><p><strong>Answer:<\/strong><\/p><p>Static typing means that variable types are known at compile time. This allows TypeScript to catch errors early before the code is executed. It contrasts with JavaScript&rsquo;s dynamic typing, where types are checked at runtime.<\/p><h3 id=\"declare-typescript-variables\">9. How do you declare a variable in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>You can declare variables using <strong>let<\/strong>, <strong>const<\/strong>, or <strong>var<\/strong>. You can also explicitly specify the type during declaration.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet name: string = &ldquo;John&rdquo;;<br>\nconst age: number = 30;<br>\n<\/div><\/div><h3 id=\"type-annotations-in-typescript\">10. What are type annotations in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Type annotations explicitly define the type of a variable or function parameter. They ensure that variables are assigned values of the correct type, making the code safer and more predictable.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet isValid: boolean = true;<br>\nlet score: number = 95;<br>\n<\/div><\/div><h3 id=\"explain-type-inference\">11. What is type inference in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>TypeScript can automatically infer the type of a variable based on the assigned value. If you declare a variable without a type, TypeScript will assign a type based on the initial value.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet name = &ldquo;Alice&rdquo;; \/\/ inferred as string<br>\n<\/div><\/div><h3 id=\"define-typescript-interface\">12. What is an interface in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Interfaces define the structure of an object by specifying properties and their types. They act as a contract to ensure that objects adhere to a specific structure.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ninterface Person {<br>\nname: string;<br>\nage: number;<br>\n}<br>\nlet john: Person = { name: &ldquo;John&rdquo;, age: 25 };<br>\n<\/div><\/div><h3 id=\"what-are-typescript-classes\">13. What are classes in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Classes are blueprints for creating objects. They contain properties and methods and support inheritance. TypeScript adds strict type-checking and encapsulation to the classes.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nclass Car {<br>\nmodel: string;<br>\nconstructor(model: string) {<br>\nthis.model = model;<br>\n}<br>\n}<br>\nlet myCar = new Car(&ldquo;Toyota&rdquo;);<br>\n<\/div><\/div><h3 id=\"access-modifiers-overview\">14. What are access modifiers in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Access modifiers control the visibility of class members (properties or methods). TypeScript has three modifiers: <strong>public<\/strong>, <strong>private<\/strong>, and <strong>protected<\/strong>. <strong>public<\/strong> is accessible anywhere, <strong>private<\/strong> within the class, and <strong>protected<\/strong> within the class and its subclasses.<\/p><h3 id=\"meaning-of-constructor\">15. What is a constructor in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>A constructor is a special method in a class that is called when an instance of the class is created. It is used to initialize object properties and can accept parameters to set initial values.<\/p><h3 id=\"what-is-typescript-inheritance\">16. What is inheritance in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Inheritance allows one class to <strong>extend<\/strong> another class, inheriting its properties and methods. The extends keyword is used to create a subclass in TypeScript.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nclass Animal {<br>\nmakeSound() {<br>\nconsole.log(&ldquo;Animal sound&rdquo;);<br>\n}<br>\n}<br>\nclass Dog extends Animal {<br>\nbark() {<br>\nconsole.log(&ldquo;Woof!&rdquo;);<br>\n}<br>\n}<br>\n<\/div><\/div><h3 id=\"interface-vs-type-difference\">17. What is the difference between interface and type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Both <strong>interface<\/strong> and <strong>type<\/strong> allow you to define shapes of objects. However, <strong>interface<\/strong> is specifically used for object types, while <strong>type<\/strong> can define more complex types like unions, intersections, or primitive types.<\/p><h3 id=\"explain-typescript-enums\">18. What is an enum in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Enums allow you to define a set of named constants, making your code more readable and easier to manage. They can be numeric or string-based.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nenum Direction {<br>\nUp = 1,<br>\nDown,<br>\nLeft,<br>\nRight<br>\n}<br>\n<\/div><\/div><h3 id=\"what-are-union-types\">19. What is a union type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Union types allow a variable to hold one of several types. This provides more flexibility while still enabling type safety.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet value: string | number;<br>\nvalue = &ldquo;Hello&rdquo;;<br>\nvalue = 10;<br>\n<\/div><\/div><h3 id=\"explain-typescript-tuples\">20. What is a tuple in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>A tuple is a type of array that has a fixed number of elements, where each element can have a different type. Tuples are useful when you know the exact number and type of elements in an array.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet person: [string, number] = [&ldquo;Alice&rdquo;, 25];<br>\n<\/div><\/div><h3 id=\"usage-of-any-type\">21. What is the any type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The<strong> any<\/strong> type allows you to assign any type of value to a variable. It disables type-checking, making it similar to JavaScript&rsquo;s dynamic typing. Use it sparingly to avoid losing the benefits of TypeScript&rsquo;s type system.<\/p><h3 id=\"unknown-type-explained\">22. What is the unknown type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The <strong>unknown<\/strong> type is similar to <strong>any<\/strong>, but it is safer because you can&rsquo;t perform operations on a value of type <strong>unknown<\/strong> without first narrowing the type through type checking.<\/p><h3 id=\"what-are-generics\">23. What are generics in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Generics allow you to create reusable components that work with a variety of data types. Instead of specifying a type when defining a function, class, or interface, you use a placeholder type.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nfunction identity&lt;T&gt;(arg: T): T {<br>\nreturn arg;<br>\n}<br>\n<\/div><\/div><h3 id=\"explain-void-type\">24. What is the void type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The <strong>void<\/strong> type represents the absence of a value. It is commonly used as the return type for functions that don&rsquo;t return a value.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nfunction logMessage(): void {<br>\nconsole.log(&ldquo;This function returns nothing&rdquo;);<br>\n}<br>\n<\/div><\/div><h3 id=\"null-vs-undefined\">25. What is the difference between null and undefined in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>null<\/strong> represents an intentional absence of value, while <strong>undefined<\/strong> indicates that a variable has been declared but has not been assigned a value. Both are subtypes of all types in TypeScript.<\/p><h3 id=\"create-typescript-array\">26. How do you create an array in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Arrays in TypeScript can be created using two syntaxes: square brackets or <strong>Array&lt;T&gt;<\/strong> notation. The elements of the array must match the specified type.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet list: number[] = [1, 2, 3];<br>\nlet list2: Array&lt;number&gt; = [4, 5, 6];<br>\n<\/div><\/div><h3 id=\"type-casting-explanation\">27. What is type casting in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Type casting allows you to tell the compiler that you know the type of a value better than TypeScript does. It helps when you want to treat a variable as a different type.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet someValue: any = &ldquo;This is a string&rdquo;;<br>\nlet strLength: number = (someValue as string).length;<br>\n<\/div><\/div><h3 id=\"define-typescript-namespaces\">28. What are namespaces in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Namespaces provide a way to group related code together, preventing naming collisions. They help organize large codebases by grouping variables, functions, and classes into a single logical unit.<\/p><h3 id=\"explain-typescript-modules\">29. What are modules in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Modules are a way to organize and reuse code by exporting and importing variables, functions, classes, and interfaces. They allow you to split your code into multiple files.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n\/\/ module.ts<br>\nexport const myFunction = () =&gt; &ldquo;Hello&rdquo;;<br>\n\/\/ main.ts<br>\nimport { myFunction } from &ldquo;.\/module&rdquo;;<br>\n<\/div><\/div><h3 id=\"handle-exceptions-typescript\">30. How do you handle exceptions in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Exception handling in TypeScript works the same way as in JavaScript, using<strong> try<\/strong>,<strong> catch<\/strong>, and <strong>finally<\/strong> blocks. This helps manage runtime errors gracefully.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntry {<br>\nthrow new Error(&ldquo;An error occurred&rdquo;);<br>\n} catch (error) {<br>\nconsole.error(error.message);<br>\n}<br>\n<\/div><\/div><h3 id=\"what-is-never-type\">31. What is the never type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The <strong>never<\/strong> type represents values that never occur. It is used as a return type for functions that always throw an exception or never return.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nfunction throwError(): never {<br>\nthrow new Error(&ldquo;This function never returns&rdquo;);<br>\n}<br>\n<\/div><\/div><h3 id=\"define-readonly-modifier\">32. What is the Readonly modifier in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The <strong>Readonly<\/strong> modifier ensures that the properties of an object cannot be modified after they are set. It makes the object immutable.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ninterface Person {<br>\nreadonly name: string;<br>\n}<br>\nlet person: Person = { name: &ldquo;John&rdquo; };<br>\n\/\/ person.name = &ldquo;Jane&rdquo;; \/\/ Error<br>\n<\/div><\/div><h3 id=\"explain-type-assertion\">33. What is type assertion in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Type assertion is a way to override TypeScript&rsquo;s inferred type and explicitly specify a different type. It is useful when you know more about the type of a value than TypeScript.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nlet value: any = &ldquo;Hello World&rdquo;;<br>\nlet length: number = (value as string).length;<br>\n<\/div><\/div><h3 id=\"type-narrowing-definition\">34. What is type narrowing in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Type narrowing is the process of refining the type of a variable based on control flow, such as type checks. This allows TypeScript to narrow a union type to a more specific type.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nfunction printLength(value: string | number) {<br>\nif (typeof value === &ldquo;string&rdquo;) {<br>\nconsole.log(value.length);<br>\n} else {<br>\nconsole.log(value);<br>\n}<br>\n}<br>\n<\/div><\/div><h3 id=\"explain-typescript-decorators\">35. What are decorators in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Decorators are a special kind of declaration that can be attached to classes, methods, or properties to modify their behavior. They are widely used in frameworks like Angular.<\/p><h3 id=\"declaration-files-explained\">36. What are TypeScript declaration files and how do they work?<\/h3><p><strong>Answer:<\/strong><\/p><p>Declaration files (with a<strong> .d.ts<\/strong> extension) are used to describe the shape of JavaScript libraries, allowing TypeScript to understand the types of third-party libraries that don&rsquo;t have built-in TypeScript support. They define the types and signatures of the library functions, so you can use JavaScript libraries with TypeScript type safety.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ndeclare module &ldquo;my-library&rdquo; {<br>\nexport function myFunction(a: string): void;<br>\n}<br>\n<\/div><\/div><h3 id=\"use-type-guards\">37. How do you use type guards in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Type guards are a way of checking the type of a variable at runtime and allow you to narrow down the type within a conditional block. You can use <strong>typeof<\/strong>, <strong>instanceof<\/strong>, or custom type predicates to create type guards. They help make your code more predictable and safer by narrowing types.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nfunction printId(id: string | number) {<br>\nif (typeof id === &ldquo;string&rdquo;) {<br>\nconsole.log(id.toUpperCase()); \/\/ TypeScript knows it&rsquo;s a string here<br>\n} else {<br>\nconsole.log(id); \/\/ Here, TypeScript knows it&rsquo;s a number<br>\n}<br>\n}<br>\n<\/div><\/div><h3 id=\"define-function-overloading\">38. What is function overloading in TypeScript?<\/h3><p><strong>Answer: <\/strong><\/p><p>Function overloading allows you to define multiple signatures for a function but with different parameters. TypeScript resolves which function signature to use based on the arguments passed to the function. However, all overloads share a common implementation.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\nfunction add(a: string, b: string): string;<br>\nfunction add(a: number, b: number): number;<br>\nfunction add(a: any, b: any): any {<br>\nreturn a + b;<br>\n}<br>\n<\/div><\/div><h3 id=\"what-is-type-aliasing\">39. What is type aliasing in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Type aliasing allows you to create a new name for an existing type. This is useful for simplifying complex type declarations or creating reusable, self-documenting types. It can be used with primitive types, object types, and even union or intersection types.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntype Point = { x: number; y: number };<br>\nlet myPoint: Point = { x: 10, y: 20 };<br>\n<\/div><\/div><h3 id=\"create-mapped-type\">40. How do you create a mapped type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Mapped types allow you to create new types by transforming an existing type&rsquo;s properties. They are often used in scenarios where you need to make certain properties optional, readonly, or alter the type of the properties in bulk.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntype Readonly&lt;T&gt; = {<br>\nreadonly [P in keyof T]: T[P];<br>\n};<br>\ninterface Person {<br>\nname: string;<br>\nage: number;<br>\n}<br>\nconst readonlyPerson: Readonly&lt;Person&gt; = { name: &ldquo;John&rdquo;, age: 25 };<br>\n\/\/ readonlyPerson.name = &ldquo;Jane&rdquo;; \/\/ Error: Cannot assign to &lsquo;name&rsquo; because it is a read-only property.<br>\n<\/div><\/div><h3 id=\"explain-keyof-operator\">41. What is the keyof operator in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>keyof<\/strong> is a TypeScript operator that returns a union of the keys of a given object type. It is commonly used in generic functions to restrict the input to known property names of an object.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ninterface Car {<br>\nmodel: string;<br>\nyear: number;<br>\n}<br>\ntype CarKeys = keyof Car; \/\/ &lsquo;model&rsquo; | &lsquo;year&rsquo;<br>\n<\/div><\/div><h3 id=\"conditional-typing-explained\">42. What is conditional typing in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Conditional types allow you to create types that change based on a condition. They follow the pattern <strong>T extends U ? X : Y<\/strong>, meaning if <strong>T<\/strong> extends <strong>U<\/strong>, the type will be <strong>X<\/strong>; otherwise, it will be <strong>Y<\/strong>. This is useful for making flexible, reusable types.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntype Message&lt;T&gt; = T extends string ? string : number;<br>\nlet msg: Message&lt;string&gt;; \/\/ inferred as string<br>\nlet count: Message&lt;number&gt;; \/\/ inferred as number<br>\n<\/div><\/div><h3 id=\"partial-vs-required-types\">43. What is the difference between Partial and Required utility types in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><ul>\n<li><strong>Partial&lt;T&gt;<\/strong> makes all properties of type <strong>T<\/strong> optional.<\/li>\n<li><strong>Required&lt;T&gt;<\/strong> makes all properties of type <strong>T<\/strong> required (non-optional). These utility types are useful for quickly modifying object types without rewriting the entire structure.<\/li>\n<\/ul><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ninterface Person {<br>\nname: string;<br>\nage?: number;<br>\n}<br>\nlet partialPerson: Partial&lt;Person&gt; = { name: &ldquo;John&rdquo; };<br>\nlet requiredPerson: Required&lt;Person&gt; = { name: &ldquo;John&rdquo;, age: 25 }; \/\/ &lsquo;age&rsquo; is required here<br>\n<\/div><\/div><h3 id=\"explain-record-utility\">44. How does the Record utility type work in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The<strong> Record&lt;K, T&gt;<\/strong> utility type creates an object type with a set of keys <strong>K<\/strong> of one type and values <strong>T<\/strong> of another type. It is used when you want to create an object that maps keys to specific value types.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntype Fruit = &ldquo;apple&rdquo; | &ldquo;banana&rdquo; | &ldquo;orange&rdquo;;<br>\ntype FruitPrices = Record&lt;Fruit, number&gt;;<br>\nconst prices: FruitPrices = { apple: 10, banana: 5, orange: 8 };<br>\n<\/div><\/div><h3 id=\"what-is-index-signature\">45. What is an index signature in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>An index signature allows you to define the shape of an object where you don&rsquo;t know all the property names, but you know the types of the keys and values. This is useful when creating dynamic or flexible objects.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ninterface StringMap {<br>\n[key: string]: string;<br>\n}<br>\nconst user: StringMap = { name: &ldquo;Alice&rdquo;, city: &ldquo;Paris&rdquo; };<br>\n<\/div><\/div><h3 id=\"exclude-utility-type\">46. What is the Exclude utility type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The <strong>Exclude&lt;T, U&gt;<\/strong> utility type removes from <strong>T<\/strong> all types that are assignable to <strong>U<\/strong>. It is helpful when you want to exclude certain values from a union type.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntype T = &ldquo;a&rdquo; | &ldquo;b&rdquo; | &ldquo;c&rdquo;;<br>\ntype WithoutA = Exclude&lt;T, &ldquo;a&rdquo;&gt;; \/\/ &lsquo;b&rsquo; | &lsquo;c&rsquo;<br>\n<\/div><\/div><h3 id=\"omit-utility-type\">47. What is the Omit utility type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>Omit&lt;T, K&gt;<\/strong> creates a new type by removing one or more properties <strong>K<\/strong> from type <strong>T<\/strong>. This is useful when you want to exclude certain properties from an object type.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ninterface Person {<br>\nname: string;<br>\nage: number;<br>\ncity: string;<br>\n}<br>\ntype PersonWithoutAge = Omit&lt;Person, &ldquo;age&rdquo;&gt;; \/\/ name and city remain<br>\n<\/div><\/div><h3 id=\"custom-utility-type\">48. How do you create a custom utility type in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Custom utility types allow you to create reusable types by leveraging TypeScript&rsquo;s type manipulation capabilities like conditional types, mapped types, and utility types. You can create types that follow specific patterns in your codebase.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntype Nullable&lt;T&gt; = T | null;<br>\nlet username: Nullable&lt;string&gt; = null;<br>\n<\/div><\/div><h3 id=\"discriminated-union-usage\">49. What is discriminated union in TypeScript and how do you use it?<\/h3><p><strong>Answer:<\/strong><\/p><p>A discriminated union is a pattern where each type in a union has a common property (the &ldquo;discriminant&rdquo;) that allows TypeScript to narrow the type of an object. This is often used in conjunction with tagged unions for type-safe conditional logic.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ninterface Square {<br>\nkind: &ldquo;square&rdquo;;<br>\nsize: number;<br>\n}<br>\ninterface Circle {<br>\nkind: &ldquo;circle&rdquo;;<br>\nradius: number;<br>\n}<br>\ntype Shape = Square | Circle;<br>\nfunction getArea(shape: Shape) {<br>\nif (shape.kind === &ldquo;square&rdquo;) {<br>\nreturn shape.size * shape.size;<br>\n} else if (shape.kind === &ldquo;circle&rdquo;) {<br>\nreturn Math.PI * shape.radius ** 2;<br>\n}<br>\n}<br>\n<\/div><\/div><h3 id=\"infer-keyword-explained\">50. How do you use the infer keyword in TypeScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>The <strong>infer<\/strong> keyword is used in conditional types to infer a type within the true branch of the condition. This allows you to extract and manipulate types based on the structure of other types.<br>\n<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\ntype ReturnType&lt;T&gt; = T extends (&hellip;args: any[]) =&gt; infer R ? R : never;<br>\nfunction getString(): string {<br>\nreturn &ldquo;Hello&rdquo;;<br>\n}<br>\ntype StringReturnType = ReturnType&lt;typeof getString&gt;; \/\/ inferred as string<br>\n<\/div><\/div><h2>Final Words<\/h2><p>Getting ready for an interview can feel overwhelming, but going through these TypeScript fresher interview questions can help you feel more confident.<\/p><p>With the right preparation, you&rsquo;ll ace your TypeScript interview, but don&rsquo;t forget to practice TypeScript syntax, classes, interfaces, and type safety-related interview questions too.<\/p><hr><h2>Frequently Asked Questions<\/h2><h3>1. What are the most common interview questions for TypeScript?<\/h3><p>Common TypeScript interview questions include types and interfaces, class vs interface, generics, type inference, decorators, and how TypeScript integrates with JavaScript libraries.<\/p><h3>2. What are the important TypeScript topics freshers should focus on for interviews?<\/h3><p>Freshers should focus on types, interfaces, classes, generics, modules, type assertions, and how to convert JavaScript code into TypeScript while ensuring type safety.<\/p><h3>3. How should freshers prepare for TypeScript technical interviews?<\/h3><p>Freshers should practice converting JavaScript code to TypeScript, understand static typing, explore type inference, and work with interfaces and classes. Studying common patterns used in TypeScript is also crucial.<\/p><h3>4. What strategies can freshers use to solve TypeScript coding questions during interviews?<\/h3><p>Freshers should carefully read the problem to understand the required types, use TypeScript&rsquo;s static type-checking to prevent errors, and apply interfaces, classes, and generics to write reusable code.<\/p><h3>5. Should freshers prepare for advanced TypeScript topics in interviews?<\/h3><p>Yes, freshers should be ready to discuss advanced topics like generics, decorators, working with third-party libraries, handling complex types, and TypeScript&rsquo;s interaction with JavaScript frameworks like React or Angular.<\/p><hr><h2>Explore More TypeScript Resources<\/h2><ul class=\"explore-more\">\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/typescript-project-ideas-for-beginners\/\">TypeScript Project Ideas<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/typescript-vs-javascript\/\">TypeScript vs JavaScript<\/a><\/li>\n<\/ul><h2>Explore More Interview Questions<\/h2><ul class=\"explore-more\">\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/python-interview-questions-for-freshers\/\">Python<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/java-interview-questions-for-freshers\/\">Java<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/sql-interview-questions-for-freshers\/\">SQL<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/react-interview-questions-for-freshers\/\">React<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/javascript-interview-questions-for-freshers\/\">JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/c-programming-interview-questions-for-freshers\/\">C Programming<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/html-interview-questions-for-freshers\/\">HTML<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/css-interview-questions-for-freshers\/\">CSS<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/angular-interview-questions-for-freshers\/\">Angular<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/cpp-interview-questions-for-freshers\/\">C++<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/spring-boot-interview-questions-for-freshers\/\">Spring Boot<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/node-js-interview-questions-for-freshers\/\">Node JS<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/excel-interview-questions-for-freshers\/\">Excel<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/c-sharp-interview-questions-for-freshers\/\">C#<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/dbms-interview-questions-for-freshers\/\">DBMS<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/php-interview-questions-for-freshers\/\">PHP<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/linux-interview-questions-for-freshers\/\">Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/operating-system-interview-questions-for-freshers\/\">Operating System<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/mysql-interview-questions-for-freshers\/\">MySQL<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/spring-interview-questions-for-freshers\/\">Spring<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/flutter-interview-questions-for-freshers\/\">Flutter<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/mongodb-interview-questions-for-freshers\/\">MongoDB<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/django-interview-questions-for-freshers\/\">Django<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/react-native-interview-questions-for-freshers\/\">React Native<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/jquery-interview-questions-for-freshers\/\">jQuery<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/bootstrap-interview-questions-for-freshers\/\">Bootstrap<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/embedded-c-interview-questions-for-freshers\/\">Embedded C<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/dsa-interview-questions-for-freshers\/\">DSA<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/r-programming-interview-questions-for-freshers\/\">R Programming<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/hadoop-interview-questions-for-freshers\/\">Hadoop<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/dot-net-interview-questions-for-freshers\/\">.NET<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/power-bi-interview-questions-for-freshers\/\">Power BI<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/asp-net-interview-questions-for-freshers\/\">ASP.NET<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/asp-net-mvc-interview-questions-for-freshers\/\">ASP.NET MVC<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/android-interview-questions-for-freshers\/\">Android<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/tableau-interview-questions-for-freshers\/\">Tableau<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/mvc-interview-questions-for-freshers\/\">MVC<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/wordpress-interview-questions-for-freshers\/\">WordPress<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Are you preparing for your first TypeScript interview and wondering what questions you might face?Understanding the key TypeScript interview questions for freshers can give you more clarity.With this guide, you&rsquo;ll be well-prepared to tackle these TypeScript interview questions and answers for freshers and make a strong impression in your interview.Practice TypeScript Interview Questions and AnswersBelow [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":12873,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"class_list":["post-12907","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-interview-questions"],"_links":{"self":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts\/12907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/comments?post=12907"}],"version-history":[{"count":13,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts\/12907\/revisions"}],"predecessor-version":[{"id":14864,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts\/12907\/revisions\/14864"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/media\/12873"}],"wp:attachment":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/media?parent=12907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/categories?post=12907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/tags?post=12907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}