def get_instr_pos(qobj, exp_index, name):
    """Return all locations of QasmQobjInstruction in a Qobj experiment.

    The return list is sorted in reverse order so iterating over it
    to insert new items will work as expected.

    Args:
        qobj (Qobj): a Qobj object
        exp_index (int): The index of the experiment in the qobj
        name (str): QasmQobjInstruction name to find

    Returns:
        list[int]: A list of positions where the QasmQobjInstruction is located.
    """
    # Check only the name string of the item
    positions = [i for i, val in enumerate(qobj.experiments[exp_index].instructions)
                 if val.name == name]
    return positions