Samsung
10+ GEETANJALI HOMESTATE Interview Questions and Answers
Q1. Reverse Alternate K Nodes Problem Statement
You are given a singly linked list of integers along with a positive integer 'K'. The task is to modify the linked list by reversing every alternate 'K' nodes of the ...read more
Reverse every alternate K nodes in a singly linked list of integers.
Traverse the linked list in groups of K nodes and reverse every alternate group.
Handle cases where the number of remaining nodes is less than K.
Ensure to properly link the reversed groups to maintain the integrity of the linked list.
Q2. What do you think is an area of improvement for you?
I need to improve my time management skills.
Prioritize tasks based on urgency and importance
Set realistic deadlines and stick to them
Avoid multitasking and focus on one task at a time
Use tools like calendars and to-do lists to stay organized
Q3. Write a C program that will COMPILE and RUN to reverse a string in-place
C program to reverse a string in-place
Use two pointers, one at the beginning and one at the end of the string
Swap the characters at the two pointers and move the pointers towards each other until they meet
Handle odd-length strings by leaving the middle character in place
Q4. What are storage classes in C?Explain
Storage classes in C define the scope and lifetime of variables.
There are four storage classes in C: auto, register, static, and extern.
Auto variables are local to a block and have automatic storage duration.
Register variables are stored in CPU registers for faster access.
Static variables have a lifetime throughout the program and are initialized only once.
Extern variables are declared outside any function and can be accessed by any function in the program.
Q5. A piece of plain paper is torn into random number of pieces and how do you construct back the original paper?
Use jigsaw puzzle approach to reconstruct the paper.
Sort the pieces by edges and corners.
Identify patterns and colors to match adjacent pieces.
Use trial and error method to fit the pieces together.
Check for completeness and accuracy of the final paper.
Use computer vision and machine learning algorithms for automation.
Q6. which is faster x++ or ++x and why?
++x is faster than x++ because it increments the value before using it.
++x increments the value before using it, while x++ increments the value after using it.
++x is faster because it saves the overhead of creating a temporary variable.
In some cases, the difference in speed may be negligible and the choice between the two may depend on readability and coding standards.
Q7. Write a program to insert a node in linked list
Program to insert a node in linked list
Create a new node with the given data
Set the next pointer of the new node to the next pointer of the previous node
Set the next pointer of the previous node to the new node
Q8. Write a program to find loop in linked list
Program to find loop in linked list
Use two pointers, slow and fast, to traverse the linked list
If there is a loop, the fast pointer will eventually catch up to the slow pointer
To find the start of the loop, reset the slow pointer to the head and move both pointers at the same pace
Q9. wat is a null object? is it conceptual?
A null object is an object that does not have a value or reference to any object.
A null object is different from an object with a value of zero or an empty string.
It is often used to represent the absence of an object or value.
Null objects can be used to avoid null pointer exceptions in programming.
It is a conceptual idea in programming and computer science.
Q10. What are its features?Explain
Which software are you referring to?
Please specify the software you are asking about
Without context, it is impossible to answer this question
Q11. What are virtual functions?
Virtual functions are functions that can be overridden by derived classes.
Virtual functions are declared in a base class and can be overridden in a derived class.
They allow for polymorphism, where a derived class can be treated as its base class.
Virtual functions are called based on the actual object type, not the pointer or reference type.
They are declared using the 'virtual' keyword in the base class and optionally overridden using the 'override' keyword in the derived clas...read more
Q12. A pseudo code or solution(if you can) for solving the rubik's cube
A solution for solving the Rubik's cube
Use the layer-by-layer method
Solve the first layer cross
Solve the first layer corners
Solve the second layer
Solve the third layer cross
Solve the third layer corners
Orient the third layer corners
Permute the third layer corners
Permute the third layer edges
Q13. What is C++?
C++ is a high-level programming language used for developing system software, application software, device drivers, and video games.
C++ was developed by Bjarne Stroustrup in 1983.
It is an extension of the C programming language.
C++ supports object-oriented programming, generic programming, and low-level memory manipulation.
It is widely used in industries such as finance, gaming, and operating systems development.
Examples of popular software written in C++ include Microsoft Wi...read more
Q14. What is OOP?
OOP stands for Object-Oriented Programming, a programming paradigm that focuses on objects and their interactions.
OOP is based on the concepts of encapsulation, inheritance, and polymorphism.
It allows for modular and reusable code.
Examples of OOP languages include Java, C++, and Python.
Q15. What is late binding
Late binding is a programming concept where the method or function to be executed is determined at runtime.
Also known as dynamic binding or runtime binding
Allows for greater flexibility in code execution
Commonly used in object-oriented programming languages
Example: virtual functions in C++
Q16. Tell about the spark architecture and data modelling
Spark architecture is a distributed computing system that provides high-level APIs for big data processing.
Spark architecture consists of a cluster manager, a distributed storage system, and a computing engine.
Data in Spark is represented as Resilient Distributed Datasets (RDDs) or DataFrames.
Spark supports various data models, including batch processing, streaming, machine learning, and graph processing.
Spark's architecture allows for in-memory data processing, which improve...read more
Q17. Explain logic of quick sort
Quick sort is a divide and conquer algorithm that sorts an array by partitioning it into two sub-arrays.
Choose a pivot element from the array
Partition the array around the pivot element
Recursively apply the above steps to the sub-arrays
Combine the sorted sub-arrays to get the final sorted array
Q18. Explain heap sort
Heap sort is a comparison-based sorting algorithm that uses a binary heap data structure.
Heap sort works by building a binary heap from the array to be sorted.
The largest element is then swapped with the root node and removed from the heap.
The heap is then restructured and the process is repeated until the array is sorted.
Heap sort has a time complexity of O(n log n) and is not stable.
It is often used in embedded systems and operating systems where memory is limited.
More about working at Samsung
Top HR Questions asked in GEETANJALI HOMESTATE
Interview Process at GEETANJALI HOMESTATE
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month