nCircle Tech
10+ Einfochips Interview Questions and Answers
Q1. What's Shallow copy and deep copy? How can you make deep copy?
Shallow copy creates a new object with the same reference as the original, while deep copy creates a new object with a new reference.
Shallow copy only copies the reference of the original object, while deep copy creates a new object with a new reference and copies the values of the original object.
In Python, shallow copy can be made using the copy() method, while deep copy can be made using the deepcopy() method from the copy module.
Example of shallow copy: list2 = list1 (bot...read more
Q2. Write program to reverse string without extra space Now convert it into recursion
Program to reverse string without extra space using recursion
Use a recursive function to swap the first and last characters of the string
Recursively call the function on the remaining substring
Base case: when the string length is 0 or 1, return the string itself
Q3. Difference between reference and pointer. L-value and R-value
Reference is an alias to an existing variable while pointer is a variable that stores the memory address of another variable.
References cannot be null while pointers can be null
References cannot be re-assigned while pointers can be re-assigned
L-value refers to the memory location of a variable while R-value refers to the value stored in that memory location
Q4. Which containers have you used in STL?
I have used vector, deque, list, stack, queue, and priority_queue containers in STL.
Vector is used for dynamic arrays.
Deque is used for double-ended queues.
List is used for doubly linked lists.
Stack is used for LIFO data structure.
Queue is used for FIFO data structure.
Priority_queue is used for priority queues.
Q5. What's Copy Constructor
Copy constructor is a special constructor that creates a new object by copying an existing object.
It is used to create a new object with the same values as an existing object.
It takes an object of the same class as a parameter.
It is used to avoid shallow copy issues.
Example: MyClass(const MyClass& obj) { //copy constructor code }
Q6. What is matrix multiplication and how to do it ?
Matrix multiplication is a mathematical operation that combines two matrices to produce a third matrix.
Matrix multiplication involves multiplying the rows of the first matrix by the columns of the second matrix.
The number of columns in the first matrix must equal the number of rows in the second matrix.
The resulting matrix will have the same number of rows as the first matrix and the same number of columns as the second matrix.
Q7. What's function overriding
Function overriding is a feature in object-oriented programming where a subclass provides a different implementation of a method that is already defined in its superclass.
It allows a subclass to provide its own implementation of a method that is already defined in its superclass.
The method in the subclass must have the same name, return type, and parameters as the method in the superclass.
The method in the subclass can have a different implementation than the method in the su...read more
Q8. Explain Basic OOP's Pillers
OOP's pillars are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hiding implementation details and showing only necessary information.
Encapsulation: Binding data and functions together and restricting access to them.
Inheritance: Creating new classes from existing ones, inheriting properties and methods.
Polymorphism: Ability of objects to take on many forms and perform different actions based on context.
Q9. Write a program to create Fibonacci sequence pyramid
Program to create Fibonacci sequence pyramid
Start by defining the number of rows for the pyramid
Use nested loops to generate Fibonacci numbers for each row
Print the Fibonacci numbers in pyramid format
Q10. What is vector? How to use it ?
A vector is a dynamic array that can resize itself automatically when elements are added or removed.
Vectors are part of the C++ Standard Template Library (STL).
They provide similar functionality to arrays but with additional features like automatic resizing.
Vectors can be accessed using index notation and have methods for adding, removing, and accessing elements.
Example: vector
numbers = {1, 2, 3}; numbers.push_back(4); int thirdElement = numbers[2];
Q11. Is JavaScript asynchronous language?
Yes, JavaScript is an asynchronous language.
JavaScript uses callbacks and promises to handle asynchronous operations.
Asynchronous functions allow other code to run while waiting for a response.
Example: setTimeout() function in JavaScript is asynchronous.
Q12. How to project point on line ?
To project a point on a line, calculate the perpendicular distance from the point to the line and find the point on the line that is closest to the given point.
Calculate the slope of the line
Find the equation of the line
Calculate the perpendicular distance from the point to the line using the formula |Ax + By + C| / sqrt(A^2 + B^2)
Find the point on the line that is closest to the given point by moving along the perpendicular line
Q13. what is STLC,defect life cycle
STLC stands for Software Testing Life Cycle, which is a series of steps performed to ensure the quality of a software product. Defect life cycle refers to the stages a defect goes through from identification to resolution.
STLC involves phases like requirement analysis, test planning, test design, test execution, and test closure.
Defect life cycle includes stages like New, Assigned, Open, Fixed, Retest, Reopen, and Closed.
STLC focuses on preventing defects, while defect life c...read more
Q14. binary search time complexity
Binary search has a time complexity of O(log n).
Binary search is a divide and conquer algorithm.
It works by repeatedly dividing the search space in half.
The time complexity is logarithmic because each comparison reduces the search space by half.
It is efficient for sorted arrays or lists.
Top HR Questions asked in Einfochips
Interview Process at Einfochips
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month