Join Regular Classroom : Visit ClassroomTech

Mindtree Overall Interview Questions + Coding solutions – codewindow.in

Hot Topics

Mindtree Solution

Technical Round

How many programming languages do you know?

Tell about the programming languages you know.

What is the difference between call by value and call by reference in C?

Call By Value
Call By Reference
1.    When a copy of a value is passed to the function, then the original value is not modified.
When a copy of value is passed to the function, then the original value is modified.
2.    Actual arguments and formal arguments are created in separated memory locations.
Actual arguments and formal arguments are created is same memory location.
3.    In this case, actual argument remain safe as they cannot be modified.
In this case, actual arguments are not reliable, as they are modified.
4.    The copied of the actual arguments are passed to the formal arguments.
The address of actual arguments are passed to their respective formal arguments
 

What is recursion in C?

Recursion is a self-calling function with a terminating condition.

How can you restrict inheritance?

You can restrict inheritance using the “final” keyword while creating a class.

What is the use of “this” keyword in Java?

this keyword is used to carry the reference of the calling object.

What is the final variable?

When the final keyword is used with a variable then its value can’t be changed once assigned. In case no value has been assigned to the final variable then using only the class constructor a value can be assigned to it.

What is the main purpose of an OS? What are the different types of OS?

OS is used to perform various tasks like data input, processing operations and accessing output.
Various operating systems are Linux, Windows, MacOS,etc.

What are 4 pillars of Java?

The 4 pillars of JAVA are:
  • Inheritance: It is a concept of Object Oriented Programming in which a new class is created from the existing one.
  • Polymorphism: Poly means many and morph means form. A concept that enables programmers to assign a different meaning or usage to a variable, function or an object in different context.
Polymorphism can be of two types:
  1. Runtime Polymorphism
  2. Compile Time Polymorphism
  • Abstraction: Creating a new data type using encapsulated items that is well suited for an application.
  • Encapsulation: It is called data hiding and encapsulation is the way of packing data and function into a single unit to hide the implementation details of a class from outer world.

What is Inner Join and Outer Join and their uses?

Inner Join is a SQL operation which is used to return combination of two or more tables having at least one common attribute.
Outer Join is a SQL operation which is used to return combined tuples form a specified table even if the condition is false.

Calculate the address of a random element present in a 2D array, given base address as BA?

#include<stdio.h>
int main(){
    int arr[100][100],i,j,n,cal;
    int BA=1000;
    scanf("%d",&n);
    for(i=0; i<n; i++){
        for(j=0;j<n;j++){
            scanf("%d",&arr[i][j]);
        }
    }
    for(i=0; i<n; i++){
        printf("\n");
        for(j=0;j<n;j++){
            printf("%d" ,arr[i][j]);
        }
    }
    printf(""\nEnter row and col no of index:"");
    scanf("%d %d",&i,j);
    cal=BA+sizeof(arr[i][j])*i*j;
    printf("\nbase address of arr[%d][%d]:%d ",i,j,cal);
    return 0;
}

/*
input:
3
3 6 8
6 9 1
45 64 89
Enter row and col no of index:
1 2

output:
3 6 8 
6 9 1 
45 64 89 
base address of arr[1][2]:1008 

*/

 What are the advantages and disadvantages of views in databases?

Advantages of views in databases:
  • We can see the required columns of the table we need without storing data is physical location.
  • In view we can’t update, delete and insert data.
Disadvantages of views in databases:
  • View becomes irrelevant when a table is dropped.
  • It is a bit slow as a query is requesting data from view.

How do you pass data from one JSP to another JSP?

Passing data from one JSP to another JSP can be done in three ways:
  • using request attributes: Set the value to send in request attribute with a name of your choice as request.setAttribute(“send”, “valueToSend”) and retrieve it on another jsp using request.getAttribute(“send”);
  • using session attributes Similar to above but using session object instead of request.
  • using application attributes same as 1 and 2 above but using application object in place of request and session.

In Java, is there any alternative to inheritance?

In Java delegation can be used alternative to inheritance in which we can use an object of another class as an instance variable i.e. we are just passing a duty off to another class.

What is destructor?

Destructor is a method which is automatically called when an object is no longer needed. It can be also called as a garbage collector.

What is the difference between arrays and structures?

Array
Structure
1.    Array is a linear data structure which contains homogenous data types.
Structure is the collection of elements of heterogeneous data types.
2.    Array elements are stored in contiguous memory location.
Structure elements may or may not be stored in contiguous memory location.
3.    Array elements can be accessed by their index number.
Structure elements are accessed using dot operator after their name.
4.    Array is of non-primitive datatype.
Structure is user defined datatype.
 

How can you check whether the given Binary tree is a Binary Search Tree or not?

Binary tree is a tree data structure in which each node contains 2 child nodes.
Binary Search Tree is a tree data structure in which each node contains 2 child nodes but the left sub tree of a node only contains element lesser than the actual node and right subtree contains element which are greater than the actual node.

What is _init_?

_init_  works as a constructor that is used to initialize an object’s state.

What are constraints?

Constraints are a set of rules that is enforced on the columns of a table.

What is tree traversal?

Tree traversal is the way in which we can traverse through all the nodes of the tree. There are different kind of tree traversal such as:
  • In order traversal
  • Pre order traversal
  • Post order traversal
  • Level order traversal

What do you mean by Pre-order, In-order, Post-order traversal?

  • Pre-order: In pre-order traversal we first visit the root then traverse the left subtree and finally we traverse the right subtree.
  • In-order: In in-order traversal we first traverse the left sub-tree then visit the root and finally traverse the right subtree.
  • Post-order: In post-order traversal we first traverse the left subtree then we traverse the right subtree and then we visit the root.

Differentiate between the equals() method and ==.

 

equals()
==
It is a method.
It is an operator.
It is used to compare the content.
It is used for address comparison.

Nagarro Solved

Automata Fixing

      

We Love to Support you

Go through our study material. Your Job is awaiting.

Recent Posts
Categories