Join Regular Classroom : Visit ClassroomTech

Kantar Overall Interview Questions + Coding Solutions – codewindow.in

Hot Topics

Kantar Solution

Technical Round

Let us consider an array of 9 elements. In that array first few elements were sorted (assume the first five) and the last four were in a random manner. Which sorting technique would be efficient and why?

If the first five elements of the array are already sorted and the last four elements are in a random order, then it would be efficient to use a sorting technique called "Merge Sort" to sort the entire array. Merge sort is a divide and conquer algorithm, it divides the array into two subarrays, sort them recursively, and then merge the sorted subarrays to get the final sorted array. Since the first five elements are already sorted, the merge sort will take advantage of this and sort the remaining four elements quickly.

Program on prime numbers.

#include<stdio.h>
#include<math.h>
int main(){
    int num,flag=1,i,step=0;
    scanf("%d",&num);
    for(i=2;i<sqrt(num);i++){
        if(num%i==0){
            flag=0;
            break;
        }
        step++;
    }
    if(flag)
        printf("Prime");
    else
        printf("Not Prime");
    printf("\n Total iterations:%d",step);

}
/*
output:
Prime
 Total iterations:9
 */
Explanation:
A number is a prime number which is divisible only by
1 and that number.
Suppose:num=13
Logic:1
if 13 is divisible by any number b/w 2 to 12,then it is
not a prime number.
Suppose:num=13
Logic:1
if 13 is divisible by any number b/w 2 to 13/2=6.5(6),then it is
not a prime number.*/

What is the heap memory?

Java objects and JRE classes which are created during the execution of Java program uses heap memory for dynamic memory allocation.

Write an SQL query fetching first 3 fields.

Here is an example of an SQL query that fetches the first three fields from a table called "Employees":
SELECT field1, field2, field3 FROM Employees;
This query selects the fields named "field1", "field2", "field3" from the "Employees" table and returns the result set.

About basic java logics.

Java is a programming language that is based on the concept of object-oriented programming (OOP). This means that the language is built around the idea of objects, which are instances of classes. A class is a blueprint for an object, defining the properties and methods that the object will have.
In Java, a program is made up of one or more classes, and each class contains methods, which are functions that perform specific tasks. The main method is a special method that is the entry point for a Java program. It is the method that is executed when the program is run.
Java also has several built-in data types, including integers, floating-point numbers, and strings. These data types can be used to create variables, which are containers for storing data.
Java also has a large number of control flow statements, such as if-else statements, switch statements, and while loops, which are used to control the flow of execution in a program.
Java also supports exception handling, which allows the program to handle and recover from errors that may occur during its execution.
Finally, Java has a rich set of built-in libraries and frameworks that provide a wide range of functionality, such as input/output operations, data structures, and networking.
These are the basic logics of java.

Nagarro Solved

Automata Fixing

      

We Love to Support you

Go through our study material. Your Job is awaiting.

Recent Posts
Categories