You are a Jew and I am a Samaritan woman. How can you ask me for a drink?
Where can you get this living water?
Jesus was traveling to Samaria when he got tired and rested by the Jacob's well.
I, the one speaking to you—I am he.
He saw a Samaritan coming to get water and asked her for a drink. She is surprised by his question.
A way Jesus' encounter with the Samaritan woman was different from Nicodemus was that while Nicodemus was on the higher ranks in society while the woman was in the bottom, bottom of the line. She had a bad reputation, being looked downed at even by her people. Also while Jesus met Nicodemus at late night, he met with the woman at daytime/ noon.
Jesus replies her, “If you knew the gift of God and who it is that asks you for a drink, you would have asked him and he would have given you living water.” The woman doesn't understand the actual meaning of living water.
A similarity between the two encounters is Jesus's attitude towards them. Jesus, despite their reputations, comes and accepts everyone not caring their position in society. Jesus showed both Nicodemus and the Samaritan girl acceptance.
Jesus tells the woman that he knows of the 5 husbands she's been with and tells her of the coming time where people will freely worship God. She comments that she has heard of the Messiah who once comes, will explain everything. Jesus then reveals himself.