
Samsung


300+ Samsung Interview Questions and Answers
Q101. Longest Substring Without Repeating Characters Problem Statement
Given a string S
of length L
, determine the length of the longest substring that contains no repeating characters.
Example:
Input:
"abacb"
Output...read more
Find the length of the longest substring without repeating characters in a given string.
Use a sliding window approach to keep track of the longest substring without repeating characters.
Use a hashmap to store the index of each character in the string.
Update the start index of the window when a repeating character is encountered.
Calculate the maximum length of the window as you iterate through the string.
Return the maximum length as the result.
Q102. A program to tell if a knight on a chessboard at a given location can reach another location in <= a given number of moves
Program to check if a knight on a chessboard can reach another location in <= given moves
Create a function that takes the starting and ending positions of the knight and the maximum number of moves allowed
Use a breadth-first search algorithm to explore all possible moves of the knight within the given number of moves
If the ending position is reached within the given number of moves, return true, else return false
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence with increasing order.
Use dynamic programming to solve the LIS problem efficiently.
Maintain an array to store the length of the LIS ending at each element.
Iterate through the array and update the LIS length based on previous elements.
Example: For input [10, 22, 9, 33, 21, 50, 41, 60, 80], the LIS is [10, 22, 33, 50, 60, 80] with length 6.
Q104. What are the cases in which you analyze the thread dump?
Thread dumps are analyzed to identify performance bottlenecks and deadlocks in the application.
To identify the root cause of performance issues
To identify deadlocks and thread contention issues
To identify long running threads and blocked threads
To identify memory leaks and excessive CPU usage
To identify issues related to garbage collection
To identify issues related to database connections and transactions
Q105. puzzle-There are 1000 wine bottles. One of the bottles contains poisoned wine. A rat dies after one hour of drinking the poisoned wine. How many minimum rats are needed to figure out which bottle contains poiso...
read moreAt least 10 rats are needed to figure out which bottle contains poison in an hour.
Number the bottles from 1 to 1000.
Use binary representation of the bottle numbers to assign each rat a unique combination of bottles to drink.
For example, Rat 1 drinks from all bottles with a binary representation that has a 1 in the least significant bit (LSB).
After an hour, the rats that die will indicate the binary representation of the poisoned bottle.
By decoding the binary representation, t...read more
Q106. 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
Q107. Can you reinitialize the virtual users if they directly go to the error state and it has consumable data?
Yes, virtual users can be reinitialized if they go to error state with consumable data.
Reinitializing virtual users can help in identifying the root cause of the error.
It is important to ensure that the consumable data is backed up before reinitializing the virtual users.
Reinitializing virtual users should be done only after analyzing the error and identifying the cause.
It is important to have a backup plan in case reinitializing the virtual users does not resolve the error.
Q108. What is context switching, and parsing in the database, and how does it impact the performance of the DB server?
Context switching and parsing are database operations that impact DB server performance.
Context switching is the process of switching between different tasks or threads in a CPU.
Parsing is the process of analyzing and interpreting data in a database.
Both operations require CPU resources and can cause delays in processing other tasks.
Context switching can be reduced by optimizing code and minimizing the number of threads.
Parsing can be improved by using efficient algorithms an...read more
Q109. What is the difference between malloc and new and which one is faster and why?
malloc and new are used to allocate memory dynamically. Malloc is faster but new is safer.
malloc is a C function while new is a C++ operator
malloc only allocates memory while new also initializes the memory
new throws an exception if allocation fails while malloc returns NULL
malloc is faster because it does not involve constructor calls
new is safer because it ensures type safety and prevents memory leaks
Q110. there three files f1.c, f2.c, f3.c.. in f1.c int a is declared, in f2.c static int b are declared.. what are the variables that can be accessed from files f1.c and f2.c in f3.c ... If variable 'a' has to be acc...
read moreVariables accessible from f1.c and f2.c in f3.c. 'a' needs to be declared as extern to be accessed.
Variables declared as static in f2.c can only be accessed within f2.c
Variables declared in f1.c can be accessed in f3.c by declaring them as extern
Variables declared in f3.c cannot be accessed in f1.c or f2.c
Q111. Remove Duplicates from String Problem Statement
You are provided a string STR
of length N
, consisting solely of lowercase English letters.
Your task is to remove all duplicate occurrences of characters in the s...read more
Remove duplicate occurrences of characters in a given string.
Use a hash set to keep track of characters seen so far.
Iterate through the string and add non-duplicate characters to a new string.
Return the new string as the result.
Spiral order traversal of a binary tree involves printing nodes level by level alternating between left to right and right to left.
Start by pushing the root node into a queue.
While the queue is not empty, pop a node, print its value, and push its children into the queue.
For each level, alternate between printing nodes from left to right and right to left.
Repeat until all nodes are printed in spiral order.
Q113. Difference between structure and union and what are the pros and cons of both?
Structure and union are data structures in C language. Union stores only one value at a time while structure stores multiple values.
Structure is used to store different data types while union is used to store only one data type at a time.
Structure allocates memory for all its members while union allocates memory for only the largest member.
Structure is used when we want to store multiple values of different data types while union is used when we want to store only one value a...read more
Use one wire to measure 30 minutes, then ignite the other wire at one end to measure the remaining 15 minutes.
Ignite one wire at both ends and the other wire at one end simultaneously
After 30 minutes, the first wire will burn out completely
At this point, ignite the other end of the second wire
The second wire will burn for another 15 minutes before burning out completely
Q115. How do we know the linked list is a circular or not?
To check if a linked list is circular, we can use Floyd's cycle-finding algorithm.
Floyd's cycle-finding algorithm uses two pointers, one moving at twice the speed of the other.
If the linked list is circular, the fast pointer will eventually catch up to the slow pointer.
If the linked list is not circular, the fast pointer will reach the end of the list and the algorithm will terminate.
Q116. What is the structure byte padding and how does it form and depend? Is there any concept
Structure byte padding is the insertion of unused bytes between structure members to align them in memory.
Padding is added to ensure that each member of a structure is aligned on a memory boundary that is a multiple of its size.
The amount of padding added depends on the size and alignment requirements of the members.
Padding can affect the size of a structure and the performance of code that uses it.
For example, a structure with a 4-byte member followed by a 1-byte member will...read more
Q117. Can you say about the priority of mobile application which one is having higher priority?
The priority of a mobile application depends on the business goals and user needs.
The priority of a mobile application can vary depending on the business goals and user needs.
For example, a mobile banking app may have a higher priority than a social media app for a bank.
On the other hand, a social media app may have a higher priority for a media company.
The priority can also depend on the target audience and the market demand.
It is important to prioritize features and functio...read more
Structure and union are both used to group different data types, but structure allocates memory for each member separately while union shares the same memory space for all members.
Structure allocates memory for each member separately, while union shares the same memory space for all members.
Structures are used when each member needs its own memory space and unions are used when only one member is accessed at a time.
Structures are typically larger in size compared to unions be...read more
Q119. What is FPGA and what are its advantages?
FPGA stands for Field Programmable Gate Array. It is a type of integrated circuit that can be programmed after manufacturing.
FPGAs offer flexibility and can be reprogrammed for different applications
They can be used to accelerate certain tasks such as image processing or cryptography
FPGAs can be more power-efficient than traditional CPUs for certain applications
Examples of FPGA manufacturers include Xilinx and Intel (formerly Altera)
Q120. 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.
Q121. What is the self referential structure, write an example of self referential structure?
Self referential structure is a structure that contains a pointer to the same type of structure.
It allows a structure to reference itself within its own definition.
It is commonly used in linked lists, trees, and graphs.
Example: struct Node { int data; struct Node *next; };
Here, the Node structure contains a pointer to another Node structure.
Q122. How to set the priority of any process in windows and in linux?
To set process priority in Windows and Linux, use task manager and nice command respectively.
In Windows, open task manager, right-click on the process and select 'Set Priority'
In Linux, use the 'nice' command followed by the process name or ID and the priority level (values range from -20 to 19)
Higher priority levels mean the process will get more CPU time
Examples: 'nice -n 10 firefox' sets Firefox priority to 10 in Linux, 'Set Priority' in task manager allows setting priorit...read more
Q123. 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.
Structure and union are both used to group different data types, but structure allocates memory for each member separately while union shares the same memory location for all members.
Structure allocates memory for each member separately, while union shares the same memory location for all members.
Structures are used when each member needs its own memory space, while unions are used when only one member is accessed at a time.
Structures are typically larger in size compared to ...read more
Q125. How to generate heap dump and thread dump for Unix and Linux systems?
Generating heap dump and thread dump on Unix/Linux systems
For heap dump: use jmap command with -dump option
For thread dump: use jstack command
Heap dump can also be generated using kill -3
Thread dump can also be generated using kill -QUIT
Q126. What are the various thread states found in the thread dump?
Thread states in thread dump include NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, and TERMINATED.
NEW: thread has been created but not yet started
RUNNABLE: thread is executing or ready to execute
BLOCKED: thread is blocked waiting for a monitor lock
WAITING: thread is waiting indefinitely for another thread to perform a particular action
TIMED_WAITING: thread is waiting for another thread to perform a particular action for a specified period of time
TERMINATED: thread has compl...read more
Q127. 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.
Q128. What is the difference between these two statement: const int *p; int const *p;
The two statements are equivalent and declare a pointer to a constant integer.
Both statements declare a pointer to an integer that cannot be modified through the pointer.
The 'const' keyword can be placed before or after the 'int' keyword.
The pointer itself can still be modified to point to a different integer.
Example: const int *p; and int const *p; both declare a pointer to a constant integer.
Q129. What is feedback in amplifiers? What are the types of feedback?
Feedback in amplifiers is a process of returning a portion of the output signal back to the input.
Feedback helps to improve the performance of amplifiers by reducing distortion and increasing stability.
There are two types of feedback: positive and negative.
Positive feedback increases the gain of the amplifier, while negative feedback decreases the gain.
Negative feedback is commonly used in amplifiers to improve linearity and reduce distortion.
Positive feedback is used in osci...read more
Q130. Derive the current equation of MOS transistor current equations?Both saturation and linear regions!
The current equation of a MOS transistor describes its behavior in both saturation and linear regions.
The current equation in saturation region is given by Ids = 0.5 * k * (Vgs - Vth)^2
The current equation in linear region is given by Ids = k * ((Vgs - Vth) * Vds - 0.5 * Vds^2)
Ids represents the drain current, Vgs is the gate-to-source voltage, Vth is the threshold voltage, Vds is the drain-to-source voltage, and k is a constant
In saturation region, the drain current is quadr...read more
Q131. Consider we have large amount of physical memory.Do we still need virtual memory? What is the use of paging in that situation
Virtual memory is still needed even with large physical memory. Paging helps manage memory efficiently.
Virtual memory allows for larger programs to run than physical memory can handle
Paging helps manage memory efficiently by swapping out unused pages to disk
Virtual memory also allows for memory protection and sharing between processes
Examples of programs that require virtual memory include video editing software and large databases
Q132. 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
Q133. what is virtual function?what is virtual function table?what is virtual pointer? what is the size of virtual pointer(vptr)?
Virtual functions are functions that can be overridden in derived classes. Virtual function table stores the addresses of these functions.
Virtual functions allow polymorphism and dynamic binding
Virtual function table is a lookup table of function pointers
Virtual pointer points to the virtual function table
Size of virtual pointer depends on the architecture of the system
Multitasking refers to the ability of an operating system to run multiple tasks concurrently, while multithreading involves executing multiple threads within a single process.
Multitasking allows multiple processes to run simultaneously on a single processor, switching between them quickly.
Multithreading enables a single process to execute multiple threads concurrently, sharing resources like memory and CPU.
Multitasking improves system efficiency by utilizing idle CPU time, wh...read more
Q135. You are given a string and a number.Count the no of ‘-’ characters in the string and return 1 if the count is equal to the number given or else return 0
Count the number of '-' characters in a string and return 1 if it matches the given number, else return 0.
Use a loop to iterate through each character in the string and count the number of '-' characters.
Compare the count with the given number and return 1 if they match, else return 0.
Handle edge cases such as empty string or negative number input.
Q136. Differences between Mutex and Semaphore. Why do we need Mutex if we have Semaphores
Mutex and Semaphore are synchronization primitives used in multi-threaded environments.
Mutex is used to provide mutual exclusion to a shared resource, allowing only one thread to access it at a time.
Semaphore is used to control access to a shared resource, allowing multiple threads to access it at a time.
Mutex is binary, meaning it has only two states - locked and unlocked, while Semaphore can have multiple states.
Mutex is typically faster and simpler to use than Semaphore.
We...read more
Early binding is resolved at compile time while late binding is resolved at runtime in C++.
Early binding is also known as static binding, where the function call is resolved at compile time based on the type of the object.
Late binding is also known as dynamic binding, where the function call is resolved at runtime based on the actual type of the object.
Early binding is faster as the function call is directly linked to the function address during compilation.
Late binding allow...read more
Diamond Problem is a multiple inheritance issue in C++ where a class inherits from two classes that have a common base class.
Diamond Problem occurs when a class inherits from two classes that have a common base class, leading to ambiguity in accessing members.
It can be resolved in C++ using virtual inheritance, where the common base class is inherited virtually to avoid duplicate copies of base class members.
Example: class A is inherited by classes B and C, and class D inheri...read more
Virtual memory allows the operating system to use a combination of RAM and disk space to simulate more memory than is physically available. Cache implementation involves storing frequently accessed data in a smaller, faster memory for quicker access.
Virtual memory allows programs to use more memory than physically available by swapping data between RAM and disk.
Cache implementation involves storing frequently accessed data in a smaller, faster memory for quicker access.
Exampl...read more
DFS is a graph traversal algorithm that explores as far as possible along each branch before backtracking.
Start at a node and explore as far as possible along each branch before backtracking
Use a stack to keep track of nodes to visit
Mark visited nodes to avoid revisiting them
Recursive implementation is common
Q141. Is there any ideal CPU scheduling possible? Justify your answer?
No, there is no ideal CPU scheduling possible.
CPU scheduling is a complex problem with many variables.
Different scheduling algorithms are suited for different scenarios.
The ideal scheduling algorithm would depend on the specific system and workload.
For example, a real-time system would require a different scheduling algorithm than a batch processing system.
Q142. 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
Q143. Difference between extern and static and give an example to justify?
extern and static are storage classes in C programming language.
extern is used to declare a variable or function that is defined in another file or module.
static is used to declare a variable or function that is local to a file or module.
Example of extern: extern int count; //declares count variable defined in another file.
Example of static: static int count = 0; //declares count variable local to the file.
Mutex is used for exclusive access to a resource by only one thread at a time, while semaphore can allow multiple threads to access a resource simultaneously.
Mutex is binary semaphore with ownership, used for mutual exclusion.
Mutex is typically used to protect critical sections of code.
Semaphore is a signaling mechanism, used for synchronization between multiple threads.
Semaphore can have a count greater than 1, allowing multiple threads to access a resource.
Example: Mutex is...read more
Q145. what is a semaphore? what is a mutex? what are message queues? what are the different types of inter process communications?
Semaphore, mutex, message queues are inter-process communication mechanisms. Semaphores and mutexes are used for synchronization.
Semaphore is a signaling mechanism used to control access to a shared resource.
Mutex is a locking mechanism used to ensure mutual exclusion of shared resources.
Message queues are used for exchanging messages between processes.
Other types of inter-process communication include pipes, sockets, and shared memory.
Semaphores and mutexes are used for sync...read more
The four pillars of OOP are encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Inheritance: Allowing a new class to inherit properties and behaviors from an existing class.
Polymorphism: The ability for objects of different classes to respond to the same message in different ways.
Abstraction: Hiding the complex implementation details and showing only the necessary features of an object.
Q147. Implementation of stacks with queues and vice versa
Stacks can be implemented using two queues, while queues can be implemented using two stacks.
To implement a stack using queues, we can use one queue for storing elements and another temporary queue for operations.
To push an element onto the stack, we enqueue it to the temporary queue, then enqueue all elements from the main queue to the temporary queue, and finally swap the names of the two queues.
To pop an element from the stack, we dequeue an element from the main queue.
To ...read more
Q148. which two things required in Sales?
Two things required in Sales are communication skills and product knowledge.
Effective communication skills to understand customer needs and persuade them to buy
In-depth knowledge of the product or service being sold to answer customer questions and provide solutions
Q149. Which is the best sorting algorithm ( considering all the aspects of time as well as space) ?
It depends on the specific use case and input size.
For small input sizes, simple algorithms like insertion sort or selection sort may be sufficient.
For larger input sizes, more complex algorithms like merge sort or quicksort may be more efficient.
For nearly sorted input, insertion sort may be the fastest.
For input with many duplicates, counting sort or radix sort may be the best choice.
For input with a known range, bucket sort may be the most efficient.
Overall, there is no on...read more
Q150. 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.
Q151. 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
Q152. 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
Q153. what is the use of 'friend' access specifier in c++? ( redundancy)
The 'friend' access specifier in C++ allows a non-member function or class to access private and protected members of a class.
The 'friend' keyword is used to declare a function or class as a friend of a class.
A friend function can access private and protected members of the class it is declared as a friend of.
A friend class can access private and protected members of the class it is declared as a friend of.
The 'friend' keyword does not affect the access specifiers of the clas...read more
Yes, a singleton class is a class that can only have one instance created.
Ensure the constructor is private to prevent external instantiation.
Provide a static method to access the single instance.
Use a static variable to hold the single instance.
Example: class Singleton { private static Singleton instance = new Singleton(); private Singleton(){} public static Singleton getInstance() { return instance; }}
Q155. What is bfs , and solve given problem with it? What is copy constructer? Kubernetes? Docker? Socket? Tcp/up?
Answering questions related to bfs, copy constructor, Kubernetes, Docker, Socket, TCP/UP
BFS stands for Breadth First Search, a graph traversal algorithm
Copy constructor is a special constructor that creates a new object as a copy of an existing object
Kubernetes is an open-source container orchestration platform
Docker is a platform for developing, shipping, and running applications in containers
Socket is a software endpoint that establishes a bidirectional communication link b...read more
Q156. What is the difference between task & process ?
Q157. What tools did you use for DB server tuning?
I have used various tools for DB server tuning such as SQL Profiler, SQL Server Management Studio, and Database Engine Tuning Advisor.
SQL Profiler for monitoring and analyzing SQL Server activity
SQL Server Management Studio for managing and configuring SQL Server instances
Database Engine Tuning Advisor for analyzing workload and recommending index and partitioning strategies
Q158. int a=5; int *p=&a; ++(*p); what is the result of the above piece code?
The value of variable 'a' will be incremented by 1.
The variable 'a' is initialized with value 5.
A pointer 'p' is created and assigned the address of 'a'.
The value pointed by 'p' is incremented by 1 using prefix increment operator.
The final value of 'a' will be 6.
Q159. class A{ static int a; } How to initialise that?(static A:: int a=0;)
To initialize static variable a in class A, use static A::int a = 0;
Use the class name followed by the scope resolution operator(::)
Assign the value to the static variable
Initialization should be done outside the class definition
Q160. Explain the concept of virtual addressing and the allocation of virtual addresses during the execution of program
Virtual addressing is a memory management technique that allows a process to use a range of memory addresses independent of physical memory.
Virtual addresses are mapped to physical addresses by the memory management unit (MMU)
Virtual addresses are allocated to a process during its execution
Virtual addressing allows for efficient use of physical memory by allowing multiple processes to share the same physical memory
Examples of virtual addressing include paging and segmentation
Q161. What is web service and types of web services and advantage and disadvantage?
Web service is a software system designed to support interoperable machine-to-machine interaction over a network.
Types of web services: SOAP, REST, XML-RPC, JSON-RPC
Advantages: interoperability, platform independence, reusability, scalability
Disadvantages: security concerns, performance issues, complexity
Example: Amazon Web Services (AWS), Google Cloud Platform (GCP), Microsoft Azure
Q162. write code for fibonacci series nth term.... Implement strcat, strlen , strcpy without using predefined functions
Code for Fibonacci series nth term and implement strcat, strlen, strcpy without using predefined functions.
For Fibonacci series, use a loop to calculate the nth term by adding the previous two terms.
For strcat, use a loop to append the second string to the end of the first string.
For strlen, use a loop to count the number of characters in the string.
For strcpy, use a loop to copy each character from the source string to the destination string.
Q163. Can constant and volatile both be used at same time?
Yes, constant and volatile can be used together.
Constant variables are read-only and cannot be modified.
Volatile variables are used to indicate that the value may change unexpectedly.
Using both together can be useful in multi-threaded environments.
For example, a constant pointer to a volatile variable can be used to ensure thread safety.
Q164. What is the name full name of Ram?
Ram is a common name in India and can refer to many people. It is not possible to determine the full name of Ram without additional context.
Ram is a common first name in India
There are many people with the first name Ram, so the full name would depend on the individual
Some common full names for Ram include Ramakrishna, Ramachandra, and Ramakant
Q165. Difference between formula and a function
Formula is a mathematical expression while function is a pre-built formula that performs a specific task.
Formula is a combination of mathematical operators and values used to calculate a result.
Function is a pre-built formula that performs a specific task, such as finding the average of a range of numbers.
Formulas can be customized and modified, while functions are fixed and cannot be changed.
Examples of functions include SUM, AVERAGE, MAX, MIN, etc.
Q166. What is the real time operating system?
A real-time operating system is an OS that processes data and events as they occur, without delay.
Real-time operating systems are used in applications that require immediate response, such as aviation, medical equipment, and industrial control systems.
They prioritize tasks based on their urgency and importance, and can handle multiple tasks simultaneously.
Examples of real-time operating systems include VxWorks, QNX, and FreeRTOS.
Q167. what is the advantage and disadvantage of threads?(deadlock)
Threads provide concurrency but can lead to deadlocks.
Advantage: Allows for concurrent execution of multiple tasks.
Disadvantage: Can lead to deadlocks where two or more threads are blocked and unable to proceed.
Example: A web server handling multiple requests concurrently using threads.
Example: A program with multiple threads accessing shared resources without proper synchronization.
Example: A program with multiple threads waiting for each other to release a resource, causing...read more
Q168. Write a program to find the duplicate in the array(only one duplicate is present in the array)?
Program to find the only duplicate in an array
Create a hash set to store elements as they are encountered
If an element is already in the hash set, it is a duplicate
Return the duplicate element
Q169. Difference between monolithic and microservices architecture.
Monolithic architecture is a single, self-contained unit while microservices architecture is a collection of small, independent services.
Monolithic architecture is tightly coupled and difficult to scale.
Microservices architecture is loosely coupled and can be scaled independently.
Monolithic architecture has a single point of failure while microservices architecture is resilient to failures.
Monolithic architecture is easier to develop while microservices architecture is more c...read more
Q170. How many type of ges welding flame in used in welding?
Q171. How to respond on any incident happened?
The response to any incident should involve assessing the situation, notifying the appropriate authorities, documenting the incident, and providing any necessary assistance.
Assess the situation to determine the severity and nature of the incident
Notify the appropriate authorities, such as the police or emergency services
Document the incident by recording relevant details, including time, location, and any involved individuals
Provide any necessary assistance, such as guiding e...read more
Q172. 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
Q173. Difference between an embedded system and an IOT device??
Embedded systems are standalone devices with fixed functionality, while IoT devices are connected to the internet and can be remotely controlled.
Embedded systems are designed for specific tasks and have limited processing power and memory.
IoT devices are connected to the internet and can be controlled remotely through a network.
Embedded systems are often used in industrial and automotive applications, while IoT devices are used in smart homes, wearables, and other consumer ap...read more
Q174. What are the latest Samsung products and their new features?
The latest Samsung products include the Galaxy S21 series, Galaxy Buds Pro, and Galaxy Watch 3.
Galaxy S21 series: Features a powerful processor, improved camera system, and 5G connectivity.
Galaxy Buds Pro: Offers active noise cancellation, immersive sound quality, and touch controls.
Galaxy Watch 3: Provides advanced health monitoring, ECG tracking, and customizable watch faces.
Q175. 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
Q176. 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.
Q177. What steps would you take to observe the field if you were to visit it?
I would conduct thorough field observations by following a structured approach.
Create a checklist of key areas to observe such as customer interactions, employee performance, and store layout.
Interact with employees and customers to gather feedback and insights.
Review sales data and inventory levels to assess performance and identify areas for improvement.
Observe competitor activity and market trends to stay informed and competitive.
Document findings and create a report with ...read more
Q178. Why is a Base Station Controller (BSC) unnecessary in a 4G network?
A BSC is unnecessary in a 4G network because the functions of a BSC are integrated into the base station in 4G technology.
In 4G networks, the functions of a BSC are handled by the eNodeB (Evolved Node B), which combines the functionalities of both the BSC and the Node B in previous generations.
The eNodeB in a 4G network directly communicates with the core network, eliminating the need for a separate BSC.
This integration simplifies the network architecture, reduces latency, an...read more
Q179. What are the uplink and downlink speeds in a 4G network?
Uplink and downlink speeds in a 4G network typically range from 5-50 Mbps and 50-100 Mbps respectively.
Uplink speeds in a 4G network usually range from 5-50 Mbps
Downlink speeds in a 4G network typically range from 50-100 Mbps
Speeds can vary based on network congestion, location, and device capabilities
Q180. Given two polynomials as linked lists, return a linked list which represents the product of two polynomials
The function takes two polynomials represented as linked lists and returns a linked list representing their product.
Traverse both linked lists and multiply the corresponding coefficients of each term
Create a new linked list to store the product terms
Keep track of the current term in the product linked list and update it as you multiply
Handle cases where the product of coefficients is zero
Q181. Write the functions to create a stack and to delete a node from the stack
Functions to create and delete nodes in a stack
To create a stack, initialize a top pointer to null
To push a node, create a new node and set its next to the current top, then set top to the new node
To pop a node, set top to its next and return the popped node
To delete the stack, pop all nodes until top is null
A process in an operating system is an instance of a program that is being executed.
A process is a unit of execution within an operating system.
Each process has its own memory space, resources, and state.
Processes can communicate with each other through inter-process communication.
Examples of processes include web browsers, word processors, and media players.
Q183. Write a code for get alternate nodes from linked list
Q184. What are the basic role of JAVA in the development of software?
JAVA is a versatile programming language used for developing various software applications.
JAVA is platform-independent and can run on any operating system
It is object-oriented and supports multithreading
JAVA is widely used for developing web applications, mobile applications, and enterprise software
It provides a vast library of pre-built classes and APIs for developers to use
JAVA is also used for developing games, scientific applications, and financial applications
Q185. How do you find the middle of the linked list?
To find the middle of a linked list, use two pointers - one moving at twice the speed of the other.
Initialize two pointers - slow and fast
Move the slow pointer one step at a time and the fast pointer two steps at a time
When the fast pointer reaches the end of the list, the slow pointer will be at the middle
Q186. Is sale down what should we do to increase the sale ?
To increase sales, we need to analyze the market, identify customer needs, improve product quality, and implement effective marketing strategies.
Analyze the market to identify trends and competition
Identify customer needs and preferences
Improve product quality and features
Implement effective marketing strategies such as targeted advertising and promotions
Provide excellent customer service to retain existing customers and attract new ones
C++ supports polymorphism through virtual functions and inheritance.
C++ supports polymorphism through virtual functions and inheritance
Virtual functions allow a function to be overridden in a derived class
Base class pointers can point to derived class objects, allowing for dynamic binding
Example: class Animal { virtual void speak() { cout << 'Animal speaks'; } }; class Dog : public Animal { void speak() { cout << 'Dog barks'; } };
Example: Animal* a = new Dog(); a->speak(); //...read more
Q188. Time complexity of building a heap using linked list and arrays
Time complexity of building a heap using linked list and arrays
Building a heap using linked list takes O(nlogn) time complexity
Building a heap using arrays takes O(n) time complexity
Linked list implementation is slower than array implementation
Q189. Difference between DFS and BFS?When to use which one?
DFS and BFS are graph traversal algorithms. DFS explores as far as possible before backtracking. BFS explores level by level.
DFS stands for Depth First Search, while BFS stands for Breadth First Search.
DFS explores as far as possible along each branch before backtracking, while BFS explores level by level.
DFS uses a stack data structure, while BFS uses a queue data structure.
DFS is often used for solving problems like finding connected components, topological sorting, and sol...read more
Q190. What is deadlock? how to prevent deadlock?
Deadlock is a situation where two or more processes are unable to proceed because they are waiting for each other to release resources.
Prevent deadlock by using a proper resource allocation strategy
Avoid holding onto resources for too long
Use timeouts to release resources if they are not being used
Implement a deadlock detection and recovery mechanism
Avoid circular wait by imposing a total ordering of all resource types
Q191. Write a code & explain public protected & private variables
Q192. Different properties of OOPs ,examples of each, with application of each?
OOPs properties and examples with applications
Encapsulation: bundling of data and methods within a class. Example: Java class. Application: data hiding and security.
Inheritance: creating a new class from an existing class. Example: subclass. Application: code reusability and extensibility.
Polymorphism: ability of an object to take on many forms. Example: method overloading. Application: flexibility and modularity.
Abstraction: hiding implementation details and showing only nec...read more
Q193. What is deffrent between suction and discharge line
The suction line carries low-pressure refrigerant vapor from the evaporator to the compressor, while the discharge line carries high-pressure refrigerant vapor from the compressor to the condenser.
The suction line is larger in diameter compared to the discharge line.
The suction line carries refrigerant vapor at low pressure and low temperature.
The discharge line carries refrigerant vapor at high pressure and high temperature.
The suction line connects the evaporator outlet to ...read more
Q194. 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++
Q195. What type of OS is Windows?
Windows is a proprietary operating system developed by Microsoft.
Windows is a graphical user interface (GUI) based operating system.
It is designed to run on personal computers, servers, and mobile devices.
Windows has different versions such as Windows 10, Windows 8, Windows 7, etc.
It supports a wide range of software applications and hardware devices.
Windows is known for its ease of use and user-friendly interface.
Q196. Difference between an FIR and IIR filter??
FIR filters have finite impulse response while IIR filters have infinite impulse response.
FIR filters have a linear phase response while IIR filters do not necessarily have a linear phase response.
FIR filters are always stable while IIR filters may not be stable depending on the coefficients used.
FIR filters have a fixed number of coefficients while IIR filters have a variable number of coefficients.
Examples of FIR filters include moving average filters and low-pass filters w...read more
Q197. What is constant int pointer and pointer to constant integer.
Constant int pointer points to a memory location whose value cannot be changed. Pointer to constant integer points to a memory location whose value cannot be changed through the pointer.
Constant int pointer: int *const ptr = #
Pointer to constant integer: const int *ptr = #
Constant int pointer can be initialized but cannot be reassigned.
Pointer to constant integer can be reassigned but cannot change the value of the integer.
Q198. 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
Friend functions in C++ are functions that are not members of a class but have access to its private and protected members.
Friend functions are declared inside a class with the keyword 'friend'.
They can access private and protected members of the class.
They are not member functions of the class, but have the same access rights as member functions.
Friend functions are useful for implementing operators that are not part of the class.
Example: friend int add(const MyClass& obj1, ...read more
Thrashing in operating systems occurs when the system is spending more time swapping data between memory and disk than actually executing tasks.
Occurs when the system is constantly swapping data between memory and disk
Causes a decrease in system performance as it spends more time on swapping than executing tasks
Usually happens when the system does not have enough physical memory to handle the workload efficiently
More about working at Samsung







Top HR Questions asked in Samsung
Interview Process at Samsung

Top Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

