# Hexaware Core CS Questions with Answers

8 previously-asked core cs 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. Which data structure allows insertion and deletion at both ends?

A. Stack
B. Queue
C. Deque
D. Array

**Answer:** Deque

**Explanation:** A double ended queue (deque) supports adding and removing elements at both the front and the rear.

### 2. What is the time complexity of merge sort in the worst case?

A. O(n^2)
B. O(n log n)
C. O(n)
D. O(log n)

**Answer:** O(n log n)

**Explanation:** Merge sort always divides and merges in O(n log n), including the worst case.

### 3. A candidate key that is not selected as the primary key is called?

A. Foreign key
B. Alternate key
C. Super key
D. Composite key

**Answer:** Alternate key

**Explanation:** Any candidate key not chosen as the primary key is called an alternate key.

### 4. Which OOP principle hides internal implementation and exposes only functionality?

A. Abstraction
B. Inheritance
C. Polymorphism
D. Overloading

**Answer:** Abstraction

**Explanation:** Abstraction exposes essential features while hiding implementation details.

### 5. The total time from process submission to its completion is called?

A. Waiting time
B. Turnaround time
C. Response time
D. Burst time

**Answer:** Turnaround time

**Explanation:** Turnaround time is the interval from submission to completion of a process.

### 6. Which network device operates primarily at the data link layer?

A. Hub
B. Switch
C. Router
D. Repeater

**Answer:** Switch

**Explanation:** A switch forwards frames using MAC addresses at the data link layer (Layer 2).

### 7. In old C, if a function does not specify a return type, what is assumed?

A. int
B. void
C. float
D. char

**Answer:** int

**Explanation:** Historically C assumed an implicit return type of int when none was specified.

### 8. Which SQL keyword removes duplicate rows from a query result?

A. UNIQUE
B. DISTINCT
C. DIFFERENT
D. REMOVE

**Answer:** DISTINCT

**Explanation:** SELECT DISTINCT returns only unique rows in the result set.

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