# Zoho Core CS Questions with Answers

8 previously-asked core cs questions from Zoho'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 value of the expression 10 % 3 in C?

A. 1
B. 3
C. 0
D. 10

**Answer:** 1

**Explanation:** The modulo operator returns the remainder of 10 divided by 3, which is 1.

### 2. Which loop is guaranteed to execute its body at least once?

A. for
B. while
C. do-while
D. foreach

**Answer:** do-while

**Explanation:** A do-while loop checks the condition after the body, so it always runs at least once.

### 3. Which operator has higher precedence in an arithmetic expression?

A. *
B. +
C. both equal
D. depends on compiler

**Answer:** *

**Explanation:** Multiplication has higher precedence than addition and is evaluated first.

### 4. Which data structure is best suited to implement a priority queue?

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

**Answer:** Heap

**Explanation:** A binary heap gives efficient O(log n) insertion and extraction of the highest or lowest priority element.

### 5. What happens if a recursive function has no base case?

A. Stack overflow
B. Compile error
C. It returns 0
D. It runs once

**Answer:** Stack overflow

**Explanation:** Without a base case the recursion never stops, exhausting the call stack and causing a stack overflow.

### 6. In C, how do you effectively pass a variable by reference?

A. Pass a pointer to it
B. Pass it by value
C. Pass a copy
D. Pass a literal

**Answer:** Pass a pointer to it

**Explanation:** C passes arguments by value, so you pass a pointer (address) to let a function modify the original.

### 7. What is the time complexity of two nested loops that each run n times?

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

**Answer:** O(n^2)

**Explanation:** Each of the n outer iterations runs n inner iterations, giving n times n = O(n^2).

### 8. In Java, the String class is?

A. immutable
B. mutable
C. a primitive
D. dynamically sized

**Answer:** immutable

**Explanation:** Java String objects cannot be changed after creation; operations produce new strings.

More Zoho preparation, including the full recruitment process: https://useastra.in/campus/zoho
