Confucius (c. 551–479 BCE) and Buddha (fl. circa 450 BCE) did not encounter each other, and their respective philosophical and religious worldviews reflect this.
Buddha began his religious career as an ascetic. At 29, he renounced a luxurious material lifestyle in response to experiencing marked existential anxiety about death and suffering. Traditional sources describe him venturing through forests, encountering other similar renunciants on his travels, and practicing asceticism with them for a time before becoming disenchanted with the lack of results according to their methods.
Confucius was perhaps the opposite. He never renounced the material world of desire and developed a humanistic and politically-oriented worldview. He became estranged from the political state and perceived moral deterioration (education being a privilege for the elite, misguided appropriate relationships between various subjects, subordination of the working class, breakdown of tradition, etc.) occurring in the Zhou Dynasty (r. 1122–256 BCE). Confucius’s goal was always to attain a state position that put him in close proximity to the ruling Lord in the hope of transforming Chinese society.
Both Buddha’s and Confucius’s teachings were not devoid of religious ideas. Confucius accepted tianming (Heaven’s Mandate), which is the transcendent source that grants people moral principles and virtues (see 9.5 and 17.9 of the Analects) and bestows a divine mission upon an individual, which Confucius believed he had been (14.35). The Analects reflect Confucius’s beliefs in spirits, ancestors, and divinities going back to the Shang Dynasty (c. 1600–1050 BCE). The Buddha taught others the religious concepts of samsara (the cycle of rebirth and redeath), karma, and moksha, which he appropriated from Hinduism.
In terms of Daoism (Taoism), Confucius preserved tradition, one of which was the Dao, or Way, to enable people to achieve a peaceful, harmonious, and flourishing society. However, Confucius promoted practicality and disagreed with the Daoist concept of wuwei (non-action)