So that's how he knew it was Ibuki.. The anime skipped a lot of Ayanokouji's observation and solving skills. I was always wondering whether he knew from the start or he deduced it afterwards, guess he indeed secretly interrogated and found out the culprit without making her aware of it.
No wonder his plan afterwards could go so smooth because this simple deduction could establish the fact class C is still competing and didn't give up.