Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some typeScript interview questions #249

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/json/interviewquestions.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,31 @@
"answer": "React Fragment is a component that allows returning multiple children elements from a component without adding an additional node to the DOM hierarchy.",
"tag": "react"
},
{
"question":"What is TypeScript?",
"answer":"TypeScript is a statically-typed superset of JavaScript that adds optional type annotations and other language features to improve developer productivity and code quality.",
"tag":"typescript"
},
{
"question":"How do you create variables in TypeScript?",
"answer":"In TypeScript, you create variables using the let, const, or var keywords, followed by the variable name, an optional type annotation using the : symbol, and an optional initial value using the = symbol. For example, let myVariable: string = 'Hello, world!''; creates a variable named myVariable with the type string and the initial value 'Hello, world!'",
"tag":"typescript"
},
{
"question": "How do you set up TypeScript?",
"answer": "To set up TypeScript, you first need to install it globally or in your project using a package manager like npm. Then, you can create a TypeScript configuration file named tsconfig.json in your project root directory to specify compiler options and file locations. Finally, you can use a TypeScript compiler like tsc or a build tool like Webpack to compile TypeScript code into JavaScript.",
"tag": "typescript"
},
{
"question":"What are some things to consider when choosing between TypeScript and JavaScript?",
"answer": "When choosing between TypeScript and JavaScript, you should consider factors such as the size and complexity of your project, the need for type checking and other language features, and the experience and preferences of your development team. TypeScript can provide better scalability, maintainability, and developer productivity for larger and more complex projects, but may have a steeper learning curve and require additional tooling compared to JavaScript.",
"tag": "typescript"
},
{
"question": "Can you list and describe some primitive types in TypeScript?",
"answer" : "Some primitive types in TypeScript include number, string, boolean, null, and undefined. number represents numeric values, string represents text values, boolean represents true/false values, null represents absence of value, and undefined represents an uninitialized value or absence of value.",
"tag":"typescript"
},
{
"question": "What happens if we leave useeffect dependency array empty?",
"answer": "The empty array indicates that the useEffect doesn't have any dependencies on any state variables. Therefore, the callback function is only called once the page renders in this case.",
Expand Down Expand Up @@ -525,4 +550,5 @@
"answer": "Functional components are stateless and use a function to render the UI. They are simpler and easier to write than class components, but cannot use state or lifecycle methods. Class components, on the other hand, use a class to define the component and can use state and lifecycle methods.",
"tag": "react"
}

]