In diatonic set theory a specific interval is the clockwise distance between pitch classes on the chromatic circle (interval class), in other words the number of half steps between notes. Although this sounds simple and clear, it is very common amongst theory students to do mistakes when writing intervals. Why? Because different intervals may have the same number of half steps.
An example is the augmented fourth interval and the diminished fifth. Both have the same number of half steps (six) and therefore sound the same, but still they are different, as the first is a fourth interval while the later is a fifth. So is there a method to help you avoid mistakes? Yes there is, and it consists of three simple steps: (a) Write on the staff the generic interval, (b) Count the number of half steps (frets on the same string on the mandolin), (c) Compare with the staff and add accidentals.
Thats it! See below examples that will help you understand.