Skip to main content

Microsoft - Online test

Date of visit: 18.7.2018
Criteria: CGPA 7 above no current Arrear
Platform: cocubes
Duration: 1.15 mins

Overview:

    There were three questions in total. There were some three to four question sets with the problems shuffled. Each set consisted of   a 2 marks question, 3 marks question and 5 marks question.

Questions:

SET -1

1. Word average: Given a word as input you have to find the average of the word. It is calculated by the ascii values all the characters present divided by the total number of characters.

Sample Input:      source
Sample Output:  109.5

Explanation:

Ascii value of  s is 115
Ascii value of o is 111
Ascii value of u is 117
Ascii value of r is 114
Ascii value of c is 99
Ascii value of e is 101

                   Total = 657
                   Average = total / string_length = 657 / 6 = 109.5

2. Given a linked list, write a function to reverse every k nodes (where k is an input to the function).

Inputs: 1->2->3->4->5->6->7->8->NULL and k = 3 Output: 3->2->1->6->5->4->8->7->NULL.
 
solution link


3. Find the sum  for all the cousins of a given node in a tree. A cousin of a node is  the node which is present in the same level as given node but having different parents.

Similar problem – printing cousins link

SET - 2

1.  Given two input arrays find the sum of uncommon elements.

similar problem solution

2. Given a number, find the next smallest palindrome larger than this number. For example, if the input number is “2 3 5 4 5”, the output should be “2 3 6 3 2”. And if the input number is “9 9 9”, the output should be “1 0 0 1”.

solution link

3. Given a cost matrix cost[][] and a position (m, n) in cost[][], write a function that returns cost of minimum cost path to reach (m, n) from (0, 0).

solution link  

Questions in other sets:

1. Binary strings without consecutive set bits

solution link


Comments

  1. I had the same "Word average(2 marks) & Sum of all cousins for a node in a tree(5 marks)" questions as 1st and 3rd and I also had one more question for which the weightage was 3 marks.

    Que: Given a number which is of string type(i.e.,String num), write the function to return a string that is the next greater palindrome number than the given input "num".

    ReplyDelete
  2. The set which was given to me had the following questions

    1. Sum of uncommon elements in the array - 2marks (Set 2- qn.1)
    2. Binary strings without consecutive set bits - 3 marks
    (https://www.geeksforgeeks.org/count-number-binary-strings-without-consecutive-1s/)
    3. Reorder the given linked list - 5 marks (Set 1- qn.2)

    ReplyDelete

Post a Comment

Popular posts from this blog

Sahaj - Online Test and Coding Round

Date of visit : 29/08/2018 Criteria        :  7.5 above First Round Duration : 40 minutes. The first round was a online test that had 50 multiple choice questions. The questions were very standard and covered everything like java, C, C++, Python, CSS, DBMS, OOPs, Networks, OS etc. After the first round 20 people were shortlisted for the second round. Second round Duration : 45 minutes  The second round was a coding round where we were given only one question. The objective of the round was not only to check whether the logic and code was correct but whether the students have used paradigms of the programming language they chose. for example, if we choose java to write our code we must have used OOPs principles. The question was to encode the given string in a format specified. Input : this is a secret procedure : 1. remove the spaces, s = thisisasecret 2. find the length of s, l  = 13 3. find w which is the ceil of sqrt of l,...

Thorogood Associates - online test and Interview experience

Date of Visit : 18.08.2018 Criteria: CGPA 7.5 above, No current arrear First Round Duration: 1 hr This is an online round which had two parts,one is about essay writing,other one is about aptitude. Essay Writing Part had two questions,out of these 2 questions we have to write an essay on any one of the topic within 15 minutes. Question: What do you know about Thorogood and what will you do in your first year of Thorogood? Aptitude Part covered Data Interpretation,Logical Reasoning,Profit-Loss problem and other basics aptitude topics which are in R.S Agarwal Book ( link ) or else in IndiaBix ( link ) and this part lasted for next 45 minutes. Second Round Duration: 30 Minutes In this round,our communication,presentation skills and confidence level were tested. They asked us to explain any one of the projects that we mentioned in our resume. They checked whether we can present the project that we did in a professional way.

Ninjacart - coding round

Platform: Hackerrank     The challenge comprised of three questions which were based on arrays and strings .. It may seem easy but the problems were little tricky to solve.. If one is strong enuf in those concepts, then solving them becomes piece of cake😋. I listed two problems(I ve forgot the third one) asked below: Question 1: Buy stocks .. problem link Question 2: Find the number of smooth pairs problem link