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.