Open In App

Coforge Interview Experience For A Software Engineer

I applied for a software engineer role at CoForge for the summer of 2024. I am going to share my experience for the interview since my verdict was accepted, I hope this article will give you better insights for the interview preparation.

Rounds

There were two rounds for the role.



Round 1

In round 1, I was asked two questions from DSA(Data Structures And Algorithm). The questions were of easy to moderate level and were solvable by me. Let me share the questions.

Question 1: link

Solution

I used the queue approach to store the elements and visited the right child before visiting the left child. here is the code I wrote



vector<int> reverseLevelOrder(Node *root)
{
    vector<int> ans;
    stack <Node *> S;
    queue <Node *> Q;
    Q.push(root);
    while (Q.empty() == false)
    {
        root = Q.front();
        Q.pop();
        S.push(root);

        if (root->right)
            Q.push(root->right);
        if (root->left)
            Q.push(root->left);
    }
    while (S.empty() == false)
    {
        root = S.top();
        ans.push_back(root->data);
        S.pop();
    }
    return ans;
}

Since I had already explained an optimized approach, the interviewer didn’t ask me to optimize it further. He just asked me to explain the logic of the code and explain the time and space complexity of the code.

Question 2: Link

Solution

Luckily I had just studied the Morris traversal for Preorder so I was confident when the question was asked. I explained the whole algorithm that will be used and asked the interviewer if I could code it down to explain it better. The interviewer said that the code wasn’t necessary but I could code it if I was confident so I wrote the code below.

void morrisTraversalPreorder(node* root)  
{  
    while (root)  
    {  
        if (root->left == NULL)  
        {  
            cout<<root->data<<" ";  
            root = root->right;  
        }  
        else
        {  
            node* current = root->left;  
            while (current->right && current->right != root)  
                current = current->right;  
  
            if (current->right == root)  
            {  
                current->right = NULL;  
                root = root->right;  
            }  
            else
            {  
                cout<<root->data<<" ";  
                current->right = root;  
                root = root->left;  
            }  
        }  
    }  
}  

Round 2

This round was an HR round where the interviewer asked me questions to check if my values aligned with the company’s policy. The questions were regarding my idea for the ideal job and whether the role matched my ideal role. I was also asked about my availability for weekends and I replied that I could devote some time even on weekends if the project required it. The interviewer seemed happy with my responses.

After 5 days I received the mail that I was selected.

Article Tags :