Returning matching substrings, of n length, at the beginning and end of a string
Just some answers.


  The code passes the majority of the tests without the first if statement, so that was included to ensure it passes circumstances such as an input of xxxx. Without this statement, xxxx returns x, which is incorrect.


You if-statement solves this case... and nothing more. What about xxxxxx? The problem is that you're starting with the shortest match when you should find the longest. Reversing your loop as rolfl wrote is the way to go.

Be careful with such guard conditions. They're OK for special cases, but there's no special case here.




  
  Would it make sense, for readability and conciseness, to be creating some variables for things like string.substring(), as I did with strLength?
  


It depends. If an expression gets used a lot, is complicated, or time-consuming than surely use a local variable. In this case, I probably would not.


  
  Would it make sense to use a StringBuilder? I can't really see how it could be used in this particular case.
  


No, you're building nothing.


  
  Does it make sense to use separate return statements, or would it be more useful to assign the outcome to a resultant string, and use only one return statement at the end of the method?
  


The single-point-of-return paradigm is pretty obsolete for Java. Separate returns are usually much cleaner.