I'm studying Dehn surgery, and it says that the coefficient $(p,q)$ which says how the meridian curve on solid torus is attached will determine the entire resulting manifold. I'm wondering whether the coefficient $(p,q)$ of the meridian also determine the coefficient for longitude. If not, then can any $(r,s)$ with $ps-qr=\pm 1$ be the coefficint for the longitude?
Yes, the longitude of the Dehn surgery solid torus can go to any $(r, s)$ such that the 2x2 determinant $ps-qr = \pm 1$. This is because the various choices for the longitude all differ by homeomorphisms of the torus which extend to homeomorphisms of the solid torus.
More generally, consider gluing together two manifolds $M$ and $N$ along a homeomorphism $f:\partial M \to \partial N$. Let $h:\partial N\to \partial N$ be a homeomorphism which extends to a homeomorphism $h':N\to N$. Then gluing via $f$ and gluing via $h\circ f$ yield homeomorphic manifolds.