Interview Questions

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/104

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:56 PM on 9/20/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

105 Terms

1
New cards

What is Big O notation?

Big O notation describes how an algorithm's runtime or memory usage grows as the size of the input increases. It focuses on scalability rather than exact execution time. Common complexities include O(1), O(log n), O(n), O(n log n), and O(n²).

2
New cards

Why is Big O important?

It helps engineers predict how code will perform as data grows. An algorithm that works well for 100 items may become unusable for 10 million items if its complexity scales poorly.

3
New cards

What is O(1)?

Constant time complexity. The operation takes the same amount of time regardless of input size. Example: array[5]

4
New cards

What is O(log n)?

Logarithmic time complexity. The problem size is reduced by a constant factor in each step.

Example: binary search

5
New cards

What is O(n)?

Linear time complexity. Runtime increases proportionally to input size.

Example: looping through an array

6
New cards

What is O(n2)?

Quadratic time complexity. Runtime grows with the square of the input.

Example: nested loops

7
New cards

What is binary search?

A search algorithm that repeatedly divides a sorted array in half until the target is found.

Time complexity: O(log n)

8
New cards

What condition is required for binary search?

The collection must already be sorted.

9
New cards

Why is binary search faster than linear search?

Binary search eliminates half the remaining data during each step, whereas linear search checks elements one by one.

10
New cards

What is bubble sort?

A simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order.

Complexity: O(n^2) in worst case

11
New cards

What is merge sort?

A divide-and-conquer algorithm that recursively splits data and merges sorted halves.

Complexity: O(n log n)

12
New cards

What is quick sort?

A divide-and-conquer algorithm that partitions data around a pivot.

Average: O(n log n)

Worst Case: O(n²)

13
New cards

What is an array?

A collection of elements stored in contiguous memory locations.

Advantages:

  • Fast indexing

Disadvantages:

  • Expensive insertions and deletions


14
New cards

What is the time complexity of accessing an array element?

O(1)

15
New cards

What is a linked list?

A sequence of nodes where each node stores data and a reference to the next node.

16
New cards

Array vs linked list

Array:

  • O(1) access

  • Fixed contiguous memory

Linked List:

  • O(n) access

  • Dynamic size

  • Faster insertions


17
New cards

What is a stack?

A last in, first out (LIFO) data structure.

Example: undo functionality

18
New cards

What operations does a stack support?

  • Push

  • Pop

  • Peek


19
New cards

What is a queue?

A First In, First Out (FIFO) data structure.

Example: print queue

20
New cards

What operations does a queue support?

  • Enqueue

  • Dequeue

  • Peek


21
New cards

What is a hash table?

A data structure that stores key-value pairs using a hash function.

22
New cards

What is a hash function?

A function that converts a key into an index or bucket location.

23
New cards
24
New cards
25
New cards
26
New cards
27
New cards
28
New cards
29
New cards
30
New cards
31
New cards
32
New cards
33
New cards
34
New cards
35
New cards
36
New cards
37
New cards
38
New cards
39
New cards
40
New cards
41
New cards
42
New cards
43
New cards
44
New cards
45
New cards
46
New cards
47
New cards
48
New cards
49
New cards
50
New cards
51
New cards
52
New cards
53
New cards
54
New cards
55
New cards
56
New cards
57
New cards
58
New cards
59
New cards
60
New cards
61
New cards
62
New cards
63
New cards
64
New cards
65
New cards
66
New cards
67
New cards
68
New cards
69
New cards
70
New cards
71
New cards
72
New cards
73
New cards
74
New cards
75
New cards
76
New cards
77
New cards
78
New cards
79
New cards
80
New cards
81
New cards
82
New cards
83
New cards
84
New cards
85
New cards
86
New cards
87
New cards
88
New cards
89
New cards
90
New cards
91
New cards
92
New cards
93
New cards
94
New cards
95
New cards
96
New cards
97
New cards
98
New cards
99
New cards
100
New cards