Hughes Systique Corporation
10+ KHY ELECTRONIC Interview Questions and Answers
Q1. Given 9 ball all of which weigh the same except for one, what is the minimum of weighings necessary to find the ball weighs more (or less)?
The minimum number of weighings necessary is 2.
Divide the 9 balls into 3 groups of 3.
Weigh any two groups against each other.
If the two groups weigh the same, the heavier ball is in the third group.
If one group is heavier, the heavier ball is in that group.
Take the heavier group and weigh any two balls against each other.
If they weigh the same, the heavier ball is the remaining one.
If one ball is heavier, it is the heavier ball.
Q2. If a rival company tries to use your code against us what will you do?
I will ensure that our code is properly protected by implementing security measures and legal actions if necessary.
Implement security measures such as encryption and access control to prevent unauthorized access to our code.
Monitor for any suspicious activity and take immediate action if any unauthorized access is detected.
If necessary, take legal action against the rival company for intellectual property theft.
Collaborate with legal and management teams to ensure that our co...read more
Q3. 2. Difference between Linked List and Tree (where what should be used).
Linked list is a linear data structure while tree is a hierarchical data structure.
Linked list is used when we need to maintain a sequence of elements and perform operations like insertion and deletion at any position.
Tree is used when we need to represent a hierarchical structure and perform operations like searching, insertion, and deletion efficiently.
Linked list has a single pointer to the next node while tree has multiple pointers to its child nodes.
Linked list has a lin...read more
Q4. 4. An array and 2 variables x and y are given, print y sub arrays with x elements.
Print y sub arrays with x elements from given array and variables.
Use a loop to iterate through the array and create subarrays of x elements.
Use another loop to print y number of subarrays.
Handle edge cases where x or y is greater than the length of the array.
Q5. 2. Find the first non repeating character in a string
Find the first non-repeating character in a string.
Create a hash table to store the frequency of each character in the string.
Iterate through the string and check the frequency of each character.
Return the first character with a frequency of 1.
Q6. 1. Explain Trees and Binary Search Trees.
Trees are data structures that store hierarchical data. Binary Search Trees are a type of tree that maintains sorted order.
Trees are composed of nodes that have a parent-child relationship.
Binary Search Trees have at most two children per node and the left child is always smaller than the parent while the right child is always larger.
Binary Search Trees allow for efficient searching, insertion, and deletion operations.
Examples of Binary Search Trees include AVL Trees and Red-...read more
Q7. 3. Remove duplicates from an array
Remove duplicates from an array of strings
Create a new empty array
Loop through the original array and check if the element already exists in the new array
If not, add it to the new array
Return the new array
Q8. 3. A real-life example of Tree.
A family tree is a real-life example of a tree data structure.
A family tree has a root node (the oldest ancestor) and branches out to children, grandchildren, etc.
Each node can have multiple child nodes but only one parent node.
The tree structure allows for easy visualization of relationships and ancestry.
Other examples include file systems, organization charts, and decision trees.
Q9. 9. What are Abstract classes
Abstract classes are classes that cannot be instantiated and are meant to be extended by other classes.
Abstract classes are declared using the 'abstract' keyword.
They can have abstract and non-abstract methods.
Abstract methods are declared without a body and must be implemented by the subclass.
Abstract classes can have constructors and instance variables.
They are useful for creating a common interface for a group of related classes.
Q10. 5. Explain the function pointer.
A function pointer is a variable that stores the memory address of a function.
Function pointers allow passing functions as arguments to other functions.
They can be used to implement callbacks and event handlers.
Function pointers can be used to implement polymorphism in C.
Example: int (*funcPtr)(int, int) = &add; where add is a function that takes two integers and returns their sum.
Function pointers can also be used to create function tables and switch statements.
Q11. 8. Characteristics of static function
Static functions belong to the class and not to the instance of the class.
Can be called without creating an instance of the class
Cannot access non-static members of the class
Can access other static members of the class
Used for utility functions or helper functions
Q12. 6. Explain copy constructor
Copy constructor creates a new object by copying an existing object.
Used to initialize an object with another object of the same class
Takes a reference to an object of the same class as a parameter
Creates a new object with the same values as the parameter object
Deep copy and shallow copy are two types of copy constructors
Top HR Questions asked in KHY ELECTRONIC
Top Backend Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month