Saturday 9 June 2018

WCF Interview Questions

1. What is WCF?
WCF stands for Windows Communication Foundation. It is a Software development kit for developing services on Windows. WCF is introduced in .NET 3.0. in the System.ServiceModel namespace. WCF is based on basic concepts of Service oriented architecture (SOA)

2. What is endpoint in WCF service?
The endpoint is an Interface which defines how a client will communicate with the service. It consists of three main points: Address,Binding and Contract.

3. Explain Address,Binding and contract for a WCF Service?
Address:Address defines where the service resides.
Binding:Binding defines how to communicate with the service.
Contract:Contract defines what is done by the service.
WCF Questions and Answers

4. What are the various address format in WCF?
a)HTTP Address Format:–> http://localhost:
b)TCP Address Format:–> net.tcp://localhost:
c)MSMQ Address Format:–> net.msmq://localhost:

5. What are the types of binding available in WCF?
A binding is identified by the transport it supports and the encoding it uses. Transport may be HTTP,TCP etc and encoding may be text,binary etc. The popular types of binding may be as below:
a)BasicHttpBinding
b)NetTcpBinding
c)WSHttpBinding
d)NetMsmqBinding

6. What are the types of contract available in WCF?
The main contracts are:
a)Service Contract:Describes what operations the client can perform.
b)Operation Contract : defines the method inside Interface of Service.
c)Data Contract:Defines what data types are passed
d)Message Contract:Defines wheather a service can interact directly with messages

7. What are the various ways of hosting a WCF Service?
a)IIS b)Self Hosting c)WAS (Windows Activation Service)

8. What is the proxy for WCF Service?
A proxy is a class by which a service client can Interact with the service.
By the use of proxy in the client application we are able to call the different methods exposed by the service

9. How can we create Proxy for the WCF Service?
We can create proxy using the tool svcutil.exe after creating the service.
We can use the following command at command line.
svcutil.exe *.wsdl *.xsd /language:C# /out:SampleProxy.cs /config:app.config

10.What is the difference between WCF Service and Web Service?
Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. The following point provides the detailed differences between them :
1. Hosting : Webservices can be host in IIS, whereas WCF services can be hosted in IIS, Windows Activation Service, Self Hosting.
2. Encoding : Webservices uses XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom. WCF uses XML 1.0, MTOM, Binary, Custom.
3. Transports : Webservices can be accessed using HTTP, TCP, Custom. WCF services can be accessed using HTTP, TCP, Named Pipes, MSMQ, P2P, Custom.
4. Protocols : Webservices uses Security porotocols only. Whereas WCF services uses Security, Reliable Messaging, Transactions protocols.

11.What is DataContract and ServiceContract?Explain
Data represented by creating DataContract which expose the data which will be transefered /consumend from the serive to its clients.
**Operations which is the functions provided by this service.
To write an operation on WCF,you have to write it as an interface,This interface contains the “Signature” of the methods tagged by ServiceContract attribute,and all methods signature will be impelemtned on this interface tagged with OperationContract attribute.and to implement these serivce contract you have to create a class which implement the interface and the actual implementation will be on that class.
Code Below show How to create a Service Contract:
Code:
[ServiceContract]
Public Interface IEmpOperations
{
[OperationContract]
Decimal Get EmpSal(int EmpId);
}
Class MyEmp: IEmpOperations
{
Decimal Get EmpSal()
{
// Implementation of this method.
}
}

12. What is Windows card space?
Windows card space is a central part of Microsoft’s effort to create an identify met system, or a unified, secure and interoperable identify layer for the internet.

13. What are the main components of WCF?
There are three main components of WCF:
Service class
Hosting environment
End point

14. What are the advantages of hosting WCF Services in IIS as compared to self hosting?
There are two main advantages of using IIS over self hosting.
Automatic activation
Process recycling

15. What is .NET 3.0?
In one simple equation .NET 3.0 = .NET 2.0 + Windows Communication Foundation + Windows Presentation Foundation + Windows Workflow Foundation + Windows Card Space.

More about WCF:

MS office Interview Questions

Question1. How Can I Change Settings, Turn Features Off Or On, And Alter The Way Word Behaves?

Answer :
Most of these settings are on the Tools menu. The Options command will display a screen that contains several tabs where you can make all sorts of changes that affect Word's behavior.
The Customize command allows you to change Word's menus and toolbars. The View menu has some options for changing the appearance of the Word screen.

Question2. How Do I Get Word To Stop Helping Me Type?

Answer :
There are several places to look to turn off Word's various automatic features:
    • Choose AutoCorrect (or AutoCorrect Options) from the Tools menu, then click on the AutoCorrect tab.
    • Clear the check boxes for the AutoCorrect items that you want to disable.
    • Do the same for the AutoFormat As You Type tab.
    • On the AutoText tab, clear the Show AutoComplete tip check box.
    • Choose Options from the Tools menu, then click on the tabs and clear any check boxes for features that you want to disable.
