This is the transcript of the mock interview with Candidate TV (2years)

SDE Guru: Hello, Welcome to the IM interview. Thank you for taking the time to talk to me.
Candidate TV: Thank you for doing this, I really appreciate your time.

SDE Guru: Are you ready? Do you have a pen and paper handy, we will go through a few coding exercises?
Candidate TV: Yes, I’m ready

SDE Guru: Before we get started can you briefly describe your background and experience?
Candidate TV: I graduated with a BSc degree 3 years ago with 16 month internship experience. One of my work term was with IBM where I worked on some crypto stuff and it was interesting to me. Then I decided to do MSc in security field, my thesis was about key pre-distribution for wireless sensor network. For the MSc work, I developed a new key management protocol and also built a simulator framework that implements not only my protocol but others as well. After the MSc program, I worked as a research assistant for my former supervisor on some theoretical stuff that are closely related to my MSc work, while looking for an opportunity in the industry as a software engineer

SDE Guru: Great, Where do you see yourself 5 years from now?
Candidate TV: In 5 years, I see myself as an experienced SDE who has enough industry experience that allow me to efficiently build a large distributed system by myself

SDE Guru: What is your favorite programming language?
Candidate TV: I can comfortably work with java and c++ and am familiar with perl. Depending on the specific task, I’d choose the most suitable programming language to get the work done at the moment, I’m coding mostly with java

SDE Guru: Good, which language do you want for coding exercises for this interview?
Candidate TV: I’d like to use java

SDE Guru: Can you rate yourself in Java on a scale of 1 to 10, 1=worst, 10=best ?
Candidate TV: I rate my Java programming skill at 7

SDE Guru: Why do you say you are a 7, and what will it take to get you from 7 to 8?
Candidate TV: As a fresh grad, I mostly work in school and personal projects. For the programming itself, I believe that I’m a very good coder since I used to participate in programming contests regularly. However due to the lack of industry experience, I lack the experience of working with different production frameworks, that’s why I rate myself 7.
Candidate TV: When I can get my hands on the real production project, I believe I’ll expand my programming knowledge and will get to 8.

SDE Guru: Let us start with a simple math/logic question. What is the angle between the hands of a regular clock? At any given point of time?
Candidate TV: First we compute the angles between each hand and the vertical line, then we find the difference between the two

SDE Guru: ok.. what is the angle at 03:00?
Candidate TV: 90 degree

SDE Guru: Good. How about the angle at 3:15?
Candidate TV: 52.5 degree

SDE Guru: That seems too high ? What is your computation.
Candidate TV: oh sorry, I made a mistake. It should be 7.5 degree. The angle between minute hand and the vertical line is 90 degree, the angel between the hour hand and the vertical line is 15/60*1/12*360 + 90 degree

SDE Guru: Can you code this in java as a function double angle(int hour, int minutes).
Candidate TV: can I assume that the input is valid? i.e., minutes is in the range [0,59], hour is in the range [0..11]

SDE Guru: hour can be in the range [0..23], does this change your solution?
Candidate TV: No, I can trivially translate 0..23 to 0..11 by % 12

Candidate TV: Here is the code.

SDE Guru: Excellent! Now lets get on with a quick design question
SDE Guru: Provide a class design for a basic state machine that models the creation of a sandwich. The process of sandwich creation is a multi step process. Select Bread, Select Items to place on it, Select Dressing, Add Salt/Pepper and Pack. There may be multiple items, multiple dressings.

Candidate TV: The states as i can see are “1_READY_TO_SELECT_BREAD”, “2_READY_TO_SELECT_ITEMS”, “3_READY_TO_SELECT_DRESSING”, “4_READY_TO_SELECT_SNP”, “5_READY_TO_PACK” and “6_DONE”. In terms of transition, you can only transition from state 1 to state 2. from state 2, you can select an item or move to state 3. On selection of item, you will re-transition to state 2 to permit multiple additions. State 3-4 -> behaves in a similar way. I guess it is possible to add salt, extra salt, extra extra salt and so on, hence I recommend handling state 4->5 in the same way as 2->3. Now once you are in state 5, pack and transition to state 6.

SDE Guru: If a customer wants an option to skip packing,

Candidate TV: That doesn’t matter, the state transition between 5->6 can be a packing operation or a no-packing operation.

SDE Guru: What if I want to select a dressing before I select the items?
Candidate TV: Interesting, In this case I need to update my state-machine so that, from State 3, you can transition to State 2. This way, when you transition from state 1->2, you can transition to state 3, with a No Op. After you select your dressing, you can transition to state 2.

SDE Guru: Good! Can you write a java program to capture the above state machine?
Candidate TV: ok sure
Candidate TV: Here is the code

Candidate TV: I have put in stubs, where code should be written to process the activity.
SDE Guru: Excellent.

Interview Review:

  1. Reasonably fair summary of the background, built it carefully from BSc. up until what is being done now. However, In order to make this impactful, I would recommend adding more context on what you have achieved. In the MSc example, the fact that TV did not mention any concrete examples, makes it too open ended, and leaves it at the mercy of a good interview to ask followup questions.
  2. Good answer on the 5 years question.
  3. Poor answer to the language question, you must have something concrete that you are missing. Make sure you lookup what is the latest and greatest the language offers, and what areas are missing from your portfolio.
  4. Excellent answer to the first coding question.
    • Had test cases in code.
    • Was able to immediately jump to the 0..23 fixes.
    • Comments in code is a nice touch.
    • Returning of the smaller angle was not discussed, but was assumed. TV missed an opportunity to impress the interviewer, and ran the risk of interviewer overlooking this piece in code.
  5. On the state-machine question. It looks like TV knew what state-machine was. The answer was great. I particularly like the way TV  was flexible and could add additional work flows with minimal modification to his system.

Overall verdict: If this were a real phone interview, TV will definitely make it to the next step. If a similar conversation happens during an in-house, this will more likely result in a hire than otherwise. Poor answer to how will upgrade your skills, may possibly modify the direction of the interview, which may cost TV a good opportunity. That being said, given the thoroughness and completeness of the answer, this loss is possibly more for the company.

Comments

comments