She asked who arrived first.

Literal

She [topic-は] who [subject-が] first arrived [question-か] asked.

An embedded question — the question 'who arrived first?' (誰が最初についたか) becomes the object of 聞いた ('asked'). Inside the embedded question, the subject takes が (not は), since は is reserved for the main-clause topic. The か at the end of the embedded clause keeps its question force even though there's no question mark in the sentence as a whole. ついた is the past of 着く ('arrive'), not 付く or 着く's homographs.