Thursday, September 28, 2017

A failed interview

I am feeling so bad now. The interview this afternoon did not go well and that made me so sad. To tell the story from beginning, I was reached out by an HR lady from FPT Software for a Fullstack JS developer position last week. I did not intend to leave CMC, but I wanted to see if I would be qualified for the job, and to see if there is anything interesting about the project. So I accepted the invitation and went on to the interview with some Vietnamese guys from several teams in FPT. I passed the interview and we discussed about the salary and so on after that. I was still not so interested in jumping job at the moment, so I said that I need to learn more about the project before deciding to join. Several days later, the HR girl asked me to join a discussion with their customer, I thought it was not an interview but some kind of talk in which they tell me about their project and requirements and so on. But it turned out that it was a real interview, even a white board coding interview with an old Japanese man. And the interview left me with a shame.

I did not say that the interviewer was bad or something, but his questions, I mean, all of the questions he asked me, were unexpected to me. I had not been prepared for those kinds of questions. First, he asked me to rewrite a JS function to not use the async keyword. I did it with an arrow function, as I used to do with my Angular project. Just that was not the answer he was looking for, so he wrote the correct answer for me, even explained his solution in details. I was there, not knowing what else to do except nodding regularly to him.

the function

async f(x) {
if (!x) {throw new Error()}
return x;
}

my answer

function f(x, () =>
if (x) => throw new Error();
return x;
)

His solution

function f(x: String): Promise {
return new Promise((x, rej) => rej(x));
}

The next question was about Express.JS which he wanted me to propose a solution to have version path of APIs in URLs, so that he could have many versions of an API working independently.

# url: server-address://users/v1/list
# url: server-address://users/v2/list

app = Express()

app.use('/users', userService)

app1 = Express()

app1.use('/users', userService1)

I, again, had no idea what to do whatsoever. I stood there, just wanted to find a hole to jump in. And finally, he wrote his solution for me

app = Express()

app1 = Express()
app1.use('v1', userService1)

app2 = Express()
app2.use('v2', userService2)

app.use('users', app1)

app1.setUp(app)

That moment the only thing I wanted to is to leave the interview immediately, despite I've learned a lot from him by watching him writing the solutions for me. He then asked me if I had any working experience with MongoDB, I hostnesly said that I only have a very limited knowledge with MongoDB and NoSQL in general. So he had to ask me about relational database. He wrote on the board

A
C
I
D

and asked me what does each of the letter stand for. The only word I remembered is the first one - Atomic. But I don't even remember what does it mean, and I couldn't figure out what other letters stand for. After a while letting me think, he had to write the words

Atomic
Consistency
Isolation
Duration

and asked me the meanings of Atomic and Isolation. I was not able to answer properly, despite that I was sweating so much that my T-shirt was almost wet. Then again, he answer the questions himself while asked me some more questions on the transactions, how to implement Atomic, or how to avoid Phantom read. I had no idea of those terms, so I let him go on.

The interview ended and I was in shame. I couldn't imagine how struggling the time I've spent there and I wished I had at least one answer for those questions. After the interview, I swear to myself that I will ask for more details on what the interview is about and what do they expect me to have. I will make sure that I focus only on my strong points. After all, noone knows everything, so be strong in some limited technologies and be good at commonly used knowledge.

No comments: