My Infosys Interview Experience: Not Selected๐
I am not a great guy. I did very poorly. I think I answered only 40% correctly. Since it just happened yesterday. So I can exactly tell how I did.
Beginning:
At 2 pm, My interview was scheduled. I logged in through the link they provided. Within 5 minutes, I was assigned a breakout session with my interviewer. The interviewer was some around 35 yrs old guy
Question 1:
the interviewer gave me this string as a question and input + output all. The instruction was to not use any built-in functions without his permission, and use nothing except a simple main
function(for C++). He gave me 20 minutes.
// Input : Reverse words in its alternate position
// Output : Reverse sdrow in sti alternate noitisop
I asked him, can I use string utility functions? NO. Can I use vectors? YES.
I had some utility functions set up in my IDE, to help me do input and output in a file. I asked. can I use them? the answer was NO. FINE(I imagined). I started writing code.
before I started writing code. I asked questions regarding cases like, are special characters allowed? YES. does the input string have spaces at the beginning and the end? HE SAID: YOU CAN ASSUME THAT STRING IS A COMMON STRING.
#include <bits/stdc++.h>
using namespace std;
int main()
{
string str = "Reverse words in its alternate position";
vector<string> store;
string temp = "";
for (auto ch : str) {
if (ch == ' ') {
store.push_back(temp);
temp = "";
continue;
}
temp.push_back(ch);
}
if (temp.length()) {
store.push_back(temp);
}
vector<string> outputStore;
for (int j = 0; j < store.size(); j++) {
string word = store[j];
if (j % 2 == 0) {
outputStore.push_back(word);
} else {
int length = word.length();
string s(length, '0');
for (int i = 0; i < length; i++) {
s[length - i - 1] = word[i];
}
outputStore.push_back(s);
}
}
string output;
for (auto ti : outputStore) {
output += (ti + " ");
}
cout << output << endl;
if (output.back() == ' ') {
output.pop_back();
}
}
when I was giving the finishing touch to my code. I could tell that he was impressed as he tried to stop me like this is enough. he asked me to zoom out. and I understood to zoom in๐. He asked me to reduce the font size. then I understood what he meant.
then started my real interview which I feel was real:
3rd Act :
he asked me to rate myself on javascript on a scale of 1-5.
How much do you rate yourself on 1-5?
I rated myself 4+๐๐๐.
what is the call() and apply() in javascript.
Answer : I don't know.
Why do we use bind() in javascript?
Answer: In react, we define functions in a class component, since in javascript a function can act as a class, so the function inside the class component has its own
this
keyword. So in order to make that function referthis
of class component inside function body. we bind that function that functionthis
keyword. The syntax isthis.func = this.func.bind(this)
What is hoisting?
in javascript, code execution takes place in two parts. The first part is called memory context. in this part, we remember all variables used and functions in the script, we store variable in variable table. if it is function then we store the function's definition in the table. in the Second part called code execution context, we start executing the code line-by-line. if we find any variable assignment. we perform it, if a function is called, we call that. since all variables & function definitions are already identified. we can use them at any place in the code. it won't throw error. We can also define all variables & functions at the bottom of the script and use them at the top. This feature is called hoisting.
what are stacks used in your website?
Laravel + vue.js: we are using a library component called quasar.js in which we can build Android, desktop, and iOS apps from the same codebase. and we are using laravel as an API provider.
The climax of the story: System Design
Describe your website.
my website is designed using quasar.js + laravel(the same answer, I know, this is exactly what I said). we have a VPS(virtual private server). we have an Nginx server, MySQL server, and Redis server. All are hosted on the same VPS. we have another server, server2 where we send Android app build requests. after 2nd server builds the Android app, we store Android apps on s3 and send the link through api call back to server1. on server2 cron jobs are running each minute, which checks in the database if there is any task. after server1 receives those data from server1, we inform the user through Telegram, Websocket and email.
How would you design a Telegram-like chatbot? Let's say you are given a task to design a system like Airtel, what would be your steps?
Answer: First of all, I would user's phone no to log in, then when the user sends a message, it will be stored on the telegram server, obviously telegram server is not just going to send those messages to the user, first it will check whether that user is available or not. for that telegram will check users' status in the Android/iOs app. For a telegram to know about users' status, we can implement polling or WebSocket. if everything is well and good. then telegram will send a message to the receiver user. there will be fails in the middle. so telegram will handle that.
How is your website deployed? (Again same question, perhaps he wanted a better answer)
Answer: My laravel application uses Nginx server, Mysql. user logs in to the website. the session is stored as a file. when a user submits a request to build Android apps, we store them in the database & send them to the Redis queue. Redis server is also hosted on the same server. Redis server polls database. if it finds any jobs, it executes them and stores the result back into the database. in the job, we generally make a request to server1 for building apps. once it is built we inform the user via websocket, which the user sees on frontend
Is Redis a simple queue or a message queue?
I said simple queue reluctantly.
Then the interviewer concluded the interview and asked if I have anything to ask. I said no. Then at that moment, I knew I f*** up.
Conclusion
always know the technology you are using, and how it is intended to work.
utter only those terms in an interview, which you know, be conscious about it. You are not there to impress the interviewer by fancy words but by logic & implementation. if you don't know, don't speak about those things at all.
try to guide the interviewer about what you know. by uttering words you know.
if it is your onscreen interview, then do have your interviewer screen in front of you. I forget that. The interviewer was observing me & I was acting like this is a telephonic interview.
That is it. Thanks.
Subscribe to my newsletter
Read articles from Rajesh Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Rajesh Kumar
Rajesh Kumar
I am developer from Madhepura, Bihar, Graduated from Assam university