# Hexaware Interview Questions with Answers

8 previously-asked interview questions from Hexaware's hiring process, each with the correct answer and a worked explanation. Written against the company's actual test pattern.

_Source: Astra (https://useastra.in). Updated 2026-09-05._

### 1. What is the difference between stack and heap memory?

**Answer:** Stack memory stores function call frames and local variables, is managed automatically (LIFO), and is fast but limited. Heap memory is used for dynamic allocation, is managed manually or by a garbage collector, is larger but slower, and can fragment.

**Explanation:** Stack: automatic, LIFO, fast. Heap: dynamic, manual, larger.

### 2. What is a pointer, and what is a null pointer?

**Answer:** A pointer is a variable holding a memory address. A null pointer points to no valid location (address 0) and is used to indicate the absence of a target; dereferencing it causes undefined behaviour, so always check before use.

**Explanation:** Pointer holds an address; a null pointer points to nothing.

### 3. What is the difference between a primary key and a foreign key?

**Answer:** A primary key uniquely identifies each row in its own table and cannot be null. A foreign key is a column that references the primary key of another table to enforce referential integrity, and it can repeat and be null.

**Explanation:** Primary key identifies rows; foreign key links to another table.

### 4. Explain the four pillars of object oriented programming.

**Answer:** Encapsulation binds data with methods and restricts access. Inheritance lets a class reuse another class members. Polymorphism allows one interface with many forms. Abstraction hides implementation and exposes only essentials.

**Explanation:** Encapsulation, inheritance, polymorphism, abstraction.

### 5. What is multithreading and why is it useful?

**Answer:** Multithreading runs multiple threads within a process concurrently, sharing memory. It improves responsiveness and utilises multi-core CPUs, but requires synchronization to avoid race conditions and deadlocks.

**Explanation:** Concurrent threads in a process; needs synchronization.

### 6. What is a virtual function in C++?

**Answer:** A virtual function is a member function declared in a base class and overridden in a derived class, resolved at runtime through the vtable. It enables runtime polymorphism so the correct override runs based on the actual object type.

**Explanation:** Enables runtime polymorphism via overriding and the vtable.

### 7. Tell me about yourself.

**Answer:** Give a focused 60 to 90 second overview: your degree, strongest skills, a project or internship with a concrete result, and why you are interested in Hexaware. Keep it structured and relevant.

**Explanation:** Structured pitch: background, skills, project, fit.

### 8. Why do you want to join Hexaware?

**Answer:** Mention Hexaware focus on automation, cloud, and digital services, its structured GET or PGET training, and the exposure to real client projects. Tie it to your goal of building strong fundamentals early.

**Explanation:** Automation and cloud focus, training, exposure; be specific.

More Hexaware preparation, including the full recruitment process: https://useastra.in/campus/hexaware
