The purpose of the workout is improve speed to run week in the 5k to 10k races.
Be specific. At certain points of an athlete's training progression it is more appropriate to use a longer interval and at other points it is appropriate to use a shorter interval. Dynamic manipulation of variables leads to positive progression. There is no single answer that fits any and every scenario; like so many other variables in training, it depends.
In regards to the second question, i know that it has to be incorpored into a training program but what takes priority for shortes races(5k -10k)?
Actually, it does not 'have to be incorpored' [sic] into a training program, either or both are incorporated by choice. Parsing which “takes priority” is simplistic. Why not do both? If you want to race your best, you will need the benefits of both. 8)