Mindtree Coding Test Papers (AMCAT AUTOMATA)

mindtree_online_coding_test_automata_programing_questions_answers
Mindtree Coding Technical Test Papers
Mindtree online coding test conducted by amcat, this autonama programming test consists of two coding questions which have to be solved with using any of the following languages C or C++ or Java. Selecting a particular language is completely our choice. Within 45 minutes of time one has to run two programs successfully using the online compiler.

Here Iam guessing you will get one easy question and one hard question, There may be chances of selection if your one of the program is running without any errors and giving status of test case is positive, and at least try to attempt for second answer, Coding questions one will be pattern based another mainly a loop based question.



Mindtree Coding Test Placement Paper

Question:-Find a sub string in a given string and replace it with another string?

Question:-Remove all the vowels from a given string using pointers concept

Question:- Find the GCD of the two integers
Answer:-
#include <iostream>
using namespace std;
int gcd_iter(int u, int v) 
{
  int t;
  while (v) 
  {
    t = u; 
    u = v; 
    v = t % v;
  }
  return u < 0 ? -u : u; 
}
int main()
{
  int n=3,m=6;
  int result=gcd_iter(n,m);
  cout<<result;
   return 0;
}



Question:- Print all the prime numbers which are below the given number separated by comma.

Question:- Write a function to return a sorted array after merging two unsorted arrays, the parameters will be two integer pointers for referencing arrays and two int variable, the length of arrays (Hint: use malloc() to allocate memory for 3rd array):


Pattern Question:-
For n=5
1
3*2
4*5*6
10*9*8*7
11*12*13*14*15
Answer:-
#include <iostream>
using namespace std;
int main()
{
   int n=5,num;
   num=1;
   int l=1;
   int k=num;
   for(int i=1;i<=n;i++)
   {
     k=num-1;
       for(int j=1;j<=num;j++)
       {
           if(j%2==0)
           cout<<"*";
           else
           {
               if(i%2==0)
               {      
               cout<<k+l-num+i;
               l++;
               k=k-2;
               }
              else
               cout<<l++;
           }
       }
       num=num+2;//the loop is going on as a prime number 1,3,5,7
       cout<<"\n";
   }
   return 0;
}






Pattern Question:-

For n=4, s=3
3
44
555
6666
6666
555
44
3



Pattern Question:-

1
22
333
4444
55555
4444
333
22

1



Pattern Question:-

To print the pattern like for n=3 the program should print
1 1 1 2 
3 2 2 2 
3 3 3 4
Answer :-
#include <iostream>
using namespace std;
int main()
{
   int n=3,c=n-1;
   for(int i=1;i<=n;i++)
   {
       if(i%2==0)
       cout<<c++;
       for(int j=1;j<=n;j++)
       {
           cout<<i;
       }
       if(i%2!=0)
       cout<<c++;
       cout<<"\n";
   }
   return 0;
}


Pattern Question:-

To print the trapezium pattern. for example , we have n=4 the output should be like
1*2*3*4*17*18*19*20
- -5*6*7*14*15*16
- - - -8*9*12*13
- - - - - -10*11
Answer:-
#include<iostream>
using namespace std;
int main(){
    int n=4,num=1,i=1,space=0,k=1,number=n;
    for(i=0;i<n;i++)
    {
        for(int j=1;j<=space;j++)
        {
            cout<<"-"; 
        }
        for(int m=1;m<2*n-space;m++)
        {
            if(m%2==0)
                cout<<"*";
            else
                cout<<num++;
        }
        cout<<"*";
         for(int l=1;l<2*n-space;l++)
        {
            if(l%2==0)
                cout<<"*";
            else
            {
                cout<<k+number*number;
        k++;
            }
        }
        number--;      
        space=space+2;
        cout<<endl;
    }
    return 0;
}
Mindtree Coding Test Papers (AMCAT AUTOMATA) Mindtree Coding Test Papers (AMCAT AUTOMATA) Reviewed by Shreya Sri on 9:04:00 PM Rating: 5

4 comments:

  1. May I know how the mindtree coding will be??
    What are the frequently asked coding questions??

    ReplyDelete
  2. Hey need recent updated latest mindtree placement materials, WhatsApp me 8240210592

    ReplyDelete
  3. what is the code for the pattern
    3
    44
    555
    6666
    555
    44
    3

    ReplyDelete
    Replies

    1. public static void main (String[] args) throws java.lang.Exception
      { int s=3;
      for(int i=0;i<4;i++)
      {
      for(int j=0;j<=i;j++)
      {
      System.out.print(s);

      }
      System.out.println();
      s++;
      }

      for(int i=3;i>=0;i--)
      { --s;
      int k=s;
      k--;
      for(int j=i-1;j>=0;j--)
      {
      System.out.print(k);
      }
      System.out.println();


      }
      }

      Delete

Placement Papers Hub. Powered by Blogger.