Infosys Certified TypeScript Professional
Practice with real exam-pattern questions for Infosys Certified TypeScript Professional. Each question includes a detailed explanation to help you understand the concept, not just memorise the answer. Try 10 questions free — no login required.
Full question bank for this exam + 1,357+ others. Cancel anytime.
Join Premium10 Infosys Certified TypeScript Professional practice questions with answers
Real Lex exam-pattern multiple-choice questions for the Infosys Certified TypeScript Professional certification. Each question includes the correct answer. The full question bank is available to Premium members.
- Question 1
TypeScript variables are classified into _________ and __________ datatypes.
- ✓Built-in and SimpleCorrect
- BSimple and User-defined
- CBuilt-in and User-defined
- DSimple and Primitive
- Question 2
What is the reason for the compiler throwing errors in the following TypeScript code snippet?
function calculateArea(length:number, breadth:number) { return length * breadth; }Assume that you provide “abc” and 5 as the input to the function calculateArea.
- ✓
No error in the code.
Correct - B
Type Annotation Error.
- C
Function return type has to be mentioned.
- D
None of the options are correct.
- ✓
- Question 3
What is the purpose of the tsconfig.json file in a TypeScript project?
- ✓
It is used to configure the TypeScript compiler settings.
Correct - B
It is used to list all the TypeScript files in the project.
- C
It is used to specify the version of TypeScript to use.
- D
It is used to define the project's dependencies.
- ✓
- Question 4
A TypeScript developer must declare a block-level scoped variable named – myVar in the application. Can you select the appropriate option that would help to achieve this requirement?
- var myVar:number = 123;
- let myVar:number = 123;
- const myVar:number =123;
- myVar:number=123;
- ✓
a, b
Correct - B
b, c
- C
a, c
- D
b, d
- Question 5
What should be added in Line 2 to get the output as 200?
Line 1: let uniqueId: number[] | string = 'P1200'; Line 2: _______; Line 3: console.log(uniqueId.pop());- ✓
let uniqueId = [1, 20, 90, 200]
Correct - B
uniqueId = [120, 20, 90, 200]
- C
var uniqueId = [200, 20, 90, 120]
- D
uniqueId = uniqueId.split('1')
- ✓
- Question 6
Given below is the content of the tsconfig.json file that a developer has written for their TypeScript application.
{ "compilerOptions": { "target": "es5", "watch":true }, "files": [ "demo1.ts", "demo2.ts" ] }What will be the output when the developer runs the command ‘tsc’ on the terminal?
- ✓
It will generate demo1.js and demo2.js.
Correct - B
It will throw error because ‘watch’ option can be specified only in command line.
- C
It will not throw any error nor generate js files, as file names are not mentioned in command line.
- D
It will generate demo1.js and demo2.js in the folder named ‘es5’
- ✓
- Question 7
Assume that a TypeScript application has two files – demo1.ts and demo2.ts in the root folder. The given below is the content of tsconfig.json file of that application.
{ "compilerOptions": { "target": "es5", "outDir": "Output", } }What will be the output when the developer enters the command ‘tsc’ on the command line?
- ✓
Since the "files" field is not added in the tsconfig.json file, it will throw error.
Correct - B
It will not throw any error, but since the "files" field is not added in the file, it will neither transpile any file nor generate any output files.
- C
It will transpile all the files present in the folder and generate the output files in the ‘Output’ folder.
- D
It will transpile all the files present in the folder and generate the output files in the root folder.
- ✓
- Question 8
Given below is the content of the tsconfig.json file that a developer has written for their TypeScript application.
{ "compilerOptions": { "target": "es5", "outDir": "Output", "sourceMap": true, }, "files": [ "demo1.ts", "demo2.ts" ] }What will be the output when the developer runs the command ‘tsc’ on the terminal?
- ✓
It will generate demo1.js, demo1.js.map, demo2.js and demo2.js.map in the ‘Output’ directory.
Correct - B
It will generate demo1.js and demo2.js in the ‘Output’ directory, and demo1.js.map and demo2.js.map in the current working directory.
- C
It will throw error because no filename is mentioned in the command line.
- D
It will generate demo1.js, demo2.js, demo1.js.map and demo2.js.map in the root directory.
- ✓
- Question 9
Assume that your team is developing a TypeScript application. Your team member is using the below command for transpiling the code.
tsc demo.ts --module amd --target ES2015 --outDir output --sourceMapHe finds it difficult that he has to enter all these configuration options each time he does the transpilation. Suggest a better way to help him achieve the requirement.
- ✓
Create a package.json file and add all the compiler options to that.
Correct - B
Create a tsconfig.json file and all the compiler options to that.
- C
Create a config.ts file and add all the compiler options to that.
- D
Create a configs.json file and add all the compiler options to that.
- ✓
- Question 10
Predict the output of the following code.
Line 1: let tempCounter = 0; Line 2: function getStatusData() { Line 3: var tempCounter = 10; Line 4: tempCounter++ Line 5: console.log(tempCounter >= 10 ? 'Active' : 'Inactive'); Line 6: } Line 7: console.log(tempCounter >= 10 ? 'Active' : 'Inactive'); Line 8: getStatusData();- ✓Error in Line 7Correct
- B
Active
Inactive
- C
Inactive
Active
- DError in Line 5
Pay once. Clear every cert this year.
One subscription, full Telegram channel access, every PDF posted during your membership.
- Full access to all 1,357+ certifications
- Monthly updated question banks
- Telegram private channel access
- Cancel anytime
- Everything in Monthly
- Save ₹2,100 vs monthly billing
- Priority answer key requests
- Best for increasing DQ score fast
- Everything in Quarterly
- Lifetime channel access — no renewals
- All future certifications included
- Priority response from admin team
Common questions, straight answers.
A monthly-updated Telegram channel where we post real exam-pattern question banks and detailed answer keys for 1,357+ Infosys Lex certifications. You join once, you get every PDF posted during your membership.
Right after payment on our Graphy page, you'll receive a private invite link to the Telegram channel. Access is instant — usually under 30 seconds.
We compile question banks from the actual Lex test pattern, sourced and verified by 180K+ community members who've recently cleared these exams. Match rate is consistently 85–95%.
Every single month. When Infosys rolls out new versions of certifications, we post updated dumps within 7–10 days. You'll see channel activity weekly.
Clearing certifications is one of the highest-weighted DQ factors. Members typically clear 3–5 certifications in their first 3 months, which moves DQ scores up by a full band.