For example:
      • Edit tab (Tabs and backspace set left indent).
      • Spelling & Grammar tab (Check spelling as you type and Check grammar as you type). When these features are on, spelling and grammar that Word does not recognize are underlined with wavy red and green lines.

Question3. How Do I Tell The Office Assistant To Go Away?

Answer :
    • Click on the Office Assistant, then click on Options.
    • Clear the Use Office Assistant check box.
You can also customize the behavior of the Office Assistant by checking or clearing the checkboxes on the Options tab. If you want to learn how to customize the Office Assistant, but it's not currently visible, choose Show the Office Assistant from the Help menu.

Question4. How Do I Turn Off The Automatic Urls In Ms Office?

Answer :
    • Choose AutoCorrect (or AutoCorrect Options) from the Tools menu.
    • Click on the AutoFormat As You Type tab.
    • Under Replace As You Type, clear the Internet and network paths with hyperlink check box.
If you didn't turn off AutoCorrect before you started typing and now you have a document full of hyperlinks that you don't want, you can turn them off, either one at a time, or all at once. To turn a link off, right-click on the link, select Hyperlink from the pop-up menu, and then select Remove Hyperlink. To remove all links from the document, choose Select All from the Edit menu or press Ctrl+A, and then press Ctrl+6 to remove all hyperlinks.

Question5. The Toolbars And The Menus In My Old Version Of Word Looked Different. What Happened?

Answer :
The Standard and Formatting toolbars can share one row in later versions of Word, or they can be displayed on two rows, as in the older versions. Also, the menus can show a basic set of commands, with the recently used commands shown first, or you can show all commands.
    • Choose Customize from the Tools menu.
    • Click on the Options tab.
    • Use the check boxes to make your selections.

Question6. What Are Word Xp/2003 Task Panes?

Answer :
The Word XP/2003 task panes appear on the right side of the screen, along with the document you are working on. The options on the task pane may change, depending on commands you have chosen. For example, some Word 2000 commands that displayed in dialog boxes now display in a task pane. If you don't want to use the task pane, you can hide it by clicking the X in the upper-right corner of the task pane. To turn it back on, select Task Pane from the View menu

Question7. What Is Going On With The Document Windows When I Have More Than One File Open?

Answer :
New documents open in a separate window (in previous versions of Word, a new document took over the Word window). You can switch from one document to another by choosing a document from the list on the Window menu or by clicking the document's button on the Windows Taskbar. To view all open Word documents at the same time, choose Arrange All from the Window menu. You can also switch documents (or applications) by pressing Alt+Tab. To see more rows of buttons on the Windows Taskbar: Position the pointer on the inside edge of the Taskbar (the pointer becomes a two-headed arrow when it is in the correct position), then click and drag its border toward the center of the screen.
There are some other options on the Shortcut tab. You can specify the folder Word points to when it starts (this setting can also be changed another way . You can program a shortcut key sequence (click in the Shortcut key box and press the key combination you want to use). In addition, you can set the window size Word uses by default (maximized, minimized, or normal) and you can choose a different Word icon (click the Change Icon button).

Question8. How Can I Find Out The Names Of The Buttons On The Toolbars?

Answer :
Hover the mouse over any button and its name will appear in a box near the mouse pointer.

Question9. How Can I Find Out What The Buttons On The Toolbars Do?

Answer :
Choose What's This? from the Help menu. The mouse pointer will turn into a pointer with a "?" symbol. Click on any button (or any other element or object on the screen) and Word will give you some information. Also, Shift+F1 will turn on the What's This? feature.

Question10. Can I Turn The Ruler Off (or Turn It Back On)?

Answer :
Choose Ruler from the View menu (if the Ruler is on, then you'll see a check next to Ruler).

Question11. How Can I Display More Toolbars?

Answer :
    • Choose Toolbars from the View menu.
    • Select the toolbar you want (an active toolbar has a check next to its name).

Question12. How Do I Move The Toolbars In Ms Office?

Answer :
    • Click on the left edge of the toolbar (the mouse pointer will turn into a four-headed pointer).
    • Drag the toolbar to any edge for a toolbar or anywhere else on the screen for a floating palette.

Question13. Can I Add Or Remove Buttons From The Toolbars In Ms Office?

Answer :
Yes! To add a button to a toolbar:
    • Choose Toolbars from the View menu.
    • Select Customize.
    • Click on the Commands tab.
    • Select an item under Categories.
    • Select an item from the list of Commands.
    • Drag the command to a toolbar. An "I" beam will appear to help you install the button. By default, the new button has only a text label.
    • Right-click on the new Toolbar item.
    • Select Default Style (the button will become a plain square).
    • Right click on the new Toolbar item again.
    • Choose Change Button Image, then select a button image.
    • Close the Customize dialog box.
To remove a button:
    • Choose Toolbars from the View menu.
    • Select Customize.
    • Drag the button you want to remove off of the toolbar.

Question14. Can I Make My Own Toolbars In Ms Office?

Answer :
Yes! To make your own toolbar:
    • Choose Toolbars from the View menu.
    • Select Customize.
    • Click on the Toolbars tab, then click on the New button.
    • Give the toolbar a name.
You can also choose to make this toolbar available to the Normal template (all documents) or the current document only. A small toolbar palette will appear on the screen. Click on the Commands tab, select a Category, then drag the commands you want onto your new toolbar.

Question15. Can I Add Or Remove Items From The Menus In Ms Office?

Answer :
Yes. To remove menu items:
    • Choose Toolbars from the View menu.
    • Select Customize.
    • Once the Customize dialog box is open you can drag unwanted items off of any of the menus.
To add a command to a menu:
    • Click on the Commands tab.
    • Select a Category, then drag the command you want onto any of the menus.
To restore a menu to its original setup, follow the steps above, but right-click on the menu you want to restore and select Reset.

More about Microsoft Office:

Ruby Interview Questions

1) What is Ruby programming language?
Ruby is a dynamic, reflective, general purpose, open source programming language that focuses on simplicity and productivity. Ruby has a mixed features of Perl, small talk, Eiffel, Ada and Lisp. Ruby was designed to create a new language which makes a balance with the functionality of Imperative languages.

2) Who is the developer of Ruby?
Ruby is designed and developed by Yukihiro "martz" Matsumoto in mid 1990 in Japan.

