listz = CharacterRange["A", "K"];
k = 4;
SeedRandom[1]
rc = RandomChoice[Range @ k, Length @ listz];
{m, n, p, r} = Pick[listz, rc, #]& /@ Range[k]
{{"C", "F", "G", "H", "K"}, {"B", "D", "E", "I"}, {}, {"A", "J"}}
Also
Lookup[GroupBy[Transpose[{rc, listz}], First -> Last], #, {}]& /@ Range[k]
AdjacencyList[Graph[Range[k], Thread[rc -> listz]], # ] & /@ Range[k]
both give the same result. Also, using Carl Woll's GatherByList:
RandomSample[PadRight[GatherByList[listz, rc], {k, Automatic}, {}]]
{{"A", "J"}, {}, {"C", "F", "G", "H", "K"}, {"B", "D", "E", "I"}}
Update: To get k non-empty sublists:
SeedRandom[1]
rc = Module[{r}, While[Length[Counts[r = RandomChoice[Range@k, Length @ listz]]] < k]; r];
Pick[listz , rc, # ] & /@ Range[k]
Lookup[GroupBy[Transpose[{rc , listz}], First -> Last], #, {}] & /@ Range[k]
AdjacencyList[Graph[Range[k], Thread[rc -> listz]], # ] & /@ Range[k]
all give
{{"A", "B", "C", "E", "H", "I"}, {"F"}, {"D", "G"}, {"J", "K"}}
GatherByList[listz, rc]
{{"A", "B", "C", "E", "H", "I"}, {"D", "G"}, {"F"}, {"J", "K"}}
Update 2:
You can also use the function RandomKSetPartition from the Combinatorica package:
Quiet @ Needs["Combinatorica`"]
SeedRandom[1]
RandomKSetPartition[listz, 4]
{{"A", "D", "H"}, {"B"}, {"C", "F", "J", "K"}, {"E", "G", "I"}}