曲奇 is a loanword from Cantonese (kuk1 kei4), which borrowed from English 'cookie.' It entered Mandarin from Hong Kong. In northern China, 饼干 (bǐnggān) is more common for cookies/biscuits in general.
usage
曲奇 specifically refers to Western-style baked cookies (butter cookies, chocolate chip cookies). Chinese traditional pastries use 糕 or 饼 instead.