Code switching and code mixing refer to alternating between two or more languages or varieties of the same language in conversation. It is common in bilingual communities. Code switching involves changing languages between sentences while code mixing incorporates small units like words from one language into sentences of another language. Whether code switching or mixing occurs depends on factors like the topic, situation, participants in the conversation, and the speaker's intentions.