The utilization of petroleum coke with a simple and eco-friendly way is still a challenging task. In this study, an in-situ texturing strategy has been proposed for the preparation of the N-doped carbon nanotubes (N-CNTs), which employs cheap petroleum coke as carbon source and graphitic carbon nitride (g-C3N4) as template and nitrogen source. The synergistic effect between N-CNTs with multilayer adsorption and Au nanoparticles (AuNPs) with remarkable electrocatalytic properties is conducive to constructing a promising N-CNTs/AuNPs nanocomposite as sensing flatform for monitoring the trace amount of heavy metal ions. The sensitivity of N-CNTs/AuNPs-modified glassy carbon electrode (GCE) for lead (II) ion (Pb2+) detection is as high as 26.1 μA·μM−1, which has 42.5 and 3.0-times enhancement compared to bare GCE (0.6 μA·μM−1), and N-CNTs-modified GCE (6.5 μA·μM−1), respectively. Additionally, the corresponding limit of detection of N-CNTs/AuNPs-modified GCE has achieved as low as 0.011 μM (S/N = 3). Encouragingly, the interference of co-existing ions could be negligible, which allows the accurate detection of Pb2+ in real water samples for further practical applications with a satisfactory recovery between 95.7 % and 106.6 %. The exceptional anti-interference performance can be ascribed to the robust chemical interaction between Pb2+ and N-CNTs/AuNPs nanocomposite, which has been proved by the X-ray photoelectron spectroscopy analyses. This work not only opens up a new avenue for the high added-value and efficient utilization of petroleum coke, but also provides valuable insights into harnessing synergistic catalysis of noble metal nanoparticles to improve the electrochemical activity of electrode materials in the electrochemical analysis field.