A diagnostic engineer was a type of engineer who specialized in starship diagnostics in order to track down and solve engineering "mysteries".
In 2366, when the USS Enterprise-D sought a new diagnostic engineer, Captain Gleason of the USS Zhukov heard the request and offered Lieutenant Reginald Barclay.
Following Barclay's transfer and arrival aboard the Enterprise he was tasked with several duties including the repair of a malfunctioning antigrav unit, which after disassembling the device, he intended to run diagnostics on its graviton invertor circuits.
Later, when the Enterprise began experiencing examples of nucleosynthesis, which required locating an unshielded power source. Chief Engineer Geordi La Forge determined that to find such a source would require "a complete diagnostic check of the Enterprise power systems. All four thousand of them," a job he deemed Barclay to be "the perfect man for". (TNG: "Hollow Pursuits")