3) Why Ruby is known as a language of flexibility?
Ruby is known as a language of flexibility because it facilitates its author to alter the programming elements. Some specific parts of the language can be removed or redefined. Ruby does not restrict the user. For example, to add two numbers, Ruby allows to use + sign or the word 'plus'. This alteration can be done with Ruby's built-in class Numeric.

4) List some features of Ruby?
Ruby has many features. Some of them are listed below.
Object-oriented
Flexible
Dynamic typing and Duck typing
Garbage collector
Keyword arguments

5) Explain some differences between Ruby and Python.
Similarities:
High level language
Support multiple platforms
Use interactive prompt called irb
Server side scripting language
Differences:
Ruby is fully object oriented while Python is not.
Ruby supports EclipseIDE while Python supports multiple IDEs.
Ruby use Mixins while Python doesn't.
Ruby supports blocks, procs and lambdas while Python doesn't.

6) Write the command to get installed Ruby version in your system.
ruby -v

7) What are class libraries in Ruby?
Ruby class libraries contain variety of domain such as thread programming, data types, various domains. Following is a list of domains which has relevant class libraries:
Text processing
CGI Programming
Network programming
GUI programming
XML programming

8) Name some operators used in Ruby.
Operators are a symbol which is used to perform different operations.
Unary operator
Airthmetic operator
Bitwise operator
Logical operator
Ternary operator

9) What is RubyGems in Ruby programming language?
RubyGems provides a standard format for distributing ruby programs and libraries. It works as a package manager for the Ruby programming language.
RubyGems is now a part of the standard library from Ruby version 1.9.

10) What are Ruby variables.
Ruby variables hold data which can be used later in a program. Each variable act as a memory and shas a different name.
There are four types of variables in Ruby:
Local variable
Class variable
Instance variable
Global variable

11) What is the difference between nil and false in Ruby?
nil
false
nil cannot be a value.
false can be a value.
nil is returned where there is no predicate.
in case of a predicate, true or false is returned by a method.
nil is not a boolean data type.
false is a boolean data type.
nil is an object of nilclass.
false is an object of falseclass.

12) Explain Ruby data types.
Ruby data types represent type of data such as text, string, numbers, etc.
There are different data types in Ruby:
Numbers
Strings
Symbols
Hashes
Arrays
Booleans

13) What is the use of load and require in Ruby?
In Ruby, load and require both are used for loading the available code into the current code. In cases where loading the code required every time when changed or every times someone hits the URL, it is suggested to use 'load'.
It case of autoload, it is suggested to use 'require'.

14) Explain Ruby if-else statement.
The Ruby if-else statement is used to test condition. There are various types of statement in Ruby.
if statement
if-else statement
if-else-if (elsif) statement
ternary statement

15) Explain case statement in Ruby.
In Ruby, we use 'case' instead of 'switch' and 'when' instead of 'case'. The case statement matches one statement with multiple conditions just like a switch statement in other languages.

More about Ruby: