Search⌘ K
AI Features

Quiz: Algorithm Analysis

Test your understanding of algorithm analysis in coding interviews.

We'll cover the following...
Technical Quiz
1.

What is the time complexity of the following code?

def find_max(arr):
    max_val = arr[0]
    for num in arr:
        if num > max_val:
            max_val = num
    return max_val
A.

O(1)O(1)

B.

O(logn)O(\log n)

C.

O(n)O(n)

D.

O(n2)O(n^2)


1 / 5