Automotive Robotics (India)
T.khan Logistic Interview Questions and Answers
Q1. What is the concept of virtual inheritance in relation to vtables and vptrs in object-oriented programming?
Virtual inheritance allows a derived class to inherit from a base class without creating duplicate base class subobjects.
Virtual inheritance is used to resolve the Diamond Problem in C++ where a class inherits from two classes that have a common base class.
It ensures that only one copy of the base class is inherited by the derived class.
Virtual inheritance introduces a virtual base class subobject to the derived class, which is shared among all the classes that inherit from i...read more
Q2. What is the implementation of a class for string operations?
A class for string operations can include methods for concatenation, substring extraction, length calculation, etc.
Create a class with methods like concatenateStrings, extractSubstring, calculateLength, etc.
Use string manipulation functions like substring, concat, length, etc. within the class methods.
Ensure error handling for edge cases like empty strings or out-of-bounds indices.
Example: class StringOperations { concatenateStrings(str1, str2) { return str1.concat(str2); } }
Q3. Difference between copy constructor and assignment operator
Copy constructor is used to create a new object as a copy of an existing object, while assignment operator is used to assign values from one object to another.
Copy constructor is called when a new object is created from an existing object, while assignment operator is called when an existing object is assigned values from another object.
Copy constructor creates a new object with its own memory space, while assignment operator assigns values to an existing object's memory spac...read more
Q4. What is single ton design pattern
Singleton design pattern ensures a class has only one instance and provides a global point of access to it.
Ensures a class has only one instance
Provides a global point of access to that instance
Commonly used in scenarios where only one instance of a class is needed, such as database connections or logging
Q5. What is copy constructor?
Copy constructor is a special type of constructor which creates a new object as a copy of an existing object.
Copy constructor is used to initialize a new object as a copy of an existing object.
It takes an object of the same class as a parameter.
It is called automatically when a new object is created from an existing object.
Example: class MyClass { public: MyClass(const MyClass& obj) { // copy constructor logic } };
Q6. What is static function
A static function is a function that is associated with a class rather than an instance of the class.
Static functions can be called without creating an instance of the class.
Static functions are commonly used for utility functions that do not require access to instance-specific data.
Static functions are declared using the 'static' keyword in many programming languages.
Example: 'Math.max()' in JavaScript is a static function.
Q7. Write Fibonacci series
Fibonacci series is a sequence of numbers where each number is the sum of the two preceding ones.
Start with 0 and 1 as the first two numbers in the series
Add the previous two numbers to get the next number in the series
Repeat this process to generate the Fibonacci series
More about working at Automotive Robotics (India)
Interview Process at T.khan Logistic
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month