Search test library by skills or roles
⌘ K

Adaface Sample TypeScript Questions

Here are some sample TypeScript questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Medium

Alias
OOPs
Solve
What does the following TypeScript code print?
 image
 image

Medium

Truthiness
Narrowing
Solve
We wrote the following TypeScript function to work as global print function. The function needs to handle string input, an array of strings as input or null as an input. In case of string and array of strings, it needs to print them to console. For null input, the code should not print anything.
 image
The function is throwing an error when it is called with null - globalConsole(null). This is happening because typeof null is ‘object’ in JavaScript. Here are two modifications of the code to handle this case:
 image
 image
Pick the correct statements:
            
            A: In the case of null input, globalConsole1 won’t produce any compiler errors like globalConsole
            B: In the case of null input, globalConsole2 won’t produce any compiler errors like globalConsole
            C: globalConsole1 will differ from globalConsole for an empty string
            D: globalConsole2 will differ from globalConsole for an empty string

Medium

Types
Solve
Consider the following TypeScript code: 
 image
Which of the following statements are correct:
            
            A: The typescript compiler confirms that toUpperCase exists on the a instance.
            B: The typescript compiler states that the toUpperCase function does not exist on the b instance.
            C: The typescript compiler confirms that the toUpperCase function exists on the b instance.
            D: RectangleType is an array where the type of a fixed number of elements is known.
            E: Variables r, g, b are immutable.
            F: r, g, b would compile to same type signature
🧐 Question🔧 Skill

Medium

Alias
OOPs
2 mins
TypeScript
Solve

Medium

Truthiness
Narrowing
3 mins
TypeScript
Solve

Medium

Types
2 mins
TypeScript
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Alias
OOPs
TypeScript
Medium2 mins
Solve
Truthiness
Narrowing
TypeScript
Medium3 mins
Solve
Types
TypeScript
Medium2 mins
Solve

Adaface questions are trusted by enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

We evaluated several of their competitors and found Adaface to be the most compelling. Great default library of questions that are designed to test for fit rather than memorization of algorithms.


Swayam Narain, CTO, Affable

hashtag image heart icon Swayam
Join 1200+ companies in 75+ countries.
Try the most candidate friendly skills assessment tool today.
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
Chat with us
40 min tests.
No trick questions.
Accurate shortlisting.
Ada
Ada
● Online
Previous
Score: NA
Next
✖️