The eigenvector belonging to eigenvalue 0 is obviously the third column [√ 2/2,0, √2/2]T of q.
According to q Taq = b, and the column vectors in the orthogonal matrix q are all unit vectors (and the quantities are orthogonal).
We take two orthogonal unit column vectors [√ 2/2,0, √2/2]T, which can be used as the first two columns of Q.
So a = qbq t, you get the matrix a.