Prosecutor Peter is preparing for a trial. Defendant Dexter may or may not take the witness stand. Peter has no idea what he would say if he does (no disclosure obligation on the defendant) but still needs to be ready.
So, Peter thinks up a few lines of defence that Dexter could possibly adopt on his evidence-in-chief and prepares separate sets of cross-examination questions for each.
To each question Peter expects one or more possible answers. Every subsequent question will often depend on what the answer to the previous one was. Peter aims to plan the questioning such that inconsistencies in Dexter's answers surface as soon as possible so that it becomes apparent that he is lying and Peter could just say "no further questions, Your Honour".
Is that roughly how prosecutors prepare? Do they draw flowcharts? Do they use some special methodologies? Or do they just fly by the seat of their pants?