NSETECH interview question

How does a stock exchange work?