The goal of this work is to gain fundamental understanding of the surface and internal structure of functionalized detonation nanodiamonds (NDs) using quantum mechanics based density functional theory (DFT) calculations. The unique structure of ND assists in the binding of different functional groups to its surface which in turn facilitates binding with drug molecules. The ability to comprehensively model the surface properties, as well as drug-ND interactions during functionalization, is a challenge and is the problem of our interest. First, the structure of NDs of technologically relevant size (similar to 5 nm) was optimized using classical mechanics based molecular mechanics simulations. Quantum mechanics based density functional theory (DFT) was then employed to analyse the properties of smaller relevant parts of the optimized cluster further to address the effect of functionalization on the stability of the cluster and reactivity at its surface. It is found that functionalization is preferred over reconstruction at the (100) surface and promotes graphitization in the (111) surface for NDs functionalized with the carbonyl oxygen (C=O) group. It is also seen that the edges of ND are the preferred sites for functionalization with the carboxyl group (-COOH) vis-a-vis the corners of ND.