This is the transcript of the mock interview with Candidate GK (fresher)

SDE Guru: Hello, Welcome to the IM interview. Thank you for taking the time to talk to me. Are you ready? Do you have a pen and paper handy, we will go through a few coding excercises?
Candidate GK: Thank you.Yes I have paper and pen handy

SDE Guru: Before we get started can you briefly describe your background and experience?
Candidate GK: I am doing my Masters in Computer Science from University of Blah Blah. Before my Masters I have worked with RDM India in .NET technologies. In Summer 2010, I did internship with MXware US in Performance Engineering team and currently, I am working as Software Developer intern at Great Instruments in their Research Development team.

SDE Guru: Great! What is your favorite programming language?
Candidate GK: C++ and or JAVA as required. Mostly use C++. Wherever I feel I need to use Hashtables and ArrayLists etc I prefer JAVA terminology

SDE Guru: Good, which language do you want for coding excercises for this interview?
Candidate GK: Java

SDE Guru: Can you rate yourself in Java on a scale of 1 to 10, 1=worst, 10=best ?
Candidate GK: 8

SDE Guru: Why do you say you are a 8? And what will it take to get you from 8 to 9?
Candidate GK: Since I know CORE JAVA and have worked with some J2EE concepts like Servlets and JSP. But since JAVA world is huge, I am still learning it. Recently I am learning REST web services in JAVA. That is why I think I am a 8.

SDE Guru: And what will it take to get you from 8 to 9?
Candidate GK: I think learning advanced concepts in J2EE and trying to apply those newly acquired knowledge in everyday practice generally application development ,etc

SDE Guru: Great, shall we get on with a coding question?
Candidate GK: yes sure

SDE Guru: Given write a method numberToLetters(int n), where n is between 0 and 999. Can you print the number in words? so if input is 157 the output will be one hundred fifty seven.
Candidate GK: I see that numbers are starting from 0. So I assume that I do not have to handle negative number cases. Also we have a upper limit of 999
SDE Guru: yes.. range is 0 to 999
Candidate GK: The basic idea here is to find a the required strings in order to represent a number betn 0 to 999. For e.g. We definitely need one , two ,…. nine. so this will be an array of strings of single digits. the same will be for two digits but tens , twenties , etc. Now there will be cases for eleven , twelve , etc till ninenteen. Similarly we will have strings representing hundreads

SDE Guru: Great, can you write the code for this?
Candidate GK: OK so I am writing the program now. The idea will be to divide number by 10 and take mod by 10 and try to come up with a string representation

SDE Guru: Great. did you test this?
Candidate GK: yeah for a few inputs like 157, 999, 0 , 50

SDE Guru: Let us follow along.. for an input of 157. what is the value of tmp in line 13?

Candidate GK: Actually my String arrays should have a “” as first element. So that I can start indexing frm 0 and then it will give the output

SDE Guru: did you test for 250?

Candidate GK: yeah in case of 250, tmp = 2 (two hundread) , tmp= 50 tmp1 = 0, tmp2 = 5 which causes else to execute and prints two hundread fifty .

SDE Guru: line 17: sb.append(hundread[tmp]).append(” “); Will this not result in an array index out of bounds..
Candidate GK: Oh yes, For hundread it will not print. It will have to be half the number of digits in number

SDE Guru: Thanks for your time. Any questions?
Candidate GK: Yeah do you have any pointers on how to improve?

SDE Guru: This interview will be posted shortly on as Candidate GK

Candidate GK: I guess I somewhat rushed to give solution as I thought I would run out of time.