They either have an aldehyde functional group in position 1 (aldoheptoses), or a ketone functional group in position 2 (ketoheptoses).
There are few examples of C-7 sugars in nature, among which are sedoheptulose and L-glycero-D-manno-heptose.