Lalami was born in a working-class family in Rabat, Morocco. She spoke Moroccan Arabic at home, and learned Standard Arabic and French in elementary school. According to Lalami, all the children's books she read as a child were written in French, and she began to write her own stories in French. "The characters’ names, their homes, their cities, their lives were wholly different from my own," she explained, "and yet, because of my constant exposure to them, they had grown utterly familiar. These images invaded my imaginary world to such an extent that I never thought they came from an alien place." While her parents both read widely in a variety of genres and encouraged her writing, Lalami has said that they thought she needed to study a profession other than writing.