Help golfing this solution further
string ... s="?,!;." ... var x=s.IndexOf(c);



s is used only once, so could be inlined.




var x=s.IndexOf(c); ... &amp;&amp;x&gt;-1&amp;&amp; ... c+" "+(x%2&gt;0?" "+w.ToLower():w):"")+c;



Change "?,!;." to ",;?!." and the test x%2&gt;0 can be simplified to x&lt;2.

Where in the spec does it require double-space after sentence-terminating punctuation? IMO you could lose the " "+ inside the parentheses.



Given the IMO ridiculous interpretation which they're allowing of "random", I don't see why you do such complicated stuff with z. Just use the character index modulo 3. A direct change to

string p(string i){int n=i.Length,j,x;string w="Um|Literally|You know|Er|Okay|Right|Ah|Like".Split('|')[n%8],o="";for(j=0;j&lt;n;j++){var c=i[j];x=",;.?!".IndexOf(c);o+=(x&gt;-1&amp;&amp;j%3&lt;1?c+" "+(x&lt;2?" "+w.ToLower():w):"")+c;}return o;}


gives a further nice saving. An alternative using Linq also saves a lot by exploiting fat arrow syntax, and would be cheaper if they give you free using statements:

using System.Linq;string p(string s)=&gt;string.Join("",s.Select((c,i)=&gt;{var w="Um|Literally|You know|Er|Okay|Right|Ah|Like".Split('|')[s.Length%8];var x=",;.?!".IndexOf(c);return(x&gt;=0&amp;&amp;i%3&lt;1?c+" "+(x&lt;2?" "+w.ToLower():w):"")+c;}));