Join Regular Classroom : Visit ClassroomTech

Samsung Research Overall Interview Questions + Coding Solutions – codewindow.in

Hot Topics

Samsung Research Solution

Technical Round

Is JVM a process based system or a thread based system?

The Java Virtual Machine (JVM) is a process-based system.

Measure difference between two vectors.

There are several ways to measure the difference between two vectors, depending on the context and the desired outcome. Some common ways to measure the difference between two vectors are:
  1. Euclidean Distance: The Euclidean distance is the straight-line distance between two vectors and is calculated as the square root of the sum of the squared differences between corresponding elements of the two vectors. It is commonly used to measure the similarity or dissimilarity between two vectors in a multi-dimensional space.
  2. Cosine Similarity: Cosine similarity is a measure of similarity between two vectors based on the cosine of the angle between them. It ranges from -1 to 1, where 1 indicates the vectors are identical, 0 indicates they are orthogonal (perpendicular) and -1 indicates they are opposite. It is commonly used in text classification and information retrieval.
  3. Manhattan Distance: Manhattan distance is the sum of the absolute differences between the elements of two vectors. It is also known as the L1-norm distance. This measure is less sensitive to outliers than the Euclidean distance.
  4. Minkowski Distance: Minkowski distance is a generalization of both Euclidean distance and Manhattan distance, and is calculated as the sum of the absolute differences between the elements of two vectors, raised to the power of a parameter p.
  5. Jaccard Similarity: Jaccard similarity is a measure of similarity between two sets, and can be used to compare two binary vectors. It is calculated as the size of the intersection of the sets divided by the size of the union of the sets.
Which one to use depends on the specific use case and the characteristics of the data.

Explain your projects.

Tell about your project

What are the authentication techniques in asp.net?

Different authentication techniques in Asp.net are:

  • Form authentication

  • Passport authentication

  • Windows authentication

  • Custom Authentication Provider

Int i =0; i = i+++i+++i++; give the output when we print i in C , C++ and Java , will the answers be different in each case , why or why not ?

In C and C++, this expression is undefined behavior. The postfix increment operator (++) has higher precedence than the unary plus operator (+), so the expression is equivalent to i = i++ + (i++ + i++);. This means that the value of i is incremented multiple times before the final assignment, making the result unpredictable. Depending on the compiler, the output could be any value, or it could cause a crash or other errors.
In Java, this expression is a syntax error. The unary plus operator (+) is not used in the same way in Java as in C and C++, and this expression is not a valid statement.
In general, it is not recommended to use multiple increment or decrement operators in the same expression, as it can lead to unexpected behavior and make the code difficult to understand. It’s better to use clear and simple statements that are easy to understand, debug and maintain.

What is Memory Allocation ?

In C, memory allocation is the process of setting aside a specific amount of memory for a variable or data structure. There are several ways to allocate memory in C, including:
  1. Static memory allocation: This is done at compile time, where memory is allocated for a variable before the program is executed. For example, declaring a variable with a specific data type like int x; will allocate memory for the variable x.
  2. Automatic memory allocation: This is done at runtime, where memory is allocated for a variable when the program is executed. For example, when a function is called, memory is automatically allocated for the function’s local variables.
  3. Dynamic memory allocation: This is also done at runtime, where memory is allocated for a variable using functions such as malloc(), calloc(), or realloc(). These functions are defined in the C library and are used to allocate memory dynamically during program execution.

Problem was to create an array from one input array where every element in output array is the next biggest element from that element.

You can use a combination of nested loops and conditional statements to create the desired output array.

How to find mid-point of a singly linked list?

To find the mid-point of a singly linked list we can use the tortoise method. We will initiate two pointer fast and slow at the starting node of the list and traverse the list. With each iteration we will move the fast pointer by two nodes and slow pointer by one node. This way when the fast pointer will be pointing to the last node, slow pointer will point to the middle node of the list.

Puzzle : How to cut a cake into equal pieces.

If the cake is round and you want to cut it into equal wedges, you can use the following method:
  1. Place a toothpick or skewer in the center of the cake and use it as a pivot point.
  2. Make a cut from the outer edge of the cake towards the center, using the toothpick as a guide.
  3. Rotate the cake by a certain degree and make another cut.
  4. Repeat the process until the entire cake is cut into equal wedges.
If the cake is square or rectangular, you can use the following method:
  1. Use a ruler or measuring tape to mark out equal sections on the top of the cake.
  2. Use a knife to make straight cuts along the marks to divide the cake into equal sections.
You can also use a cake cutting server which is specifically designed for cutting cakes evenly.

Write a program to check a string is palindrome or not

#include <stdio.h>
#include <string.h>

int main() {
    char string[100];
    int i, length;
    int flag = 0;

    printf("Enter a string: ");
    scanf("%s", string);

    length = strlen(string);

    for (i = 0; i < length; i++) {
        if (string[i] != string[length - i - 1]) {
            flag = 1;
            break;
        }
    }

    if (flag) {
        printf("%s is not a palindrome\n", string);
    } else {
        printf("%s is a palindrome\n", string);
    }

    return 0;
}
/*
OUTPUT
Enter a string: 456
456 is not a palindrome
*/

Nagarro Solved

Automata Fixing

      

We Love to Support you

Go through our study material. Your Job is awaiting.

Recent Posts
Categories