Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike

I was asked this question during an interview for a potential job.

What is the simplest "hello world" application you can write using the MVC Design Pattern?

I came up with a JavaScript program


var arr = ["a","b","c","d"];   // this is an array, same as store or model
alert(arr[0]);                // this is controller
//and browser alert is a view. 


I was later informed that an alert is a type of view. From my understanding of the Model-View-Controller (MVC) structure, any changes to the model are reported to the view, while a controller is used to invoke the relevant methods.

Can you suggest a different way of creating a "Hello World" MVC application and provide an explanation of the key concepts of MVC? Additionally, can you provide advice on potential areas of improvement in my current approach?

in Interview-Experiences by Expert (500 points) | 563 views

Please log in or register to answer this question.