Skip to content

Interview Experience 127

shubhgup11 edited this page Aug 7, 2018 · 1 revision

2018

##Software Development Engineer

"Round 1: This round was hosted on CoCubes platform. Everyone had different set of problems.There were total three problems. Q1. Rounding number to nearest 10 , i.e if the unit digit of a number is lying between [5-9] such as for 47 it will return 50 and if unit digit is lying between [1-4] such as 43 return as 40. if unit digit is zero return same number.

Q2. Given a positive integer N, count all possible distinct binary strings of length N such that there are no consecutive 1’s. It was written no extra space should be allocated .

Examples: Input: N = 2 Output: 3 The 3 strings are 00, 01, 10

Input: N = 3 Output: 5 The 5 strings are 000, 001, 010, 100, 101

Q3. Rearrange a given linked list in-place. Given a singly linked list L0 -> L1 -> … -> Ln-1 -> Ln. Rearrange the nodes in the list so that the new formed list is : L0 -> Ln -> L1 -> Ln-1 -> L2 -> Ln-2 …

You are required do this in-place without altering the nodes’ values.

Examples: Input: 1 -> 2 -> 3 -> 4 Output: 1 -> 4 -> 2 -> 3

Input: 1 -> 2 -> 3 -> 4 -> 5 Output: 1 -> 5 -> 2 -> 4 -> 3

I did all three of them and got selected for the next round. I did second Q without using any space as the problem was reduced to finding the (n+2)th fibonacci number. My friend did that problem using space so his rank was below me.

Round 2: Group Fly Round : In this round all students were given one problem. We had to write our own code. This round was totally luck based because the Question was really easy , so the main focus was not on solving the problem but to present your answer in front of your mentor. Your code should be clear and easy to understand.

Q : Given a binary search tree print all root to leaf path whose sum of nodes equals to a given sum.The node can have negative elements too.

Round 3 : He went through my CV and asked me problems related to my subjects. He first asked questions from object oriented programming. What is Polymorphism. Give Example. Give example of some function overloading. etc. Then he asked me questions from DBMS. What is normalization. Give real life example table for 3NF and BCNF. At last he asked me a problem from tree. Transform a BST to greater sum tree Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater than that node.

I answered all the questions correctly and for the tree problem i gave him recursive solution by passing sum as a reference variable.

Round 4: This round was really interesting. I was asked tricky problems. First he went through my CV then he asked me to tell one example where iterative solution is better than recursive solution. I gave him finding Fibonacci number using recursion will take time and recursive stack space both. But using iteration we can optimize both.He told me give more examples then i told him traversing a tree using morris traversal is better than recursive way.

Then he asked me another question . Tell me a case where infinite loop is helpful. I suddenly gave him concepts from OS that, when two process is using a shared variable, in order to have mutual exclusion of two process we use infinite loop for the process to wait.Then he told me its correct but give me a example other than OS. So i told him totally different answer, in order to achieve motion in HTML Canvas we have to run draw grid function infinite time like in snake game which i had added in my CV.

Then he asked me a simple puzzle that there is a grid of 3*5. A person can travel along the edges only and can move up and forward only what are the total path that can be generated. I solved it using simple Permutation of string ""fffffuuu"". where f represent forward and u represent upward. Then he asked me to code for the solution. I gave him recursive approach.

Then He asked me a Q as follow: You are given a folder of name ""search"". There are more than 100 .txt files in it. Consider the name of the files are 1.txt , 2.txt ..... There is a website in which user will enter two words (lets consider ""Social"" , ""Media""). You have to design a system to output every file which contain both word. A user can give as much queries as possible.

I gave him the satisfactory answer after few hints and he was really impressed with my solution. He finally told me to code for the same which i did.

Round 5: This was the final round.He went through my CV and asked me which languages do you know , i told him c and c++. After that he asked me what is the difference between struct and union. what are the different concepts of object oriented programming. and some question from object oriented programming. Then he asked me about my project based on node.js and mongoDB. What is the difference between relational and non relational databases.State advantages and disadvantages of non relational databases. Few Questions from normalization , why we do normalization what are the pros and cons of normalization.

Then he asked me to design a website to display top 10 trending tweets. I answered him the approach he was really impressed.He asked me to code for it which i did. He then asked me to design a website in which each student will write his queries like ""Print my 5th Sem result"" , ""What are the dates of holiday in this year"". I answered him that these type of situations can be easily handled using NLP. Then he asked me consider you dont know NLP how will you approach. I answered him that we will collect the frequencies of each and every important word from the sentence. I will also have pre stored queries which are generally asked and i will try to best fit the given query with the already stored queries based on frequencies of tokens.Whatever sentence i will get i will output it. If i get multiple answer i will give user to select the correct one.This was a long discussion.

After this he asked me what new technologies you are recently learning. I told him that recently i have started machine learning. He then asked me to tell what exactly is machine learning and few question from regression.

After this he asked me to code for remove duplicates in a sorted linked list. Interview was over after this.

After half an hour i got the good news.

"

Clone this wiki locally