Welcome Learners!. This post Round 1 interview experience is a continuation to my previous post. Please do refer Play simple games interview experience, if you didn’t, before reading this post. I will share the experience of Round 1 in this post.
Round 1 interview experience
Round 1
The interviewer first asked me to introduce myself. I just gave a small description about me and my traits. Later he asked me about my projects. I explained in detail about my project to him. He asked me to show my code.
In my project I had used random function in java. So he asked me about what is random function. I explained him. But he asked me to code random function(i.e. how can we implement random function). I have no idea about it, I only use inbuilt random function, but never looked into the code of it. I tried to do for sometime, but I couldn’t able to figure it out. So I told him that I didn’t get any idea.
Next he gave me a question related to the strings.
Question:
You will be given three strings, find the second string in first string and replace it with third string which is of equal length.
This is quite simple. He asked me to implement it in C. I wrote the code and it worked fine.
Later he modified the question a bit. He said that the length of second and third strings are different. In this case I need to change my code. I said we can do it with string concatenation function in C. But he asked me not to use libraries.
So there I need to move the contents of string to the right in order to insert more characters in the middle. He asked me will there be any problem in moving these. Then I answered yes. There will be a problem if there is no sufficient memory to move.
He asked me “What will you do in that case?”. I said we need to use DMA(Dynamic Memory Allocation) in order to overcome that problem. Then onwards we had some discussion related to Dynamic Memory Allocation.
And at last, he asked me for any questions and then Round 1 ended.
Round 2 experience will be shared in next post. Continue reading Learners!!!.