Assume we have a function named choose_component_type, that does this qmc sampling. Its inputs would be the weights of the various components of a shader. Those components might be transparency, diffuse reflection, specular/glossy reflection. Maybe treat refraction separately from transparency, maybe not. That is another discussion and might be different for a hair shader than a glass shader for example.
Anyway, the output would be the component type, so you could use it in a case statement to select which path to trace/calculate.
psuedocode
Code:
component_type = choose_component_type(component_weights)
switch (component_type)
case reflection: - if glossy, choose glossy direction, trace reflection ray
case transparency: - trace transparency ray
case diffuse: - calculate direct diffuse, then calculate indirect diffuse: either shoot brute force fg ray, or interpolate fg points, based on technique chosen
case scatter: - if including an sss component, calculate sss
...