Neilsoft
VIBS Infosol Private Limited Interview Questions and Answers
Q1. Given point and circle how to find if point is inside circle or outside circle
To determine if a point is inside or outside a circle, calculate the distance between the point and the center of the circle.
Calculate the distance between the point and the center of the circle using the distance formula: sqrt((x2 - x1)^2 + (y2 - y1)^2)
If the distance is less than the radius of the circle, the point is inside the circle. If it is equal to the radius, the point is on the circle. Otherwise, it is outside the circle.
Q2. How to find resultant of two vectors in terms of magnitude and direction
The resultant of two vectors can be found by adding the magnitudes and finding the direction using trigonometry.
To find the magnitude of the resultant, use the Pythagorean theorem: magnitude = sqrt(a^2 + b^2)
To find the direction of the resultant, use trigonometry: direction = atan(b/a)
If the vectors are given in terms of their components, add the corresponding components to find the resultant
Q3. Given three points how to check if they are colinear
To check if three points are colinear, calculate the slope between each pair of points and compare them.
Calculate the slope between the first two points using the formula: slope = (y2 - y1) / (x2 - x1)
Calculate the slope between the second and third points using the same formula
If the slopes between all pairs of points are equal, then the points are colinear
Q4. What's copy constructor. Why it's passed by reference Why copy constructor can not be void
A copy constructor is a special constructor that creates a new object by copying the values of another object.
Copy constructor is used to create a new object with the same values as an existing object.
It is passed by reference to avoid unnecessary object copying, which can be expensive.
Copy constructor cannot be void because it needs to return the newly created object.
Q5. Can child class point points to base class?
Yes, a child class can point to a base class.
In object-oriented programming, a child class can inherit from a base class and use its methods and properties.
A child class can also override the methods of the base class to provide its own implementation.
Polymorphism allows a child class object to be treated as a base class object, enabling it to point to the base class.
This is useful for code reusability and creating a hierarchy of classes.
Q6. Difference in array and linked list
Array is a contiguous block of memory, while linked list is a collection of nodes connected by pointers.
Array has constant time access to elements, while linked list requires traversing the list.
Array has fixed size, while linked list can dynamically grow or shrink.
Insertion and deletion in array is expensive, while linked list can easily insert or delete nodes.
Array is suitable for random access, while linked list is efficient for sequential access.
Q7. explain Basics OOP Pillars
The basics of OOP (Object-Oriented Programming) pillars are encapsulation, inheritance, and polymorphism.
Encapsulation: Bundling data and methods together in a class to hide implementation details.
Inheritance: Creating new classes from existing ones, inheriting their properties and behaviors.
Polymorphism: Objects of different classes can be treated as objects of a common superclass, allowing flexibility and extensibility.
Interview Process at VIBS Infosol Private Limited
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month