0% found this document useful (0 votes)
19 views3 pages

C++ Interview Notes for Mechanical Engineer

The interview notes detail a candidate with a mechanical engineering background seeking a position in the IT sector, motivated by the opportunity for technological advancement. The candidate demonstrated strong technical skills in C++, covering key concepts such as classes, polymorphism, and access specifiers, and performed well overall. Feedback indicated enthusiasm and a clear project explanation, with suggestions for further practice on specific topics.

Uploaded by

amankrc2025
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

C++ Interview Notes for Mechanical Engineer

The interview notes detail a candidate with a mechanical engineering background seeking a position in the IT sector, motivated by the opportunity for technological advancement. The candidate demonstrated strong technical skills in C++, covering key concepts such as classes, polymorphism, and access specifiers, and performed well overall. Feedback indicated enthusiasm and a clear project explanation, with suggestions for further practice on specific topics.

Uploaded by

amankrc2025
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

### Interview Notes - August 13, 2025, 08:41 PM IST

#### Candidate Introduction


- **Name:** Not explicitly stated.
- **Background:** Mechanical engineering.
- **University:** Razigan University of Knowledge and Technology.
- **Personality:** Previous, technical radiation draggers, my sensor, self-
motivated, adaptable, hard-working, workaholic (weakness: can't relax until work is
done).
- **Hobbies:** Painting (abstract and portrait), drawing, puzzle solving.
- **Family:** Five members (candidate, brother, and parents).
- **Short-Term Goal:** Get placed in a reputed organization with a great
environment for upskilling and knowledge exploration.
- **Reason for Choosing IT Sector:** Interested in a developing sector bringing new
technology to improve human life, despite opportunities in mechanical engineering.

#### Projects and Internship


- **Major Project:** Power Generation Using Speed Breakers
- Used rack and pinion, sprinkler, and gear mechanisms to convert vehicle-
dissipated energy at speed bumps into electrical energy.
- Stored energy in batteries for street lights and vehicles.
- **Internship:** Mentioned but not detailed.

#### Technical Round - C++ Questions and Answers


1. **Difference between C and C++**
- C: Simple language with functions (e.g., `printf("Hello");`).
- C++: Object-oriented, supports classes and objects (e.g., `class Car { };`).

2. **Definition of Class and Object in C++**


- Class: User-defined data type with members and functions.
- Object: Instance of a class.
- Example: Class = "Car", Objects = "Toyota", "Honda".

3. **Difference between Structure and Class**


- Structure: Default access is public, memory allocation is stack, value type.
- Class: Default access is private, memory allocation is heap, reference type.

4. **What is Polymorphism?**
- Same entity behaves differently in different scenarios.
- Example: "+" used for addition (e.g., `2 + 3`) or concatenation (e.g., `"a" +
"b"`).

5. **What is a Virtual Function in C++?**


- A function in a base class redefined in a derived class for polymorphism,
declared with `virtual` keyword.

6. **What do you know about Friend Class and Friend Function?**


- Friend Class: Accesses private/protected members when declared with `friend`
keyword.
- Friend Function: External function with special access to class members, not a
class member.

7. **Define Runtime Polymorphism and Compile-Time Polymorphism**


- Compile-Time (Static/Early Binding): Function calls resolved by compiler.
- Runtime (Dynamic/Late Binding): Function calls resolved at runtime.

8. **What are C++ Access Specifiers?**


- Public: Accessible outside class.
- Private: Not accessible outside class.
- Protected: Not accessible outside class but accessible in inherited classes.

9. **What is an Inline Function in C++?**


- Enhances execution time and performance by copying code where called.
- Advantage: Usable in C++ classes.

10. **What is Abstraction?**


- Hiding data to show only essential details.

11. **What is Inheritance?**


- Reusing and extending existing classes to create hierarchical relationships.

12. **What is a Destructor in C++?**


- A function called when an object goes out of scope or is deleted to free
resources.
- Symbol: `~` (e.g., `~Car()`).
- Destructor Overloading: Not possible.

13. **Program for Default Constructor**


- Code:
```cpp
#include <iostream>
using namespace std;

class Demo {
public:
int num1, num2;
Demo() { // Default Constructor
num1 = 20;
num2 = 30;
}
void display() {
cout << "num1 = " << num1 << " and num2 = " << num2 << endl;
}
};

int main() {
Demo obj; // Object creation
[Link](); // Output: num1 = 20 and num2 = 30
return 0;
}
```
- Definition: Constructor with no parameters, takes defaults.

14. **What are Static Members and Static Member Functions?**


- Static Members: Shared among all objects, not unique to each.
- Static Member Functions: Can only access static members, called without
objects.

#### Interview Outcome


- **Performance Feedback:** Good communication, strong technical skills, overall
good performance.
- **Next Steps:** HR will contact for further information.
- **Candidate’s Request:** Seeks a platform, opportunities for learning/challenges,
and a start date in December.
- **Questions for Interviewer:** None asked.

---
**Notes:** Candidate showed enthusiasm and technical knowledge, especially in C++.
Project explanation was clear but could be more detailed. Practice destructor
programs and revisit access specifiers for clarity.

You might also like