0 like 0 dislike
672 views
| 672 views

## 1 Answer

0 like 0 dislike
Best answer

It is an opportunity for students who are pursuing a bachelor’s degree and are in their pre-final year. Microsoft visited my college campus and this was an on-campus opportunity.

Round 1: It was an online round that consisted of 3 coding questions of easy to medium level and were based on arrays and contained the usage of maps. After round 1, approximately after 15-20 days, I received an email and it was stated that I was shortlisted for an interview.

There were 2 interview rounds in total. I was rejected after the final round of interviews. Still, I would like to share my experience.

Interview Round 1:

• The interviewer was very friendly.
• I was very nervous. So, he asked me to introduce myself.
• He was going through my resume. I had two projects on my resume.
• After this, he asked me to explain my project briefly. I told him the features and the tech stacks and ideas behind the project.
• I had a project related to women’s safety. By chance, my interviewer had also worked on some projects related to women’s security. So he started to tell me about his project.

After that, he told me to proceed with DSA.

He shared a hackerrank live coding link in which when I was coding, he was able to see it live, and along with this he also asked me to share my screen.

Now I will state my question:

Question 1: Roman numerals are represented by seven different symbols: I, V, X, L, C, D, and M.

```Symbol       Value
I             1
V             5
X             10
L             50
C             100
D             500
M             1000```

For example, 2 is written as II in Roman numeral, just two ones added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.

Roman numerals are usually written from largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:

• I can be placed before V (5) and X (10) to make 4 and 9.
• X can be placed before L (50) and C (100) to make 40 and 90.
• C can be placed before D (500) and M (1000) to make 400 and 900.
• Given an integer, convert it to a roman numeral.

Example 1:

```Input: num = 3
Output: "III"
Explanation: 3 is represented as 3 ones.```

Example 2:

```Input: num = 58
Output: "LVIII"
Explanation: L = 50, V = 5, III = 3.```

Example 3:

```Input: num = 1994
Output: "MCMXCIV"
Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.```
```Constraints:
1 <= num <= 3999```
• At first, I was not able to come up with a current solution as I was very confused about the roman symbols. But, the interviewer stated all the symbols and the numbers to which they correspond. The interviewer constantly gave me hints and in the last, I was able to solve the question. I also told him about an approach using maps.
• In the end, he asked me if I wanted to ask him any questions and I asked him about the work culture and expectations from an intern.

Interview Round 2: The interview started with my introduction and then he gave me a question to solve.

Question 1: Given an array containing only 0’s, 1’s, and 2’s, sort it in linear time and using constant space.

```For example,

Input:  { 0, 1, 2, 2, 1, 0, 0, 2, 0, 1, 1, 0 }

Output: { 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2 }```
• Initially, I gave him a normal sol using the inbuilt sort. He asked me which sorting ago did I use. I told him that I used stl sort and he asked me to solve the question using merge sort.
• He told me to implement merge sort from scratch.
• I wrote the code but forgot to write a small condition. Due to this, I faced a runtime error and the interviewer was a bit disappointed with this.
• In the end, I asked him for feedback and he told me that I shouldn’t have made a mistake with such an easy question.
• I knew, that I won’t be selected after his feedback.

Though I wasn’t selected I got to learn that sometimes, silly mistakes can be devastating. So don’t panic in interviews, instead, write the code calmly to avoid such silly mistakes.

by Expert (30,360 points)
selected