from typing import List


def build_queue_data(app_config: dict) -> List[tuple]:
    """Creates a list of tuples containing queue name and limit pairs.

    Args:
        app_config: Map containing the config

    Returns:
        A set of name and Q limit pairs
    """
    queue_config = []
    config_queues = app_config.get("queues")
    queue_limits = app_config.get("queue_limits")

    if config_queues:
        for queue_name, dets in config_queues.items():
            queue_config.append((queue_name, dets["limit"]))

    if queue_limits:
        for limit, queues in queue_limits.items():
            for queue_name in queues:
                queue_config.append((queue_name, limit))

    return list(set(queue_config))