Rapid urbanization necessitates a balance between resources and urban growth. To achieve this equilibrium, the use of information technologies is essential. As a result, smart cities are the answer to this requirement, aiming to improve various aspects of urban life and address related challenges or mitigate them. Smart cities utilize modern technologies, including a wide range of Internet of Things (IoT) sensors, to collect and analyze data on different aspects of urban life in order to enhance the lives of its inhabitants. Smart cities improve the sustainability and efficiency of urban dynamics. Today, smart cities can enhance services and citizens' lives in various fields such as governance, education, healthcare, transportation, and energy. A smart city application requires collaboration among individuals from various disciplines, including engineering, architecture, urban design, and economics, to plan, design, implement, and deploy a smart solution for a specific task. Therefore, it is crucial to have a proper understanding of the applications and architecture of smart cities and the challenges they face. In this paper, we will provide background information about the applications of smart cities, describe the architecture of applications in smart cities, and present security and privacy challenges to examine robustness and flexibility in smart city applications.