It should be said though that some often used statistics like "coastline length" and here "largest city" just do not really have definitive answers. Different countries handle it differently, some give a kind of "city rights" to large rural areas (granted, they won't appear in this question), some include neighboring smaller cities, others don't, and you have megacities spanning across multiple administrative cities which have grown together - which made (maybe still makes) Essen the by far largest city in Germany in the CIA world factbook because they counted the whole Ruhr area in, when we in Germany do not even consider it top 5 with only a fraction of Berlin's size. But if they did it differently then they would compare apples to oranges in a way. So in the end there will be no "one correct answer" for the question but multiple which all have some claim to correctness.
Edit: I wrote that CIA considers Essen to be the largest city in the world, which of course was utter nonsense, I meant to say "in Germany", so corrected it.