It seems they can be used interchangeably but I am not sure. Can somebody explain the difference of use between these two key words? Where do they become different?
Within is closer to inside - it mainly refers to something like a building where you are physically in (or inside).
In can also mean a state or an organisation, so you can be "in trouble", or "in school" but not "within trouble".
where ever there is a certainty we use in and in uncertainty we use within.
Also, if some timeframe is allocated ie : do the work in ten minutes
Then if the work is completed in 10 min then use in and if completed before 10 min then within.