Veermata Jijabai Technological Institute (VJTI), Mumbai
Mumbai, Maharashtra
What if you can't knock at your Veermata Jijabai Technological Institute (VJTI), Mumbai seniors' door for advice? Read their placement interview questions and crack your next interview. 🏆
Q1. Given a string s[1...n] and a reverse function reverse(s, i, k) > which reverses the character sequence from i to k (inclusive of both) > in string s, determine...read more
Q2. If len is the length of the string and num is the number of > characters printed on the screen > Give the relation between num and len. > > void abc (char *s){ ...read more
Q3. Which of the following numbers cannot be represented accurately in > binary? > a) 0.1 b) 6.5 c) 1/16 d)1.32 e) 0.590625 (not sure abt option e) > > 1. a only > ...read more
Q4. A process doesn't require additional processors to carry out 40% of > it's execution since 40% is mostly sequential. Determine how many > additional processors ...read more
Q5. Time complexity of a function f(m) is O(m). If the array[i...n] > contains either 1 or 0 in each of it's locations, determine the worst > case time complexity o...read more
Q6. Increasing the RAM increases the efficiency of the CPU. The reason > is > a) Virtual memory increases > b) Number of page Page faults decreases > c) Page segmen...read more
Q3. Given a bit pattern (in an integer INPUT), and another pattern (in an integer PATTERN, with a number n signifying the number of trailing bits to be considered a...read more
Q7. You have 3 baskets- one containing apples, one oranges and the last containing both. All baskets are incorrectly labelled.You can pick *one* fruit from *any one...read more
Q8. You're in the center of a circular pond, with an *intelligent* lion at the circumference - intelligent implies you can't trivially fool it. Given that, your swi...read more
Round: Technical Interview Experience: Given a string INPUT, find the longest repeating substring.
Example: if INPUT = ababcbacabc, answer would be abc.
Write testcases.
The most important thing here is that you're supposed to ask questions to resolve ambiguities - the substrings cannot be overlappping.
Example: If INPUT = seattle, the expected answer is t, not e.
Example: If INPUT = ababa, answer = ab, not aba.
All such corner-cases must be considered. Screening interview:
I had a single screening interview for conversion from Microsoft IDC to Redmond. It was more like a chat - in the initial 10-15 minutes atleast.
The first 10-15 minutes was about:
what i learnt at Microsoft What was my project about What did I learn from my project (my answer to this included both, learning in technical sense and personal development. “Why test?” (IDC had selected me as an SDET, and that’s the profile they’d forwarded)
After that he asked what I liked to do (problem solving etc.) On saying “solving new and challenging problems”, he gave me the question:
Given 3 consecutinve numbers, and that the first and third are prime, is it always true that the middle number is divisible by 3 ? Prove your answer. This question was majorly to check if I can think and zero in on the solution and the process.
Then, my second (and easy) question was to
Write a code for tokenizing a character stream. The stream starts and ends with a delimiter. Example: Input: “” Here, the start of the string is denoted by ‘<’, and end by ‘>’. The expected output is to return(or print) list of individual words. ie: “abc, def, msft, pr-st” (four words)
This is a ridiculously easy thing to code - but they weren’t interested in code. What he wanted to see was: 1. Approach 2. If the logic is sturdy enough and considers all test cases 2. Design choices and decision making (the whole Q revolved around this) - I made a list of test cases that the code should consider. In each case, there is a decision to be made - he wanted to see why I decided what I decided. Example: Input: “ a<efg>” This obviously is something where a normal program would fail. My logic to this was: Discard everything before the first start delimiter, after the first end delimiter. So my output: “abc, cd”
That was all.
Tips: Mine was a PrePlacement interview process - doesnt differ much from the normal campus, but competition is awesome.
College Name: Veermata Jijabai Technological Institute, Mumbai [ VJTI ]
Q6. What is deadlock?Conditions for that?What are the methods to prevent it?Write code to prevent the deadlock for OS, considering that there are two processes P0 a...read more
Q8. Suppose there are two processes P0 and P1 and they want write to shared memory and while writing they should have exclusive lock on memory and P0 should be firs...read more
Q12. You are given binary tree. Weight of node in binary tree=data present in it*level of that node(root’s level was given to be 1).Find the node in tree with maximu...read more
Q13. You are given infinite sequence of continuos natural numbers-1,2,3,4,5,6.......... Initially you delete every 2nd element so sequence will be 1,3,,5,7,9,11,13.....read more
Q4. When a sorted array is ‘Rotated’, its last element becomes the first element and the remaining elements shift to the right. Write a function which takes an inpu...read more
Round: Test Experience: 1) Objective Paper - i)Basic C questions ii) DS questions covering Graphs and Trees iii) Analysis of Algo. Questions. iv) There were more but I can’t remember
Round: Problem Statement Experience: I attempted question Number 3 very well which was also brought up in my 3rd tech Interview. It was what got me through I assume.
Screening Test: 6-8 people in a room were taken and were given the following problem to solve - “ There are two given sorted Linked lists. Merge them to form a single sorted Linked list. In case of duplicates, delete copies” In one batch, people were also told to write test cases.
Tips: Speed, Accuracy and Covering as many cases which may arise as possible in the code Points where every VJTIan committed mistakes - !) In case of duplicates, only one node was inserted into the single linked list, but nobody freed up the memory of the other node by using free. they expect that. 2) modularization - In case one of the linked lists is over, we simply append the remaining elements of the other array into the single linked list. This was expected to be done by a single function taking parameters.
Why I cleared - Finished Coding around 12 mins before everybody and committed no mistakes which others made. The above two are the only things I didn’t do
Round: Technical Interview Experience: No. 2 - 1) Design an Offline Browsing Experience An one and half hour discussion was held on this, where he asked me Line of thought in designing the product, the thinking behind various proposed features, Made changes in the requirements, told to propose new features as per new requirements for at least 4 features, How will you implement the feature - show UI and block Diagram, what data structures will you use for the feature etc etc. Was checking Designing aptitude and how many new features proposed
No 3 - 1)How will you implement an N-ary tree (N has no limit) and write code for BFS on that N-ary tree based on the implementation Gave her Three implementations. She only settled for the one which She wanted 2) Write code foe the node of the tree and the above BFS
3) The weight of the node is given as Value of node*level of node. Write a function which returns the address of a node with the MAXWEIGHT in a binary tree I gave Non-recursive solution. She then asked for a recursive solution Code for both Recursive and Non-recursive she made me write
4) Given an array of n elements which have numbers in the range of 0 to n-1, find if the array has any duplicate elements
5) Write code to return position of the duplicate element Was just checking coding knowledge Tips: 1) Accuracy is not very important, approach is. If you are wrong, you should be able to tell why you are wrong before the interviewer tells you. The interviewers help a lot, but getting the correct solution is required 2) Write as tight code as possible in aptis and interviews. From freeing nodes, to returning boolean instead of Int, to Using struct instead of two separate variables, every bit of efficiency is appreciated and earns you a lot of points 3) Keenness to learn is a very important quality which they see when they are considering a PM candidate. It is hard to fake that. They usually deduce it by the way you talk. 4) For PM, they take the ‘Do you have a question for me’ very very seriously. Ask genuine questions and don’t ask rubbish. People are usually good and teach you a lot when you ask them good questions 5) The Microsoft process is meticulous and you will enjoy it if you love solving puzzles. An opportunity to show your talent or aptitude is given to you if you ask. 6) For people looking for PM, read a lot(Newspapers/tech blogs/technologies), think a lot - that’s all you can do for it.
College Name: Veermata Jijabai Technological Institute, Mumbai [ VJTI ]
Q1. Given a binary tree (not necessarily complete), connect a node to the node to its right (at the same level). Assume you have an extra pointer in the node to per...read more
Q2. Given a sentence, write a function, which when called, would return the first word in the string and modify the string to contain from second to the last word
Q3. Design an elevator system, where there are 5 elevators and 50 floors. What would be the design considerations on which elevator should come when a button is pre...read more
Q7. Given a 2 dim array, find an element which is the maximum in its column and minimum in its row. You are assured that atleast one such element exists. You may re...read more
Q3. What is buffer overflow? Why does it happen? What is the effect of it? How can u prevent it? Write a code snippet where buffer overflow happens.( I wrote a strc...read more
Q4. As I spoke something about canary variable he asked me about that. Make sure u do not just get words out of your mouth because you read it somewhere, If you do ...read more
Q8. This was a coding question, I had to give the algorithm, after he was convinced, I had to write the working code: Given a string like “aaabbbdddaccc” compress i...read more
Q12. Given a binary tree, node structure has data, left, right and next ,where next of every node is NULL. Now you must make every next point to the immediate next n...read more
Round: Test Experience: Q 1) Given an unsorted array and a number N, find a tuple which has a difference of N. If it exists return true else return false.(We all assumed tuple to be any two numbers in the array, I used a hash map, so O(N) time and O(N) space)Q2)Given a circular linked list, insert an element such that after inserting it, the linked list remains sorted.(Consider all cases, inserting in the beginning, end and middle, basically I wrote the insert function such that it creates a sorted circular linked list).Q 3)Given a binary search tree and a number N in the tree, at whatever level N exists in the tree (say k), of that level print the left most node.(Binary search tree property is of no use here, find the level of N in the tree ,say it is k, and then print the nodes at level k from root from left to right, when first node at k gets printed, stop printing, maintain a static or reference variable for the same .I did not get this one perfectly during the test, so that was the first thing I was asked in my level one interview!!) Duration: 60 minutes
Round: Technical Interview Experience: He scanned through my resume and asked questions, so make sure you write stuff about which youcan give at least some idea. I had mentioned about ciphers I had coded, so I was asked questions on network security. Some of the questions I was asked were1) What is the difference between a thread and a process?
2) What is synchronization? Acquiring and releasing a lock etc
3) What is buffer overflow? Why does it happen? What is the effect of it? How can u prevent it? Write a code snippet where buffer overflow happens.( I wrote a strcpy where source was smaller than destination)
4) As I spoke something about canary variable he asked me about that. Make sure u do not just get words out of your mouth because you read it somewhere, If you do not know the meaning ,don’t mention it
5) Symmetric and asymmetric cipher, pros and cons of each.
6) Asked me about my final year project, I said we have not finalised the topic.
7) Asked me what I like , what do I think I am good at?(answer expected was technical, not HR type)
8) This was a coding question, I had to give the algorithm, after he was convinced, I had to write the working code:
Given a string like “aaabbbdddaccc” compress it IN PLACE . (Basically, run length encoding, but elements that occur once you do not have to mention their count, as in abc remains abc )
Round: Technical Interview Experience: 1) Difference between recursion and iteration, pros and cons
2) Write code for Nth Fibonacci number iteratively, what is the disadvantage of doing it recursively.
3) Which is the longest code you wrote till now? Which is the toughest code you wrote till now?
4)Given a binary tree, node structure has data, left, right and next ,where next of every node is NULL. Now you must make every next point to the immediate next node on the same level( as in next one on the right). Convert every level of the binary tree into a circular linked list (populate all the next pointers) Do not destroy the binary tree while doing this, tree structure must be retained.(I came up with an algo of using an array of node pointers, size of array equal to height of the tree something like that. after he was convinced, I had to write the working code, after which I was asked to consider some test cases etc)
5) How do you think a dictionary is implemented in a phone or whatever?
(using a trie , I did not know the name trie , but explained the possible structure which turned out to be a trie! )
Round: Technical Interview Experience: A single question was asked but he asked it in different modified ways to check if could handle all the ways.Given a binary search tree, and a number N, return true if there exists a path in the BST which sums up to N. Otherwise return false.(Not necessarily a root to leaf path, any path)( I gave an n square solution)
Then he told to print the path without using an auxiliary array instead of returning true or false.
Then he asked me to store the start and end pointers of that path
Then he was like if I have given you a start and end node, just print that path.(I used the BST property here)
Round: Technical Interview Experience: 1) Asked about my TGMC project (as it was mentioned in my resume) and my role in it.2) Given a linked list, alternate every two elements. (I gave the algo , then wrote the working code .My code had repeated if else fragments, so it was too long to read, so he asked me to reduce the redundancy, after which I was asked about test cases)3) Given an unsorted array, store in the beginning of the array, one occurrence of every
element in the array,(basically a set form of the array)
Input:1,6,7,3,5,2,7,3,1,6
Output:1,6,7,3,5,2 no importance given to what happens to the remaining part of array!! (Order of elements in output is not important, I suggested using built in SET which he did not allow, so I suggested sorting the array and proceeding, I was asked to write the working code)4) Given a table having names and phone numbers, print all erroneous phone numbers.(I suggested making a regular expression for all possible phone patterns and check each entry with the regular expression. i gave examples of invalid phone numbers)
General Tips: Do not fake something if you do not know it, be honest 2) If you are unable to handle certain test cases it is okay, but then if you yourself point outthe bugs and the cases which have not been handled, leaves a positive impact.3) Remain calm and confident because the interviewers are cool and friendly.4) It is okay to give slightly wrong answers at times, because when they know you are closeto the correct answer, they push you to get it right. They know when to help and get itout from you.5) No HR questions were asked , but just have some background about the company, andyour strength , weakness etc.6) Geeks for geeks and career cup were the websites I had referred to for all my codingrelated preparation. ALL THE BEST !!! College Name: vjti
Round: Test Experience: 30 general aptitude type, 20 pseudo code type. The pseudo code type questions had no coding- just identification of error, correct o/p etc. Tips: The pseudo code type questionshad no coding- just identification of error, correct o/p etc. Total Questions: 50
Round: Test Experience: Pure coding round just write code and submit (no compilation). There were three questions in this round: Given an array and a number N,find whether there are tuples in the array with difference equal to N. Insert an element into a sorted circular linked list. Given a BST and an element N,output the leftmost node at the same level at that element in the tree. Tips: 26 people were short listed from the aptitude test, out of which Iwas in the bottom 13.That meant another written test for me (which I latercame to know, was also counted as a round of interview) This test consistedof two questions: Given two linked listsrepresenting two numbers, each node containing the character representation ofa digit in the number,return a new linked lists representing their sum.Implement the strnstr()function in C from scratch. That is, find the nth occurrence of a string insidethe other, without using any library functions.
Round: Other Interview Experience: This round tried my patience! It was almost exclusively a discussionof my areas of interest. I said network security – so he went into the detailsof cryptography and attacks like buffer overflow. That went on for say 50minutes or so. After that he asked me a coding problem.The problem was to compress a string in place. Having seen thefamous string expansion in place problem many times, I promptly said run lengthencoding (i.e. compress aaaaaabbbbbccc to a6b5c3 for example). He asked me tocode it and write a few test cases for it. Tips: He asked me a coding problem.The problem was to compress a string in place. Having seen the famous string expansion in place problem many times, I promptly said run length encoding (i.e. compress aaaaaabbbbbccc to a6b5c3 for example). He asked me to code it and write a few test cases for it.This guy caught me on whatever word I uttered, which meant you need to be thoroughly prepared with whatever you say there. He knew literally everything and asked me to give ideas on weird things that he assumed I knew!
Round: Technical Interview Experience: This was a nice, pure problem-solving round.First, he asked me the famous “Tell me about yourself” and “How wereyour earlier rounds” questions. But trust me, they were only ice-breakers. Then he started his session. He asked me to tell him beforehand if Iknew the solution to any problem. The following were his questions:WAP to print a matrix spirally.I told him I knew the problem so he skipped it.Search for an element in arotated sorted array (of course in sublinear time!). I tried a twist to binarysearch using rotations, but he pointed out an infinite loop in my code, which Ifailed to correct! Then he changed the question to find the number of rotationsin such an array in sublinear time. This also I could only solve for distinctelements. So he went to the next question.Really nice DP problem. Givenan amount and an array containing possible coin denominations, determine thesmallest no of coins in which the amount may be formed. Assume you have infinite units of each denomination. Tips: This guy was a cool one! He focused on only the problem solving skills and was able to catch any damn error,however small, in the code absolutely quickly. He focused on the way the problem is approached, at least as much as on whether one gets the solution.
Round: Other Interview Experience: This was the hardest and best round. The interviewer was a finalround specialist!First, he asked me about my internship, which I explained to him. Hediscussed it for hardly 10 minutes.Then he started his attack! Even this guy told me that if I knew aquestion, I should ask him to skip it. There were three questions here:Given a linked list, swap itsnodes pair-wise. This is not so simple as it looks, trust me. It has more edgecases than apparent and was a true test of pointer manipulation.Given an array, bring all itsdistinct elements to the top in whatsoever order; the rest of the array is notimportant. First I suggested in O(n) space. Then he asked me to do it withoutextra space. I needed a sorted array for that, which he asked me to assume.Then it is solvable under the required conditions.Given a matrix, find an elementthat is max in its row and min in its col. However, he said in the end, thiswas not the question. The actual question was whether there can be more thanone such element in the matrix, assuming all elements are distinct. Wrote a small proof that there cannot. Tips: 1.One is expected to really know to code. Must have a good understanding of pointers and the ability to manipulate them quickly.2.These guys focus a lot on data structures, especially the basic ones like linked lists and binary trees. I felt these are the topics with max weightage (just my personal opinion!).3. Again my personal opinion:Rather than study many problems from various sites, one should try to solve them, even if a few, on one’s own.
General Tips: These guys focus a lot on data structures, especially the basic ones like linked lists and binary trees. I felt these are the topics with max weightage (just my personal opinion!). Skill Tips: 1.One is expected to really know to code. Must have a good understanding of pointers and the ability to manipulate them quickly. 2.Again my personal opinion: Rather than study many problems from various sites, one should try to solve them, even if a few, on one’s own. Skills: Technical Skills College Name: VJTI
Share
MICROSOFT CORPORATION Interview Questions by Designation