Grey Orange interview experience Real time questions & tips from candidates to crack your interview

Senior Software Engineer

Grey Orange
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: String Manipulation, OOPS, System design, JavaScript Concepts, API Designing
Tip
Tip

Tip 1 : Go through the basic and advanced concepts of JavaScript
Tip 2 : Do the string and Array question from internet
Tip 3 : Do database design questions and API questions as well

Application process
Where: Referral
Resume Tip
Resume tip

Tip 1 : Have 1-page resume
Tip 2 : Mention all your skills in your resume

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date1 Nov 2021
Coding problem2

The total time was 1 hour and the timing was between 2-3 pm afternoon. The interviewer joined the meeting on time. It started with a basic self-introduction and then we started with interview questions.

1. String Sorting

Moderate
30m average time
60% success
0/80
Asked in companies
FacebookHCL TechnologiesPaytm (One97 Communications Limited)

You and your friend found a string ‘S’ of length ‘N’. You love to rearrange the strings, So you decided to rearrange this string too. But this time, your friend puts a constraint on rearranging. He gave you ‘M’ pairs of integers, each pair denoting two indices of the string ‘S’. He also gave you an operation. In one operation, you can select a pair of indices from the given ‘M’ pairs and swap the character present at those indices in the string.

Your task is to rearrange the strings following the given constraints and find the lexicographically smallest string that you can obtain by doing the operations any number of times (might be 0 as well).

Problem approach

Step 1 :  Start traversing the given string.
a) If an alphabet comes to increment its
occurrence count into a hash_table.
b) If an integer comes then store it 
separately by summing it up every time.
Step 2 : Using hash_table append all the 
characters first into a string and 
then at the end, append the integers 
sum.

Step 3 : Return the resultant string.

Try solving now

2. First and Last Position of an element in Sorted Array

Easy
20m average time
80% success
0/40
Asked in companies
InfosysGoogleAmazon

You are given a non-decreasing array 'arr' consisting of 'n' integers and an integer 'x'. You need to find the first and last position of 'x' in the array.


Note:
1. The array follows 0-based indexing, so you need to return 0-based indices.
2. If 'x' is not present in the array, return {-1 -1}.
3. If 'x' is only present once in the array, the first and last position of its occurrence will be the same.


Example:
Input:  arr = [1, 2, 4, 4, 5],  x = 4

Output: 2 3

Explanation: The given array’s 0-based indexing is as follows:
 1      2     4     4     5
 ↓      ↓     ↓     ↓     ↓
 0      1     2     3     4

So, the first occurrence of 4 is at index 2, and the last occurrence of 4 is at index 3.
Problem approach

Brute force approach, first I used this approach:
1. Run a for loop and for i = 0 to n-1
2. Take first = -1 and last = -1 
3. When we find the element the first time then we update first = i 
4. We always update last=i whenever we find the element.
5. We print first and last.

The interviewer asked me to optimize the solution
Efficient approach:
We can solve this with the help of a binary search.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date8 Nov 2021
Coding problem2

It was 1 hour interview. It was based on problem-solving with javascript. In this interview, I was asked to solve the 3 questions in a single run(I only had 1 chance to execute each problem statement).

1. Merge Two Binary Trees

Easy
15m average time
85% success
0/40
Asked in companies
Natwest GroupThought WorksApple

You are given roots of two binary trees, ‘ROOT1’ and ‘ROOT2’. You need to merge the two trees into a new binary tree. The merge rule is that if the two nodes overlap, then the sum of the two nodes values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree. Your task is to return the merged tree i.e. head of the new tree.

Note:

The merging process must start from the root nodes of both trees.

For example,

‘ROOT1’ = [1, 2, -1, -1, 3, -1, -1]  ‘ROOT2’ = [3, -1, -1].
The final tree would look like : [3, 2, -1, -1, 3, -1, -1], and the output will be printed in a pre-order way: 4 2 3.

Problem approach

I used the simple recursive merge technique to solve the problem. The interviewer didn't ask me to optimize further.

Try solving now

2. Reverse Words In A String

Easy
10m average time
90% success
0/40
Asked in companies
Thought WorksFacebookApple

You are given a string 'str' of length 'N'.


Your task is to reverse the original string word by word.


There can be multiple spaces between two words and there can be leading or trailing spaces but in the output reversed string you need to put a single space between two words, and your reversed string should not contain leading or trailing spaces.


Example :
If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
Problem approach

I used javascript inbuilt functions to solve the problem. Such as split, reverse, and join

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date9 Nov 2021
Coding problem1

This round was based on a system design problem. This interview was also for an hour.

1. System Design

DB schema of a ticket booking system along with APIs endpoints and handling concurrency. Further asked to normalize the database.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is the output of print(type("Python"))?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
5791 views
0 comments
0 upvotes
Fullstack Developer
2 rounds | 4 problems
Interviewed by Grey Orange
2682 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
2160 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 6 problems
Interviewed by Expedia Group
1626 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Senior Software Engineer
1 rounds | 6 problems
Interviewed by Arcesium
3365 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by Ernst & Young (EY)
4238 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by HCL Technologies
2362 views
3 comments
0 upvotes