UBS
10+ Atman Technologies Interview Questions and Answers
Q1. Convert Min Heap to Max Heap Problem Statement
Given an array representation of a min-heap of size 'n', your task is to convert this array into a max-heap.
Input:
The first line of input contains an integer ‘T’...read more
Convert a given min-heap array into a max-heap array.
Iterate through the given min-heap array and build a max-heap array by swapping elements.
Start from the last non-leaf node and heapify down to maintain the max-heap property.
Ensure that the output array satisfies the max-heap property.
Example: For min-heap [1,2,3,6,7,8], the max-heap would be [8,7,3,6,2,1].
Q2. What is a dangling pointer? What if we try to dereference it?
A dangling pointer is a pointer that points to a memory location that has been deallocated or freed. Dereferencing it can cause a program to crash.
Dangling pointers occur when memory is freed or deallocated, but the pointer still points to that memory location.
Dereferencing a dangling pointer can cause a segmentation fault or access violation.
Dangling pointers can be avoided by setting the pointer to NULL after freeing the memory it points to.
Q3. How is runtime polymorphism implemented?How does the compiler understand this?
Runtime polymorphism is implemented through virtual functions and dynamic binding.
Virtual functions are declared in base class and overridden in derived class
Dynamic binding is used to determine which function to call at runtime
Compiler uses virtual function table to understand runtime polymorphism
Types of polymorphism in OOP include compile-time polymorphism (method overloading) and runtime polymorphism (method overriding).
Compile-time polymorphism: achieved through method overloading, where multiple methods have the same name but different parameters.
Runtime polymorphism: achieved through method overriding, where a subclass provides a specific implementation of a method defined in its superclass.
Example: Compile-time polymorphism - having multiple calculateArea metho...read more
Q5. difference between function overloading and overriding
Function overloading is having multiple functions with the same name but different parameters. Function overriding is having a derived class implement a method with the same name and parameters as a method in the base class.
Function overloading is a compile-time polymorphism concept.
Function overriding is a run-time polymorphism concept.
Function overloading is used to provide different ways of calling the same function.
Function overriding is used to provide a specific impleme...read more
A dangling pointer in C is a pointer that points to a memory location that has been deallocated, leading to potential crashes or undefined behavior.
Dangling pointers occur when memory is deallocated but the pointer is not updated or set to NULL.
Accessing a dangling pointer can result in reading or writing to invalid memory locations.
Example: int *ptr = malloc(sizeof(int)); free(ptr); *ptr = 10; // Accessing a dangling pointer.
Q7. What is a NULL pointer
A NULL pointer is a pointer that does not point to any memory location.
It is represented by the value 0 or NULL.
Dereferencing a NULL pointer results in a segmentation fault.
It is commonly used to indicate the end of a linked list or array.
Q8. What is virtual function
A virtual function is a function in a base class that is overridden in a derived class.
Virtual functions allow polymorphism in C++
They are declared using the virtual keyword
The function is resolved at runtime based on the object type
Virtual functions can be pure virtual, meaning they have no implementation in the base class
Example: virtual void print() = 0; // pure virtual function
Q9. how function overloading works
Function overloading allows multiple functions with the same name but different parameters.
Functions with the same name but different parameters can be defined in the same scope
The compiler determines which function to call based on the number and types of arguments passed
Overloading can improve code readability and reduce the need for multiple function names
Example: void print(int x), void print(float x), void print(char x)
Example: int sum(int a, int b), float sum(float a, f...read more
Q10. What is equity,derivative etc
Equity refers to ownership in a company, while derivatives are financial contracts based on the value of an underlying asset.
Equity represents ownership in a company and can be in the form of stocks or shares.
Derivatives are financial contracts that derive their value from an underlying asset such as stocks, bonds, or commodities.
Examples of derivatives include futures, options, and swaps.
Derivatives are often used for hedging or speculation purposes.
Both equity and derivativ...read more
Q11. Scenarios for a manager to handle
Managers may face various scenarios in their work. Here are some pointers to handle them.
Identify the problem and its root cause
Develop a plan of action
Communicate effectively with team members
Delegate tasks appropriately
Monitor progress and adjust plan as needed
Provide feedback and recognition
Handle conflicts and difficult conversations
Stay organized and prioritize tasks
Function overloading is when multiple functions have the same name but different parameters or return types.
Function overloading allows multiple functions with the same name to be defined in a class or namespace.
The functions must have different parameters or return types to be considered overloaded.
Example: void print(int num) and void print(string text) are overloaded functions with the same name 'print'.
A virtual function is a function in a base class that is declared using the keyword 'virtual' and can be overridden by a function in a derived class.
Virtual functions allow for dynamic polymorphism in object-oriented programming.
They are used to achieve runtime binding and enable the implementation of the concept of function overriding.
Virtual functions are typically used in inheritance hierarchies to provide a common interface for derived classes.
Example: virtual void displa...read more
Templates in C++ are a feature that allows for generic programming by creating reusable code.
Templates allow for writing generic functions or classes that can work with any data type.
Templates are defined using the 'template' keyword followed by the template parameter list.
Example: template <class T> T add(T a, T b) { return a + b; }
Q15. What is a V-table?
A V-table is a virtual table used in programming languages to implement polymorphism.
It is used in object-oriented programming languages like C++ and Java.
It contains pointers to functions that can be overridden by derived classes.
It allows objects of different classes to be treated as if they are of the same class.
It is used to implement dynamic binding or late binding.
It is also known as a virtual function table or dispatch table.
Q16. What is polymrphism
Polymorphism is the ability of an object to take on many forms.
Polymorphism allows objects of different classes to be treated as if they are of the same class.
It is achieved through method overriding and method overloading.
Examples include method overriding in inheritance and implementing interfaces in Java.
Polymorphism helps in achieving loose coupling and flexibility in code design.
Q17. What are templates
Templates are pre-designed documents or files that serve as a starting point for creating new documents or files.
Templates can be used for various purposes such as creating resumes, business cards, invoices, and presentations.
They save time and effort by providing a pre-designed layout and structure.
Templates can be customized to fit specific needs and preferences.
They are commonly used in software applications like Microsoft Word, PowerPoint, and Excel.
Templates can also be ...read more
Top HR Questions asked in Atman Technologies
Top Business Technology Analyst Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month