I have to admit that it's a bit surprising to see a question linking these two books, because they seem, at a glance, to have few elements in common for us to use as points of comparison. The Stranger is the prototypical modernist novel about alienation and man alone in a hostile universe. Siddhartha is a modernist work as well, but one that embraces, in my view, a much more traditional philosophy rooted in religious thought, especially that of its Asian setting.
Yet there is nevertheless a similarity, though a hazy one, in character between the respective protagonists in the two works. Both Siddhartha and Meursault are men who do notconform to ordinary values or norms of society. Siddhartha, despite his period of work, love, and hedonism with Kamala, eventually renounces the material world as he had thought to do from the start by becoming a samana. Meursault, on the other hand, has never rejected the material world or anything else explicitly. But he seems cold to everything, just going through the motions. After his mother's death. his thoughts and observations are focused on meaningless things like the heat of the sun and the tar on the road to the cemetery. He agrees, without even seeming to think about it, to testify on behalf of his neighbor Raymond, though Raymond has beat his girlfriend. Meursault's girlfriend, Marie, wants to marry him, but he answers her indifferently, as if it does not matter to him one way or the other. He coldly tells her he doesn't love her and appears to expect her reaction to be one of not caring what he thinks or says. Eventually, he kills a man. It is as if this also does not make any difference one way or the other in an absurd universe.
Though the message of Camus ultimately (as Meursault himself realizes at the conclusion) is that all of this does make a difference, the trajectory of Meursault's story is completely different from that of Siddhartha's life. Meursault begins by not feeling. Siddhartha, though cold to the values of the conventional world, is almost the opposite because he feels too much, senses the agony of the world and, as it were, absorbs it in order to become a purer, greater soul. Both men "change" in some sense for the better. But the vision of Camus, in which man creates his own value in an inherently meaningless cosmos, is a much darker one than that of Hesse.