Maximum integer in a sorted list which also is in an unsorted list
Are you familiar with binary search? If not, look that up. It has complexity $O(\log n)$ and will find you the index $i$ where you would insert $x$ into $A$ to maintain sorted order. From this you can instantly see whether $x$ already exists in $A$ by checking whether $A[i] = x$.
Then, do this for $b_1, b_2, \dots$, checking for each whether it is in $A$ in $O(\log n)$ time, and if yes, whether it is bigger than the current best found.
You do this $k$ times to find the biggest element that is in both $A$ and $B$ in $O(k \log n)$ time.

You can even be a bit smarter, like such:
lo = 1
best = A[1] - 1
for b in B:
    if b &gt; best:
        i = binary_search(A, lo, n, b)
        if A[i] == b:
            best = b
            lo = i + 1

This doesn't change the worst case complexity but will avoid needless binary searches, and make the bounds on the binary searches that you do tighter.