Date: 202007
Local time of day: 1201-1800
Location: ZZZ.ARTCC, US
Aircraft: A321
Operator: Air Carrier
Operating under: Part 121
Flight plan: IFR
Mission: Passenger
Flight phase: Descent
Airspace: Class B ZZZ
Second aircraft: Cessna Aircraft Undifferentiated or Other Model
Reporter organization: Air Carrier
Reporter function: Pilot Flying; First Officer
Reporter qualification: Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument; Flight Crew Multiengine
Human factors: Time Pressure
Second reporter function: Captain; Pilot Not Flying
Anomaly: ATC Issue All Types; Conflict NMAC
Detector: Person Flight Crew
When detected: In-flight
Result: Flight Crew Took Evasive Action
Contributing factors: Airspace Structure; Human Factors
Primary problem: Human Factors

Narrative: I was the Pilot Flying (PF) on Aircraft X from ZZZ to ZZZ1. The flight was normal other than some weather diversions over the Rocky Mountains. The flight was assigned the STAR to Runway XX. Somewhere between ZZZZZ and ZZZZZ1; the flight was cleared to 4;000 ft. MSL direct ZZZZZ2. As the flight was leveling off at 4;000 ft. MSL; we were assigned to slow to an assigned speed of 210 kts. As the aircraft was slowing; I was scanning visually and I saw Aircraft Y; 100-200 ft. below our flight path at the 1 o'clock position; moving directly into our flight path. Seeing that a mid-air collision was imminent; I took evasive action; disconnected the autopilot and went into an immediate climb. Once our aircraft was climbing; I saw Aircraft Y begin to dive. When I saw this; the two aircraft were close enough that I could clearly determine the paint scheme on Aircraft Y.After the maneuver to avoid Aircraft Y we were able to reengage the autopilot and stabilize the aircraft in order to land safely. After the incident; we reported the near-miss to ATC via radio and followed up with a call to TRACON so they could start to investigate what had happened.Most alarming was that we did not see a target on the TCAS or get a TA/RA. There was no warning of the danger. ATC also did not issue any traffic warnings about the conflict. Had we been more task saturated; or verifying something in the flight deck instead of looking out at the exact right time; this incident could have had a very tragic outcome. There are a few causal factors that need to be addressed. First; after the Captain spoke to TRACON that night; after arriving at the hotel; she was told that Aircraft Y had departed ZZZ2; a controlled airport; and was experiencing transponder issues. The pilot of Aircraft Y should not have continued flight in the Mode-C veil with an inoperative transponder. Also; since date; all aircraft operating in controlled airspace are required to have ADS-B out. That requirement is for this reason. To make sure that TCAS equipped aircraft can receive transponder information of aircraft that are around them. Second; ATC cleared us down to 4;000 ft.; and that is the floor of the Class-B airspace. This put us in a position that VFR traffic operating under the Class-B shelf could be at 3;999 ft. and not be making an incursion into the Class-B. With that; Aircraft Y should not have been at 3;999 ft. because of VFR cruising altitudes. The Cessna departed from ZZZ2 and landed at ZZZ3; this is a northwest track and the MSL altitude in most of the area is 700 ft. AGL. This means that Aircraft Y should have been at a maximum altitude of 3;700 ft. MSL. If Aircraft Y was at 3;700 ft.; 300 ft. is still not enough separation. Even if Aircraft Y was legally allowed to be at 3;000 ft. AGL as a cruising altitude it is not a very safe place to be on the approach corridor into an airport such as ZZZ1. I also do not believe that being cleared right to the floor of the Class-B airspace was a good place to be assigned. While on the approach to an airport to an airport such as ZZZ1 I am aware of the Class-B shelves; but I did not think that I would have been cleared all the way to the floor of the airspace. This leaves no room for error.If there is an aircraft that is any kind of radar target in or below Class-B; ATC should inform any aircraft that is in the vicinity of that presence. This is even more important if the aircraft in question has equipment; such as the transponder; that is not working properly. ATC should not clear airline traffic; flying to a Class-B airport; to the floor of the airspace unless it is completely necessary. The pilot of the Cessna should have returned to ZZZ2 after takeoff when they were informed about the transponder not working properly. This incident was definitely much too close and was completely preventable. We are fortunate that this did not result in a senseless tragedy. There are important lessons for us all in this event and thankfully everyone landed safely.


Second narrative: We were level at 4;000 ft.; cleared to intercept the localizer. The First Officer disconnected autopilot; turned and climbed to avoid Aircraft Y in our flight path. Aircraft Y seemed to nose over his plane. There was no target on our screen; nor a TA/RA. Approach control only had a primary target.The First Officer did an excellent job avoiding the Cessna.The altitudes of the Class B airspace should be changed. Also; upon arrival at the gate we called and spoke with TRACON Ops Manager.


Synopsis: A-321 flight crew reported an NMAC event while on Approach control vectors for final approach course.