Valeo
Ambey Mining Interview Questions and Answers
Q1. Write a program to print Fibonacci series using recursion
A program to print Fibonacci series using recursion.
Define a recursive function that takes an integer n as input
Base case: if n is 0 or 1, return n
Recursive case: return the sum of the previous two Fibonacci numbers
Call the recursive function with the desired number of terms and print the result
Q2. Difference between structure and union?
Structure is a collection of variables of different data types while union is a collection of variables of same data type.
Structure allocates memory for all its variables while union allocates memory for only one variable at a time.
Structure is used when we want to store different types of data while union is used when we want to store only one type of data.
Structure is accessed using dot operator while union is accessed using arrow operator.
Example of structure: struct stude...read more
Q3. How to avoid dangling pointers?
Dangling pointers can be avoided by setting them to NULL after freeing the memory they point to.
Always initialize pointers to NULL.
Set pointers to NULL after freeing the memory they point to.
Avoid accessing memory through a pointer after it has been freed.
Use smart pointers or garbage collection to automate memory management.
Q4. diff b/w c and embedded c
Embedded C is a subset of the C programming language, specifically designed for programming embedded systems.
Embedded C is optimized for resource-constrained systems with limited memory and processing power.
It includes additional keywords and features for controlling hardware directly.
Embedded C often involves working with microcontrollers, sensors, and other hardware components.
Regular C can be used for general-purpose programming on desktop or server systems.
Q5. What is virtual function
A virtual function is a function in a base class that is declared using the keyword 'virtual' and can be overridden by a function with the same signature in a derived class.
Virtual functions allow for dynamic polymorphism in object-oriented programming.
They are used to achieve runtime polymorphism by allowing a function to be called based on the type of object it is called on.
Virtual functions are declared in a base class and can be overridden in derived classes to provide sp...read more
Q6. diff b/w structure and union
Structure is a collection of variables of different data types while union is a collection of variables of same data type.
Structure allocates memory for all its variables while union allocates memory for only one variable at a time.
Structure is used when we want to store different types of data while union is used when we want to store only one type of data.
Structure is accessed using dot operator while union is accessed using arrow operator.
Example of structure: struct stude...read more
Q7. What is polymorphism
Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
It enables a single interface to be used for different data types or classes.
Examples include method overloading and method overriding in object-oriented programming.
Interview Process at Ambey Mining
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month