def check_keys(data, required_keys):
    """Return the keys that are missing from the data dictionary."""
    extra_keys = []
    required_keys = set(required_keys)
    for key in data.keys():
        if key not in required_keys:
            extra_keys.append(key)
        else:
            required_keys.remove(key)
    missing_keys = list(required_keys)
    return missing_keys, extra_keys
