This is the transcript of the mock interview with Candidate KS (3years)

SDEGuru:  Hello
Candidate KS: Hello, how are you?

SDEGuru:  Great! Thank you for asking. Are you ready?
SDEGuru:  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 exercises?
Candidate KS: okay

SDEGuru:  Before we get started can you briefly describe your background and experience?
Candidate KS: After doing my bachelor’s degree I started working for Probo Technologies as a S/W Developer for “FinPlus”

Candidate KS: I worked primarily on JAVA, UNIX and PL/SQL. After working for around 2.5 years, I went on to do a Masters degree. While doing my post graduation I was offered a GA job. I was working on web application development in C# and Oracle.

SDEGuru:  So, what is your favorite programming language? Will that be Java or is that C#?
Candidate KS: Even though C# was easier to understand and code. However, as preference for favorite programming language it has to be Java.

SDEGuru:  Can you rate yourself in Java on a scale of 1 to 10, 1 is worst, 10 is the best ?
Candidate KS: I would rate myself as 7

SDEGuru:  Why do you say you are a 7? And, what will it take to get you from 7 to 8?
Candidate KS: While working for Probo, I did work on Servlets but never got the chance to work on specific frameworks like Spring and Struts. However, after my web application development, I am keen on learning more about the web application frameworks in JAVA

Candidate KS: Which is why I have started learning more about Spring?

SDEGuru:  Excellent. Shall we get on with a design question?
Candidate KS: Certainly!

SDEGuru:  Are you familiar with tic-tac-toe game?
Candidate KS: Yes, Crosses and Knots. Is it a general two player tic-tac-toe?

SDEGuru:  Yes, it is a 2 player tic-tac-toe.
Candidate KS: okay. First, we need to have 2 most important elements i.e. 0 and X which we can specify as enum. We need a board which can be a matrix of a size specified or in general 3×3.

SDEGuru:  Let’s design for 3×3 for now and extend it later on.

Candidate KS: okay. There will be an object player. Who makes moves which needs to be validated. That is he cannot put a 0 or X on a square which is already registered.

SDEGuru:  Is that a question or statement?
Candidate KS: It is a statement.

SDEGuru:  Alright. What next?
Candidate KS: Also a separate method to determine the Winner can be used to find out which player has won.

SDEGuru:  Can you code the “Determine Winner” function?
Candidate KS: Sure.. Let me try it out. Give me 5 minutes to write it.

SDEGuru:  If you have a matrix like this, who wins? XXX/…/YYY then who wins? XXX or YYY
Candidate KS: This is impossible, because we will check the victory condition after each move.

SDEGuru:  How will you extend your code to check for a NxN board, where M in a row is required to win?
Candidate KS: I can modify the function in the “for loop” from number 3 to fit the board length. And, then iterate in the matrix normally

Candidate KS: Here is the code.

SDEGuru:  hmm, that doesnt seem to make sense, You have coded for NxN matrix with N in a row to win, not M.
Candidate KS: oh,  okay, that was an oversight. I am not clear about the requirement, can you repeat.

SDEGuru:  Sure, We have NXN board but only M pieces are needed to make it work. So you can have a 5×5 board with 4 in a row needed to win.
Candidate KS: ok.. got it now! This looks like a dynamic programming problem? Where we need to find if a subset of the board matches the symbol

SDEGuru:  Can you code this now?
Candidate KS: Sure, here is the code.

SDEGuru:  Thank you for your time.