I've read extensively how sword fighting was not prevalent in medieval (or even Ancient ) warfare. It occurred, but swords functioned primarily as a sidearm in battle. Most combat revolved around tight formations and utilizing spears/polearms.
Question 1.) What about in Japan during the Shengoku period? Did Samurai fight in tight formations utilizing spears/polearms and only utilized katanas as a sidearm? Was it more chaotic and greater emphasis placed on individual fighting ability?
I've read that Ronin (masterless/Shogunless Samurai) were more like mercenaries rather than a soldiers in an army. A town could hire them to deal with bandits (like in the movie 7 Samurai), for example.
Question 2.) Were Ronins ever hired into armies for battle or was their primary function dealing with local small scaled conflicts like bandit raids or bounty hunting? Did their fighting style change when hired into an army versus something smaller scaled (such as banditry quelling or bounty hunting)?
Edited for time frame clarity
Also, by the standards of Classical or Early-Modern Europe, Japanese formation were quite lose.