Section 36. The court may exclude all persons whose presence is not necessary at such inquest; and may also direct the witnesses to be kept so separated that they cannot converse with each other until they have been examined. The attorney general, the district attorney, or some person designated by either, shall attend the inquest and examine the witnesses.