.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

You are designing a single person shooter game application. The player can choose between multiple guns.
1) Pistol with 5 bullets
2) Shotgun with 100 bullets
3) Grenade Launcher with 20 grenades

Each gun will have different sound effects and graphics.

Pressing Ctrl+Space should rotate between guns.
Which design pattern should you employ for this?

Posted By :Jean Paul     Posted Date :September 29, 2010    Points :10   Category :.NET Framework 
Use Strategy Pattern.

Explanation: Each gun having different performance and graphics.
So this can be accomodated in the algorithm.

Strategy pattern is best suited for shifting the guns/algorithms

There will be a IGun interface implemented by 3 classes
Pistol : IGun
Shotgun : IGun
GrenadeLauncher : IGun

You can also find related Interview Question to You are designing a single person shooter game application. The player can choose between multiple guns. 1) Pistol with 5 bullets 2) Shotgun with 100 bullets 3) Grenade Launcher with 20 grenades Each gun will have different sound effects and graphics. Pressing Ctrl+Space should rotate between guns. Which design pattern should you employ for this?  below: 

You are designing a GUI application with a window and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What's the problem?

  
One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at the same location when resized. (More...)

Can i add more than 1 web.config file in a single application?

  
Yes, it is possible to add more than 1 web.config file in a single application. (More...)

Can multiple catch blocks be executed for a single try statement?

  
No. Once the proper catch block processed, control is transferred to the finally block (if any).

So we can not execute multiple catch block in one try block (More...)

Which design pattern should have private or protected constructor?

  
singleton design pattern should have private or protected constructor (More...)

Is Multiple Pages possible In Single asp.net Page?

  
We can achieve this in simple way by using FrameSet .... (More...)

Populate multiple controls from DB in a single function using a single DataSet

  
Step 1:
- Write the different queries for getting the data from the DB for different controls in a single string variable by separating them with semicolon.

Ex -
//Create the SQL query.
string selectQueryForControlPopulation =
"SELECT COL1,COL2,... FROM TABLE_NAME1 WHERE CONDITION; SELECT COL1,COL2,..FROM TABLE_NAME2 WHERE CONDITION; ......";
Step 2:
- Create the DataAdapter, DataSet object. Execute the query and fill the DataSet object.

Ex -
//Create the Connection object.
OleDbConnection oConnection = new OleDbConnection(ConfigurationSettings.AppSettings["SQLConnectionString"]);

//Create the Command object.
OleDbCommand oCommand = new OleDbCommand(selectQueryForControlPopulation , oConnection );

//Create the DataAdapter object and set its property.
OleDbDataAdapter oAdapter = new OleDbDataAdapter();
oAdapter .SelectCommand = oCommandPopulateOrganizations;

// Create a DataSet object.
DataSet oDataSet = new DataSet();

//Filling the DataSet object.
oAdapter .Fill(oDataSet);

(**) The DataSet object contain the result of different queries as different tables. We can access those table to fill our controls.

http://www.mindfiresolutions.com/Populate-multiple-controls-from-DB-in-a-single-function-using-a-single-DataSet-831.php (More...)

Which of the following methods is used to collect and interpret data from end users to design an application. ?

  
1, Coherence
2, Contextual design
3, Participatory design
4, Ethnography

Answer : 2 (More...)

Real software is developing a speech-based user interface for blind people. However, speech based interface are difficult to design and time given by the client is short. To develop a functional interface without any errors, the company wants to first evaluate the prototype. They used the storyboard technique to demonstrate the functionality of the application. However, this technique was unable to demonstrate the interactive feature of the application. Analyze and provide solution for the above scenario?

  
1, The design team of Real software should have used the Sketching technique because storyboard technique would only provide the flow and features of the interface.

2, The design team of Real software should have used the Horizontal Prototyping because storyboard technique would only provide the flow of the interface.

3, The design team of Real software should have used the Wizard of Oz technique because storyboard technique would only provide the flow and features of the interface

4, The design team of Real software should have used the Vertical Prototyping because storyboard technique would only provide the flow of the interface.


Answer : 3 (More...)

Which of the following methods is used to collect and interpret data from end users to design an application?

  
1, Coherence
2, Contextual design
3, Participatory design
4, Ethnography

Answer : 1
(More...)

What is design pattern?

  
Design pattern are recurring solution to the recurring problem.

There are basically classified in to three categories. They are,
1. Creational pattern
2. Structural pattern
3. Behavioural pattern.
(More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend