Mindtree Interview Questions and Experiences
In Technical interview 1 they asked me :
Q1. Tell me about yourself
Good Morning sir/mem.
It’s my pleasure to introduce Myself in front of you,
I am abcd defghtj from Gaziabad UP, I am an innovative Technical engineer with 1 years and 5 months of work experience. I have a lot of knowledge of implementing and troubleshooting any computer-related issue and also implementing connectivity solution for small, medium, and enterprises customer with a team.
I have completed My degree Bachelors of engineering in the stream of Computer Science and Engineering in 2018 with a 7.8 CGPA from RGPV University, Bhopal. Prior to this I have completed my 12th with 88% and completed my 10th with 85% from MPBSE, Bhopal.
My strength is self-motivation, I have a passion to accomplish My work. I am also tech-savvy, I always believe in results-oriented works.
My weakness is that I feel uncomfortable until finish my work.
My short-term goal is to get a job in a reputed company like yours.
My long-term goal is to achieve a respectable position in that organization.
That’s all about me.
Q2. Which language you prefer c or java?
It’s C sir. As ‘C’ can do more and perform faster because it’s closer to machine code.
Q3. What is array? / Can you tell me the definition of array?
An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together. This makes it easier to calculate the position of each element by simply adding an offset to a base value, i.e., the memory location of the first element of the array
Q4. What is stack? What is queue?
Stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle. A helpful analogy is to think of a stack of books; you can remove only the top book, also you can add a new book on the top.
Queue is a container of objects (a linear collection) that are inserted and removed according to the first-in first-out (FIFO) principle. An excellent example of a queue is a line of students in the food court of the UC. New additions to a line made to the back of the queue, while removal (or serving) happens in the front.
Q5. What is constant in c?
Constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals. Constants can be of any of the basic data types like an integer constant, a floating constant, a character constant, or a string literal.
Q6. What is heap?
A heap is a complete binary tree, and the binary tree is a tree in which the node can have utmost two children. Before knowing more about the heap data structure, we should know about the complete binary tree.
” The Interviewer tends to test your basic knowlege about the subject
so prepare them well
Q7. What is pointer?
To put it simply, a pointer is an object in many programming languages that stores a memory address.
Q8. What are Loops? Explain it?
The execution of the sequence of statements many times until the stated condition becomes false is called a Loop. A loop in C consists of two parts, a body of a loop and a control statement. The control statement is a combination of some conditions that direct the body of the loop to execute until the specified condition becomes false.
Q9. What is string?
A string is a specific data type in programming languages formed up by an ordered sequence of characters.
Q10. How you find a reverse of string?
Firstly we take an input from the user, after taking an input we have to calculate the length of the string. To calculate the length we run a loop from the starting of the character array till a null character found ('\0'
) and in each iteration, we increase the count variable. We assign one less than it to the j because the array starts from zero. After this, we simply copy the characters from the ending one by one from the original character array to a new character array.
Q11. What is Linear search and binary search?
A linear search scans one item at a time, without jumping to any item.
The worst-case complexity is O(n).
Time taken to search elements keep increasing as the number of elements are increased.
A binary search however, cut down your search to half as soon as you find the middle of a sorted list.
The middle element is looked to check if it is greater than or less than the value to be searched.
Accordingly, search is done to either half of the given list
Q12. Explain the logic of the Palindrome program
If a number remains the same, even if we reverse its digits then the number is known as a palindrome number.
#include <stdio.h>
int main()
{
int num, reverse_num=0, remainder,temp;
printf(“Enter an integer: “);
scanf(“%d“, &num);
temp=num;
while(temp!=0)
{
remainder=temp%10;
reverse_num=reverse_num*10+remainder;
temp/=10;
}
if(reverse_num==num)
printf(“%d is a palindrome number“,num);
else
printf(“%d is not a palindrome number“,num);
return 0;
}
Q13. What is Overloading?
Overloading refers to the ability to use a single identifier to define multiple methods of a class that differ in their input and output parameters. Overloaded methods are generally used when they conceptually execute the same task but with a slightly different set of parameters.
Q14. Print the following pattern
1
12
123
1234
12345
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,row;
clrscr();
printf(“\nHow many rows\n“);
scanf(“%d“,&row);
for(i=1;i<=row;i++)
{
for(j=1;j<=i;j++)
{
printf(“%d“,j);
}
printf(“\n“);
}
getch();
}
Q15. Swapping of two variables without using third variable.
#include<stdio.h>
int main()
{
int a=10, b=20;
printf(“Before swap a=%d b=%d“,a,b);
a=a+b;
b=a-b;
a=a-b;
printf(“\nAfter swap a=%d b=%d“,a,b);
return 0;
}
Q16. What is linked list?
In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.
Simple Linked List − Item navigation is forward only.
Doubly Linked List − Items can be navigated forward and backward.
//Example of a single linked list
node addNode(node head, int value) {
node temp, p; // declare two nodes temp and p
temp = createNode(); // assume createNode creates a new node with data = 0 and next pointing to NULL.
temp->data = value; // add element’s value to data part of node
if (head == NULL) {
head = temp; // when linked list is empty
}
else {
p = head; // assign head to p
while (p->next != NULL) {
p = p->next; // traverse the list until p is the last node. The last node always points to NULL.
}
p->next = temp; // Point the previous last node to the new node created.
}
return head;
}