Mindtree Coding Test Papers (AMCAT AUTOMATA)
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.
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>
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):
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;
}
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*15Answer:-
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
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 :-
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
#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:-
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:-
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;
}
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)
Reviewed by Placement Papers Hub
on
9:04:00 PM
Rating:
May I know how the mindtree coding will be??
ReplyDeleteWhat are the frequently asked coding questions??
Hey need recent updated latest mindtree placement materials, WhatsApp me 8240210592
ReplyDeleteI too need material
Deletewhat is the code for the pattern
ReplyDelete3
44
555
6666
555
44
3
Deletepublic 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();
}
}
Void incrementpatternprint(int s,int n)
Delete{
int i,j;
for(i=s;i<=(n+s-1);i++)
{
for(j=s;j<=i;j++)
{
printf("%d",i);
}
Printf("/n");
}
for(i<=(n+s-1);i>=s;i--)
{
for(j=s;j<=i;j++)
{
printf("%d",i)
}
Printf("/n");
}
public class Pattern {
Deletepublic static void main(String[] args) {
int N=4;
for(int i=1;i<=N;i++) {
for(int j=1;j<=i;j++) System.out.print(i+2); System.out.println(); } for(int i=N-1;i>=1;i–) {
for(int k=1;k<=i;k++) System.out.print(i+2);
System.out.println();
}
}
}
public class Pattern {
Deletepublic static void main(String[] args) {
int N=4;
for(int i=1;i<=N;i++) {
for(int j=1;j<=i;j++) System.out.print(i+2); System.out.println(); } for(int i=N-1;i>=1;i–) {
for(int k=1;k<=i;k++) System.out.print(i+2);
System.out.println();
}
}
}
Can you upload more questions.
ReplyDeleteCan you write the answer in different language also?
#include
ReplyDeleteint main()
{
int n=4,s=3;
for(int i=1;i1;i--)
{
for(int j=1;j<i;j++)
printf("%d",s);
s--;
printf("\n");
}
return 0;
}
1
ReplyDelete3*2
4*5*6
7*8*9*10
11*12*13*14*15
Solution:-
class NumberSystem
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the value of n");
int n=sc.nextInt();
int num=1;
int count=0;
for(int i=1;i<=n;i++)
{
int k=count;
k=k+i;
for(int j=1;j<=num;j++)
{
if(j%2==0)
System.out.print("*");
else
{
if(i%2!=0)
{
System.out.print(++count);
}
else
{
System.out.print(k--);
count++;
}
}
}
num=num+2;
System.out.println();
}
}
}
Can the programing be done in python
ReplyDeleteCould we use Python in autometa as it is conducted through AMCAT?
ReplyDeletewhen will they declare result .....after writing coding test.....through amcat
ReplyDelete