MAQ Software Interview Question

How is a bubble sort algorithm implemented?