Cambridge Dictionary gave the following rules that will help us learn how to use come up with and come upon someone/something.

a. Come up with (something):
- to suggest or think of an idea or plan.
Example:
She’s come up with some amazing scheme to double her income.
b. Come upon (someone/something):
- to find or meet someone or something, esp. unexpectedly:
Example:
She came upon an odd little man in the forest.
To read more, please click here.
To take the quiz, please click here.