SilkTest Question 49: What does this code print?

There is one more puzzle for interviewee during hiring process in of the top tech company located in Bengalooru, India.

What does the following 4test code print and why?

SilkTest FAQ

Unfortunately more then seventy five percent of candidates for SilkTest Testing Engineer position would give a wrong answer: "53" "54". Perhaps they forgot or never knew about using the type cast operator to perform explicit type conversion. The result of casting a string to integer is the numeric value of the first character in string. Thus in the example above the second print operator would produce "53" too, which is decimal value of the ASCII character 5.

1 comment:

Anonymous said...

MP thats really a good question , i will not say it a tricky question as if you know basics its an obvious question.

SilkTest interview questions for QA Testers