Boil the corn on the cob until it is tender-crisp. Remove from the pot and allow to cool while you cook the carrots and green beans.
Place the carrots in the boiling water and cook until tender-crisp. Remove from the pot into an ice water bath until completely cooled, then remove from the ice water and drain. Place the drained carrots in a large mixing bowl.
While the carrots cool, put the green beans in the boiling water and cook until tender-crisp, then remove from the pot into the ice water bath (you may need to add more ice). When cool, drain the green beans and add them to the mixing bowl with the carrots.
Cut the cooled corn off the cob and add to the mixing bowl with the carrots and green beans.
Add the black beans and onion to the mixing bowl and stir to combine.
Season the salad with salt and pepper to taste and garnish with cilantro if desired.