# Intuit Core CS Questions with Answers

8 previously-asked core cs questions from Intuit'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 average time complexity of quicksort?

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

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

**Explanation:** On average quicksort partitions evenly, giving O(n log n); the worst case is O(n^2).

### 2. Which combination of data structures is typically used to implement an LRU cache in O(1)?

A. Hash map plus doubly linked list
B. Only an array
C. Only a stack
D. A binary tree only

**Answer:** Hash map plus doubly linked list

**Explanation:** A hash map gives O(1) lookup and a doubly linked list gives O(1) move and eviction of the least recently used node.

### 3. What is the space complexity of naive recursive Fibonacci due to the call stack?

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

**Answer:** O(n)

**Explanation:** Although its time is exponential, the maximum recursion depth is n, so stack space is O(n).

### 4. How is level order traversal of a binary tree implemented?

A. BFS using a queue
B. DFS using a stack
C. Inorder recursion
D. Randomly

**Answer:** BFS using a queue

**Explanation:** Level order visits nodes level by level, which is breadth first search using a queue.

### 5. What is the worst case time complexity of a hash map lookup?

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

**Answer:** O(n)

**Explanation:** With many collisions in one bucket, a lookup may scan all entries, giving O(n) in the worst case.

### 6. Which of the following is a self-balancing binary search tree?

A. AVL tree
B. Plain BST
C. Linked list
D. Array

**Answer:** AVL tree

**Explanation:** An AVL tree rebalances on insertion and deletion to keep its height logarithmic.

### 7. Which sorting algorithm performs best on nearly sorted data?

A. Insertion sort
B. Quicksort
C. Heap sort
D. Selection sort

**Answer:** Insertion sort

**Explanation:** Insertion sort runs in nearly O(n) time when the data is almost sorted.

### 8. What is the time complexity of inserting into a balanced binary search tree?

A. O(1)
B. O(log n)
C. O(n)
D. O(n log n)

**Answer:** O(log n)

**Explanation:** A balanced BST keeps height near log n, so insertion is O(log n).

More Intuit preparation, including the full recruitment process: https://useastra.in/campus/intuit
