• Study Materials – Company wise
    • Infosys Archive
    • Accenture Archive
    • AMCAT Archive
    • Capgemini Archive
    • Cisco Archive
    • CoCubes Archive
    • Cognizant(CTS) Archive
    • Dell Archive
    • Deloitte Archive
    • DXC Archive
    • Goldman Sachs Archive
    • Hexaware Technologies Archive
    • LTI Archive
    • MindTree Archive
    • TCS Archive
    • Virtusa Archive
    • Wipro Archive
  • Interview Preparation – E Books
    • C Interview Questions
    • Data Structures Interview Questions
    • DBMS Interview Questions
    • HR Interview Questions
    • Java Interview Questions
    • Operating System Interview Questions
    • Python Interview Questions
    • SQL Query Interview Questions
  • Programming
    • C Programming MCQs
    • C Code Snippets – Output Questions
    • Python Code Snippets – Output Questions
  • Aptitude
    • Verbal Ability for Placements
    • Quant for Placements
  • Register
  • Login
CODE OF GEEKS

We at CODE OF GEEKS, aim at providing best and quality content for our users at no extra cost.

    • Study Materials – Company wise
      • Infosys Archive
      • Accenture Archive
      • AMCAT Archive
      • Capgemini Archive
      • Cisco Archive
      • CoCubes Archive
      • Cognizant(CTS) Archive
      • Dell Archive
      • Deloitte Archive
      • DXC Archive
      • Goldman Sachs Archive
      • Hexaware Technologies Archive
      • LTI Archive
      • MindTree Archive
      • TCS Archive
      • Virtusa Archive
      • Wipro Archive
    • Interview Preparation – E Books
      • C Interview Questions
      • Data Structures Interview Questions
      • DBMS Interview Questions
      • HR Interview Questions
      • Java Interview Questions
      • Operating System Interview Questions
      • Python Interview Questions
      • SQL Query Interview Questions
    • Programming
      • C Programming MCQs
      • C Code Snippets – Output Questions
      • Python Code Snippets – Output Questions
    • Aptitude
      • Verbal Ability for Placements
      • Quant for Placements
    • Register
    • Login
  • [email protected]
  • ..
Login / Register
Apply Now
CODE OF GEEKS
CODE OF GEEKS
  • Study Materials – Company wise
    • Infosys Archive
    • Accenture Archive
    • AMCAT Archive
    • Capgemini Archive
    • Cisco Archive
    • CoCubes Archive
    • Cognizant(CTS) Archive
    • Dell Archive
    • Deloitte Archive
    • DXC Archive
    • Goldman Sachs Archive
    • Hexaware Technologies Archive
    • LTI Archive
    • MindTree Archive
    • TCS Archive
    • Virtusa Archive
    • Wipro Archive
  • Interview Preparation – E Books
    • C Interview Questions
    • Data Structures Interview Questions
    • DBMS Interview Questions
    • HR Interview Questions
    • Java Interview Questions
    • Operating System Interview Questions
    • Python Interview Questions
    • SQL Query Interview Questions
  • Programming
    • C Programming MCQs
    • C Code Snippets – Output Questions
    • Python Code Snippets – Output Questions
  • Aptitude
    • Verbal Ability for Placements
    • Quant for Placements
  • Register
  • Login
0

Cart

MindTree Coding Questions

  • June 30, 2020
  • CODE OF GEEKS
  • 1

MindTree Coding section consists of 2 coding-related questions, wherein the student is required to code in any language of their choice.

1. Pattern 1

def mindtree(n) : 
    j=0
    ind=0
    for i in range(1, n + 1) : 
        if i % 2 != 0 : 
            for j in range(ind + 1, ind + i) : 
                print(str(j)+"*", end = "") 
            j = ind + i 
            print(j) 
            j += 1  
            ind = j 
        else : 
            ind = ind + i - 1
            for j in range(ind, ind - i + 1, -1) : 
                print(str(j) + "*", end = "")
            j = ind - i + 1
            print(j) 
if __name__ == "__main__" : 
    n=int(input()) 
    mindtree(n)
  


2. Pattern 2

//Assume all header files are included 
void mindtree(int n) 
{  
    for (int i = 1; i <= n; i++)  
    { 
        for (int j = 1; j <= i; j++)  
           printf("%d",i);        
        printf("\n");
    } 
    for (int i = n - 1; i > 0; i--)  
    { 
       for (int j = i; j > 0; j--)  
            printf("%d",i);        
        printf("\n"); 
    } 
} 
int main() 
{ 
    int n; 
    scanf("%d",&n);
    mindtree(n); 
    return 0; 
} 


Pattern 3 :

//Assume all header files are included 
int main()
{
int i, j, num;
scanf("%d", &num);
for(i=1; i<=num; i++)
{
for(j=1; j<=i; j++)
{
if(i==1 || i==num || j==1 || j==i)
{
printf("1");
}
else
{
printf("0");
}
}
printf("\n");
}
return 0;
}


Pattern 4 :

//Assume all header files are included 
int main()
{
int i, j, N;
scanf("%d", &N);
for(i=1; i<=N; i++)
{
for(j=i; j<=(i*i); j += i)
{
 printf("%-3d", j);
}
printf("\n");
}
return 0;
}


3. Program to find the GCD of two numbers.

See the solution here : https://codeofgeeks.com/gcd-of-two-numbers-using-c/

4. Program to find the LCM of two numbers.

See the solution here : https://codeofgeeks.com/lcm-of-two-numbers-using-c/

5. 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)

6. Implement Merge Sort using Arrays.

7. Program to print prime numbers between 1 to n.

Follow the approach given here : https://codeofgeeks.com/prime-numbers-in-given-range/

8. Program to reverse the order of words in a given string.

See the solution here : https://codeofgeeks.com/reversing-a-string-using-c/

9. Program to count frequency of digits in an integer.



  • Previous Hexaware Technologies Aptitude + Logical Reasoning Questions [Updated]
  • Next MindTree Archive

1 comment on “MindTree Coding Questions”

  1. Pingback: MindTree Archive - CODE OF GEEKS

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CODE OF GEEKS

Subscribe to Newsletter

CODE OF GEEKS

Learn | Code | Achieve

Reach us

[email protected]
We at CODE OF GEEKS, aim at providing quality content to our users at no cost.
CODE OF GEEKS

Important Pages

About us
Advertise
Privacy Policy
Terms and Conditions

Placements – Study Materials

TCS NQT     Wipro     CapGemini
Accenture     MindTree     CTS
DXC     Hexaware Technologies     AMCAT
CoCubes     Goldman Sachs     Dell
Cisco     Deloitte     Virtusa     LTI     Infosys   

Courses

  • Mail Us
  • Login/Register

Recent Posts

TCS Reasoning 2021
  • October 4, 2021
TCS Verbal 2021
  • October 4, 2021

Copyright 2021 CODE OF GEEKS. All Rights Reserved.

  • →