Wednesday, April 20, 2011

What is DISCO?

XML Web service discovery is the process of locating and interrogating XML Web service descriptions. Potential XML Web service clients can learn that an XML Web service exists and how to interact with it by performing a discovery. The .discomap file that is published by an XML Web service is an XML document that typically contains links to other resources that describe the XML Web service. Web sites that implement an XML Web service are not required to support discovery. An XML Web service might be created for private use.

The .wsdl, .xsd, .disco, and .discomap files produced by this tool can be used as input to the Web Services Description Language Tool (Wsdl.exe) to create XML Web service clients.

References:http://msdn.microsoft.com/en-us/magazine/cc302073.aspx

Compiled By Rajesh Rolen

Read More

What is WSDL?

SDL stands for Web Services Description Language.

WSDL is a document written in XML. The document describes a Web service. It specifies the location of the service and the operations (or methods) the service exposes.

Compiled by Rajesh Rolen

Read More

What is Endpoints in WCF service

Every service must have Address that defines where the service resides, Contract that defines what the service does and a Binding that defines how to communicate with the service. In WCF the relationship between Address, Contract and Binding is called Endpoint.

The Endpoint is the fusion of Address, Contract and Binding.
in simple language using Endpoint the client application can communicate with your WCF service.

Compiled By Rajesh Rolen

Read More

How to use vb6 components in .NET

as we all know vb6 components work on STA and .NET works on MTA.

To use vb6 dll in .net we will have to follow below steps.
- first create dll in vb6.
- you need to register the DLL. Select the Start menu's Run command and execute the statement:

regsvr32 VB6Project.dll

-Next start a Visual Basic .NET project. Select the Project menu's Add Reference command. Click the COM tab and find the DLL or click the Browse button to select it. Now the .NET application can use the DLL's public classes as we use .net classes. i mean just create its object and call its function with object.function();

http://dotnetacademy.blogspot.com/2011/04/explain-sta-and-mta.html

http://blogs.msdn.com/b/robgruen/archive/2004/11/09/254602.aspx
Read More

Explain STA and MTA

The COM threading model is called an "apartment" model, where the execution context of initialized COM objects is associated with either a single thread (Single Thread Apartment) or many threads (Multi Thread Apartment). In this model, a COM object, once initialized in an apartment, is part of that apartment for the duration of it's runtime.

The STA model is used for COM objects that are not thread safe. That means they do not handle their own synchronization. A common use of this is a UI component. So if another thread needs to interact with the object (such as pushing a button in a form) then the message is marshalled onto the STA thread. The windows forms message pumping system is an example of this.

If the COM object can handle its own synchronization then the MTA model can be used where multiple threads are allowed to interact with the object without marshalled calls.

Compiled By Rajesh Rolen

Read More

Observer design pattern in .NET

Using Delegates and events we can implement observer design pattern in .net easily.
Delegates and events provides a new and powerful means of implementing the Observer pattern without developing specific types dedicated to support this pattern. In fact, as delegates and events are first class members of the CLR, the foundation of this pattern is incorporated into the very core of the .NET Framework.

References:
http://msdn.microsoft.com/en-us/library/ff648108.aspx
http://msdn.microsoft.com/en-us/library/ee817669.aspx


Compiled By Rajesh Rolen

Read More

Encapsulation

It means that in Object-Oriented approach, an object is encapsulated from any other object there is. Everything inside an object, cannot be "touched" (accessed) by any other object within the program, unless it is permitted to be.

So whenever we want any property of an object (constants, variables, functions, or procedures) to be revealed to others, we just have to set it as a "Public" property (usually done by typing the word "Public" in the beginning of its declaration). And when we don't want it to be, we set it as "Private".

And encapsulation is an advantage because as the programming goes on, we don't have to worry about the same constant, variable, function, or procedure's name within the whole program. Every object has its own properties, and can only be accessed if it was allowed.


Compiled By Rajesh Rolen

Read More

Is it possible to change access specifier of members of interface.

AS we all know interface is publicly exposed contract, so its all functions are public by default because its made to be used by other. we cannot make method of interface as private/protected. and if your requirement is like that you are to create a protected member then my friend you are on wrong boat, You should go for abstract class instead of interface.

Compiled By Rajesh Rolen

Read More

What is difference between static class and singleton

Singleton and Static classes both provide a central point of access i.e. there's only one instance and one way to access it.

The benefit of Singleton class is it is much more flexible that static classes. Static classes once defined could not accomodate any future design changes as by design static classes are rigid and cannot be extended.

Singleton on the other hand provides flexibility and also provides sort of a mechanism to control object creation based on various requirements. They can be extended as well if need arises. In other words you are not always tied to a particular implementation. With Singleton you have the flexibility to make changes as when situation demands.

The big difference between a singleton and a bunch of static methods is that singletons can implement interfaces (or derive from useful base classes), so you can pass around the singleton as if it were "just another" implementation.

In singleton pattern you can create the singleton as an instance of a derived type, you can't do that with a static class.

Quick Example:

if( useD3D )
IRenderer::instance = new D3DRenderer
else
IRenderer::instance = new OpenGLRenderer



A static class is one that has only static methods, for which a better word would be "functions". The design style embodied in a static class is purely procedural.

Singleton, on the other hand, is a pattern specific to OO design. It is an instance of an object (with all the possibilities inherent in that, such as polymorphism), with a creation procedure that ensures that there is only ever one instance of that particular role over its entire lifetime.

A singleton allows access to a single created instance - that instance (or rather, a reference to that instance) can be passed as a parameter to other methods, and treated as a normal object.

A static class allows only static methods.


a singleton can extend classes and implement interfaces, while a static class cannot (it can extend classes, but it does not inherit their instance members). A singleton can be initialized lazily or asynchronously while a static class is generally initialized when it is first loaded, leading to potential class loader issues. However the most important advantage, though, is that singletons can be handled polymorphically without forcing their users to assume that there is only one instance.


If there are bunch of functions should be kept together, then static is the choice. Anything else which needs single access to some resources, could be implemented singleton.

Compiled By Rajesh Rolen

Read More

What is difference between abstract factory and factory method.

As both belong from creational design patterns. In short they hide the
complexity of creating objects.

The main difference between factory and Abstract factory is factory method uses
inheritance to decide which object has to be instantiated. While abstract factory uses
delegation to decide instantiation of object. We can say Abstract factory uses factory
method to complete the architecture. Abstract Factory is one level higher in abstraction
over Factory.

let me give u an over view of what the actual difference is:
1.The actual product section i.e. Class “Product” it inherits from a abstract
class “AbstractProduct”.

2.The creational aspect section that’s “ConcreteCreator” class which inherits
from class “Creator”.

3.Now there are some rules the client who will need the “Product” object will
have to follow. He will never refer directly to the actual “Product” object he
will refer the “Product” object using “AbstractProduct”.

4.Second client will never use “New” keyword to create the “Product” object
but will use the “Creator” class which in turn will use the “ConcreteCreator”
class to create the actual “Product” object.

So what are benefits from this architecture?

All creational and initializing aspects are now detached from the actual client. As your creational aspect is now been handled in“ConcreteCreator” and the client has reference to only “Creator”, so any implementationchange in “CreateProduct” will not affect the client code. In short now your creational aspect of object is completely encapsulated from the client’s logic.
It creates objects for families of classes. In short it describes
collection of factor methods from various different families. In short it groups related
factory methods.
Example in this the class “Creator” is implemented using the “Abstract”
factory pattern. It now creates objects from multiple families rather one product



Compiled By Rajesh Rolen

Read More

What is difference between Abstract Class and Interface.

An Abstract class without any implementation just looks like an Interface; however there are lot of differences than similarities between an Abstract class and an Interface. Let's explain both concepts and compare their similarities and differences.




What is an Abstract Class?



An abstract class is a special kind of class that cannot be instantiated. So the question is why we need a class that cannot be instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry on the same hierarchies or standards.




What is an Interface?



An interface is not a class. It is an entity that is defined by the word Interface. An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body. As one of the similarities to Abstract class, it is a contract that is used to define hierarchies for all subclasses or it defines specific set of methods and their arguments. The main difference between them is that a class can implement more than one interface but can only inherit from one abstract class. Since C# doesn�t support multiple inheritance, interfaces are used to implement multiple inheritance.




Both Together



When we create an interface, we are basically creating a set of methods without any implementation that must be overridden by the implemented classes. The advantage is that it provides a way for a class to be a part of two classes: one from inheritance hierarchy and one from the interface.




When we create an abstract class, we are creating a base class that might have one or more completed methods but at least one or more methods are left uncompleted and declared abstract. If all the methods of an abstract class are uncompleted then it is same as an interface. The purpose of an abstract class is to provide a base class definition for how a set of derived classes will work and then allow the programmers to fill the implementation in the derived classes.




There are some similarities and differences between an interface and an abstract class that I have arranged in a table for easier comparison:






Feature




Interface




Abstract class




Multiple inheritance




A class may inherit several interfaces.




A class may inherit only one abstract class.




Default implementation




An interface cannot provide any code, just the signature.




An abstract class can provide complete, default code and/or just the details that have to be overridden.


Access Modfiers An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public An abstract class can contain access modifiers for the subs, functions, properties


Core VS Peripheral




Interfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit from a IMovable interface.




An abstract class defines the core identity of a class and there it is used for objects of the same type.




Homogeneity




If various implementations only share method signatures then it is better to use Interfaces.




If various implementations are of the same kind and use common behaviour or status then abstract class is better to use.




Speed




Requires more time to find the actual method in the corresponding classes.




Fast




Adding functionality (Versioning)




If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.




If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.


Fields and Constants No fields can be defined in interfaces An abstract class can have fields and constrants defined
Read More

Monday, April 18, 2011

Inverview at HCL


Technical Interview.


Q: What is difference between abstract factory and factory method.
A: http://dotnetacademy.blogspot.com/2011/04/what-is-difference-between-abstract_20.html

Q: What is difference between static class and singleton.
A: http://dotnetacademy.blogspot.com/2011/04/what-is-difference-between-static-class.html

Q: What is difference between abstract class and interface.
A: Difference between interface and interface

Q: Explain situation where will you use abstract class and where will you use interface.
A: Its totally up to requirements. If we have requirement where we just wants particular function to be implemented by other classes then we will place them in interface and in a situation where we have some function which we wants to be implemented by child classes as well as we wants to provide a common functionality to particular function which may/may not be overridden in child class then we will use abstract class.
http://dotnetacademy.blogspot.com/2011/04/what-is-difference-between-abstract.html

Q: Is is possible to change access specifier of members of interface.
A: http://dotnetacademy.blogspot.com/2011/04/is-it-possible-to-change-access.html

Q: What is practical use of Encapsulation in programming.
A: http://dotnetacademy.blogspot.com/2011/04/encapsulation.html

Q: Where is practical implementation of Observer design patterns in .NET framework.
A: http://dotnetacademy.blogspot.com/2011/04/observer-design-pattern-in-net.html

Q: Where the .NET framework has implemented singleton design pattern in its classes.

Q: Provide example where you implemented singleton design pattens in your application.
A: I have personally used it in a class which i made to upload file using FTP to remote server in asp.net. i have created a circular linked list in a singleton class and those classes which wants to send/ftp their files takes its object and add their file to that link list and don't wait for completion of FTP process. its up to my singleton class to do FTP.
so to maintain single linked list (but it can easily maintained by taking a static variable/object but i found singleton class more appropriate for it.

Q: Abstract factory implements factory method or factory methods implements abstract factory.
A: Factory Method implements Abstract Factory means every factory method separately becomes abstract factory.

Q: How will you use component build in vb6/c++ in .NET
A: http://dotnetacademy.blogspot.com/2011/04/how-to-use-vb6-components-in-net.html

Q: What is MVP.
A: http://msdn.microsoft.com/en-us/magazine/cc188690.aspx

Q: What is WCF.
A: http://msdn.microsoft.com/en-us/library/ms731082.aspx

Q: Write a code to create a WCF service.
A: http://www.codeproject.com/KB/WCF/wcf_bohansen.aspx

Q: What is end points in WCF services.
A: http://dotnetacademy.blogspot.com/2011/04/what-is-endpoints-in-wcf-service.html

Q: What is procedure to deploy WCF Service.
A: http://msdn.microsoft.com/en-us/library/aa751792.aspx
http://msdn.microsoft.com/en-us/library/ms733766.aspx

Q: How will you define end points in WCF services.
A: http://msdn.microsoft.com/en-us/library/ms733749.aspx

Q: How will you use WCF services in you application.
A: http://weblogs.asp.net/sreejukg/archive/2010/12/15/create-and-consume-wcf-service-using-visual-studio-2010.aspx
http://dotnetslackers.com/articles/ajax/JSON-EnabledWCFServicesInASPNET35.aspx

Q: What all attributes you will require to set for a function to expose it as a service method in WCF.
A: you will have to set attribute [OperationContract] on every method which you wants to expose as service contract method in WCF service.

Q: Provide difference between WCF and Web services.
A: Mainly-

Web Services

1.It Can be accessed only over HTTP
2.It works in stateless environment

WCF

WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services:
IIS
WAS
Self-hosting
Managed Windows Service

http://www.dotnetspider.com/forum/136895-what-e-difference-between-WCF-webservices-an.aspx


Q: What is SOAP.
A: http://www.soapuser.com/basics1.html
http://webdesign.about.com/od/soap/a/what-is-xml-soap.htm

Q: What is SOA.
A: http://www.whatissoa.com/
http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html

Q: How will you create web service for SOA.
A: http://www.service-architecture.com/
http://www.oracle.com/technetwork/articles/javase/soa-142870.html

Q: Do web service expose contract.
A: Using WSDL web service exposes contract.
http://static.springsource.org/spring-ws/site/reference/html/why-contract-first.html

Q: What is WSDL.
A: http://dotnetacademy.blogspot.com/2011/04/what-is-wsdl.html

Q: What is DISCO.
A: http://dotnetacademy.blogspot.com/2011/04/what-is-disco.html

Q: How to generate WSDL of a web service.
A: using WSDL.EXE
http://msdn.microsoft.com/en-us/library/7h3ystb6(v=vs.71).aspx

Q: How will you generate DISCO of web service using command prompt.
A: http://msdn.microsoft.com/en-us/magazine/cc302073.aspx

Q: What is AJAX and how will you use it in your web page (write code).
A: http://webdesign.about.com/od/ajax/a/aa101705.htm

Q: What all new features introduces in versions of SQL server:
SQL server 7 -> SQL Server 2000 -> SQL Server 2005 -> SQL Server 2008
A: SQL server 7 and Sql Server 2000:
http://itknowledgeexchange.techtarget.com/itanswers/difference-between-sql-server-7-sql-server-2000/

SQL Server 2000 and SQL Server 2005:
Main:
1)In Sql server 2005 Enterprise Manager and Query analizer combined as a sqlserver Management Studio
2)CLR Integration Avaliable
3)XmL Integartion
4)SSIS ,SSRS,SSAS services Avliable
5)DatabaseMail Integration,Notifications Services Avilable
6)Mirroring Avliable
http://www.sqlservercentral.com/articles/Administration/2988/

SQL Server 2005 and SQL Server 2008:
Main:
Transparent Data Encryption. The ability to encrypt an entire database.
Backup Encryption. Executed at backup time to prevent tampering.
External Key Management. Storing Keys separate from the data.
Auditing. Monitoring of data access.
Data Compression. Fact Table size reduction and improved performance.
Resource Governor. Restrict users or groups from consuming high levels or resources.
Hot Plug CPU. Add CPUs on the fly.
Performance Studio. Collection of performance monitoring tools.
Installation improvements. Disk images and service pack uninstall options.
Dynamic Development. New ADO and Visual Studio options as well as Dot Net 3.
Entity Data Services. Line Of Business (LOB) framework and Entity Query Language (eSQL)
LINQ. Development query language for access multiple types of data such as SQL and XML.
Data Synchronizing. Development of frequently disconnected applications.
Large UDT. No size restriction on UDT.
Dates and Times. New data types: Date, Time, Date Time Offset.
File Stream. New data type VarBinary(Max) FileStream for managing binary data.
Table Value Parameters. The ability to pass an entire table to a stored procedure.
Spatial Data. Data type for storing Latitude, Longitude, and GPS entries.
Full Text Search. Native Indexes, thesaurus as metadata, and backup ability.
SQL Server Integration Service. Improved multiprocessor support and faster lookups.
MERGE. TSQL command combining Insert, Update, and Delete.
SQL Server Analysis Server. Stack improvements, faster block computations.
SQL Server Reporting Server. Improved memory management and better rendering.
Microsoft Office 2007. Use OFFICE as an SSRS template. SSRS to WORD.
SQL 200 Support Ends. Mainstream Support for SQL 2000 is coming to an end.
http://www.microsoft.com/sqlserver/2008/en/us/default.aspx

Q: What is difference between Stored Procedure and Functions.
A: http://chiragrdarji.wordpress.com/2007/04/17/difference-between-user-defined-function-and-stored-procedure/

Q: How many type of functions available in sql server.
A: http://chiragrdarji.wordpress.com/2007/04/17/difference-between-user-defined-function-and-stored-procedure/

Q: Write queries how will you use all type of functions in sql server.
A: http://chiragrdarji.wordpress.com/2007/04/17/difference-between-user-defined-function-and-stored-procedure/

Q: Create a Non-Normalized table and then convert it to all normalization forms one by one.
A: Please do this by your self. you will find it very interesting.

Q: Write a code to load a XML file and retrieve its attribute's value using XPath.
A: Step 1. add System.XML namespace.
Step 2. load xml document.
Step 3. Use XPath to fatch relevant record.
like:- xdoc.selectsinglenode("//rootelementname/childelementname[@attributename ='']);
http://www.w3schools.com/xpath/xpath_syntax.asp

http://www.java2s.com/Code/ASP/XML/ReadinganXMLFileandattributesusingXmlReader.htm



Q: What is difference between Delegates and Events.
A: http://www.ikriv.com/en/prog/info/dotnet/Delegates.html
http://blog.monstuff.com/archives/000040.html

Q: What is HLD and LLD.
A: High Level Design (HLD) is the overall system design - covering the system architecture and database design. It describes the relation between various modules and functions of the system. data flow, flow charts and data structures are covered under HLD.

Low Level Design (LLD) is like detailing the HLD. It defines the actual logic for each and every component of the system. Class diagrams with all the methods and relation between classes comes under LLD. Programs specs are covered under LLD.

Q: What is difference between association and aggregation.
A: http://javapapers.com/oops/association-aggregation-composition-abstraction-generalization-realization-dependency/

Q: What is difference between aggregation and composition.
A: http://javapapers.com/oops/association-aggregation-composition-abstraction-generalization-realization-dependency/

PM Round

Q: How will you distribute work in your team. what parameters you will take care while doing so.
A: Please don't accept from me to answer this question :). its totally up to u.

Q: What all things will you take care while interacting with client.
A:

Q: If you are to make your team, work for late night then how will you make them ready.
A: Please don't accept from me to answer this question :)

Q: What is use of XML.
A: As xml is text based language so it becomes platform independent, which makes it best to be used in data transfer on web. it has functionality to define rules in DTD/XSD and we can easily apply and parse it against rules. Its easy to query using XPath. We can create business specific tags and also encrypt it.
http://webdesign.about.com/od/xml/a/aa060401a.htm

Q: What all documentation are needed in CMM level 5 company.
A: will answer it after joining CMM 5 :)

Q: How will you design HLD and LLD.
A: wait for next 2 Weeks :)

Q: How many people were there in your team which you have handled.
A: Well its about u.


Compiled By Rajesh Rolen

Read More

Friday, April 15, 2011

Common Interview Questions



Tell me about yourself:

The most often asked question in interviews. You need to have a short statement prepared in your mind. Be careful that it does not sound rehearsed. Limit it to work-related items unless instructed otherwise. Talk about things you have done and jobs you have held that relate to the position you are interviewing for. Start with the item farthest back and work up to the present.

Why did you leave your last job?

Stay positive regardless of the circumstances. Never refer to a major problem with
management and never speak ill of supervisors, co-workers or the organization. If you do, you will be the one looking bad. Keep smiling and talk about leaving for a positive reason such as an opportunity, a chance to do something special or other forward-looking reasons.

What experience do you have in this field?

Speak about specifics that relate to the position you are applying for. If you do not have specific experience, get as close as you can.

Do you consider yourself successful?

You should always answer yes and briefly explain why. A good explanation is that you have set goals, and you have met some and are on track to achieve the others.

What do co-workers say about you?

Be prepared with a quote or two from co-workers. Either a specific statement or a
paraphrase will work. Jill Clark, a co-worker at Smith Company, always said I was the hardest workers she had ever known. It is as powerful as Jill having said it at the interview herself.

What do you know about this organization?

This question is one reason to do some research on the organization before the interview. Find out where they have been and where they are going. What are the current issues and who are the major players?

What have you done to improve your knowledge in the last year?

Try to include improvement activities that relate to the job. A wide variety of activities can be mentioned as positive self-improvement. Have some good ones handy to mention.

Are you applying for other jobs?

Be honest but do not spend a lot of time in this area. Keep the focus on this job and what you can do for this organization. Anything else is a distraction.

Why do you want to work for this organization?

This may take some thought and certainly, should be based on the research you have done on the organization. Sincerity is extremely important here and will easily be sensed. Relate it to your long-term career goals.

Do you know anyone who works for us?

Be aware of the policy on relatives working for the organization. This can affect your answer even though they asked about friends not relatives. Be careful to mention a friend only if they are well thought of.

What kind of salary do you need?

A loaded question. A nasty little game that you will probably lose if you answer first. So, do not answer it. Instead, say something like, That's a tough question. Can you tell me the range for this position? In most cases, the interviewer, taken off guard, will tell you. If not, say that it can depend on the details of the job. Then give a wide range.

Are you a team player?

You are, of course, a team player. Be sure to have examples ready. Specifics that show you often perform for the good of the team rather than for yourself are good evidence of your team attitude. Do not brag, just say it in a matter-of-fact tone. This is a key point.

How long would you expect to work for us if hired?

Specifics here are not good. Something like this should work: I'd like it to be a long time. Or As long as we both feel I'm doing a good job.

Have you ever had to fire anyone? How did you feel about that?

This is serious. Do not make light of it or in any way seem like you like to fire people. At the same time, you will do it when it is the right thing to do. When it comes to the organization versus the individual who has created a harmful situation, you will protect the organization. Remember firing is not the same as layoff or reduction in force.

What is your philosophy towards work?

The interviewer is not looking for a long or flowery dissertation here. Do you have strong feelings that the job gets done? Yes. That's the type of answer that works best here. Short and positive, showing a benefit to the organization.

If you had enough money to retire right now, would you?

Answer yes if you would. But since you need to work, this is the type of work you prefer. Do not say yes if you do not mean it.

Have you ever been asked to leave a position?

If you have not, say no. If you have, be honest, brief and avoid saying negative things about the people or organization involved.

Explain how you would be an asset to this organization

You should be anxious for this question. It gives you a chance to highlight your best points as they relate to the position being discussed. Give a little advance thought to this relationship.

Why should we hire you?

Point out how your assets meet what the organization needs. Do not mention any other
candidates to make a comparison.

Tell me about a suggestion you have made

Have a good one ready. Be sure and use a suggestion that was accepted and was then
considered successful. One related to the type of work applied for is a real plus.

What irritates you about co-workers?

This is a trap question. Think real hard but fail to come up with anything that irritates you. A short statement that you seem to get along with folks is great.

What is your greatest strength?

Numerous answers are good, just stay positive. A few good examples:
Your ability to prioritize, Your problem-solving skills, Your ability to work under pressure, Your ability to focus on projects, Your professional expertise, Your leadership skills, Your positive attitude .

Tell me about your dream job.

Stay away from a specific job. You cannot win. If you say the job you are contending for is it, you strain credibility. If you say another job is it, you plant the suspicion that you will be dissatisfied with this position if hired. The best is to stay genetic and say something like: A job where I love the work, like the people, can contribute and can't wait to get to work.

Why do you think you would do well at this job?

Give several reasons and include skills, experience and interest.

What are you looking for in a job?



What kind of person would you refuse to work with?

Do not be trivial. It would take disloyalty to the organization, violence or lawbreaking to get you to object. Minor objections will label you as a whiner.

What is more important to you: the money or the work?

Money is always important, but the work is the most important. There is no better answer.

What would your previous supervisor say your strongest point is?

There are numerous good possibilities:
Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise, Initiative, Patience, Hard work, Creativity, Problem solver

Tell me about a problem you had with a supervisor

Biggest trap of all. This is a test to see if you will speak ill of your boss. If you fall for it and tell about a problem with a former boss, you may well below the interview right there. Stay positive and develop a poor memory about any trouble with a supervisor.

What has disappointed you about a job?

Don't get trivial or negative. Safe areas are few but can include:
Not enough of a challenge. You were laid off in a reduction Company did not win a contract, which would have given you more responsibility.

Tell me about your ability to work under pressure.

You may say that you thrive under certain types of pressure. Give an example that relates to the type of position applied for.

Do your skills match this job or another job more closely?

Probably this one. Do not give fuel to the suspicion that you may want another job more than this one.

What motivates you to do your best on the job?

This is a personal trait that only you can say, but good examples are:
Challenge, Achievement, Recognition

Are you willing to work overtime? Nights? Weekends?

This is up to you. Be totally honest.

How would you know you were successful on this job?

Several ways are good measures:
You set high standards for yourself and meet them. Your outcomes are a success.Your boss tell you that you are successful

Would you be willing to relocate if required?

You should be clear on this with your family prior to the interview if you think there is a chance it may come up. Do not say yes just to get the job if the real answer is no. This can create a lot of problems later on in your career. Be honest at this point and save yourself future grief.

Are you willing to put the interests of the organization ahead of your own?

This is a straight loyalty and dedication question. Do not worry about the deep ethical and philosophical implications. Just say yes.

Describe your management style.

Try to avoid labels. Some of the more common labels, like progressive, salesman or
consensus, can have several meanings or descriptions depending on which management
expert you listen to. The situational style is safe, because it says you will manage according to the situation, instead of one size fits all.

What have you learned from mistakes on the job?

Here you have to come up with something or you strain credibility. Make it small, well intentioned mistake with a positive lesson learned. An example would be working too far ahead of colleagues on a project and thus throwing coordination off.

Do you have any blind spots?

Trick question. If you know about blind spots, they are no longer blind spots. Do not reveal any personal areas of concern here. Let them do their own discovery on your bad points. Do not hand it to them.

If you were hiring a person for this job, what would you look for?

Be careful to mention traits that are needed and that you have.

Do you think you are overqualified for this position?

Regardless of your qualifications, state that you are very well qualified for the position.

How do you propose to compensate for your lack of experience?

First, if you have experience that the interviewer does not know about, bring that up: Then, point out (if true) that you are a hard working quick learner.

What qualities do you look for in a boss?

Be generic and positive. Safe qualities are knowledgeable, a sense of humor, fair, loyal to subordinates and holder of high standards. All bosses think they have these traits.

Tell me about a time when you helped resolve a dispute between others.

Pick a specific incident. Concentrate on your problem solving technique and not the dispute you settled.

What position do you prefer on a team working on a project?

Be honest. If you are comfortable in different roles, point that out.

Describe your work ethic.

Emphasize benefits to the organization. Things like, determination to get the job done and work hard but enjoy your work are good.

What has been your biggest professional disappointment?

Be sure that you refer to something that was beyond your control. Show acceptance and no negative feelings.

Tell me about the most fun you have had on the job.

Talk about having fun by accomplishing something for the organization.

Do you have any questions for me?

Always have some questions prepared. Questions prepared where you will be an asset to the organization are good. How soon will I be able to be productive? and What type of projects will I be able to assist on? are examples.

Rajesh Rolen

Read More

Thursday, April 7, 2011

Create CSV/Excel file in C#


Export GridView data in Excel

Export datatable's data in Excel

Export Data in Excel using Asp.net

using below code you can export data in .csv file which can be opened in excel.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.Text;

/// 
/// Summary description for csvexport
/// 
public class CSVExporter
{
    
    public static void WriteToCSV(List personList)
    {
        string attachment = "attachment; filename=PersonList.csv";
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.AddHeader("content-disposition", attachment);
        HttpContext.Current.Response.ContentType = "text/csv";
        HttpContext.Current.Response.AddHeader("Pragma", "public");
        WriteColumnName();
        foreach (Person person in personList)
        {
            WriteUserInfo(person);
        }
        HttpContext.Current.Response.End();
    }

    private static void WriteUserInfo(Person person)
    {
        StringBuilder stringBuilder = new StringBuilder();
        AddComma(person.name , stringBuilder);
        AddComma(person.address , stringBuilder);       
        HttpContext.Current.Response.Write(stringBuilder.ToString());
        HttpContext.Current.Response.Write(Environment.NewLine);
    }

    private static void AddComma(string value, StringBuilder stringBuilder)
    {
        stringBuilder.Append(value.Replace(',', ' '));
        stringBuilder.Append(", ");
    }

    private static void WriteColumnName()
    {
        string columnNames = "RegistrationType, Value";
        HttpContext.Current.Response.Write(columnNames);
        HttpContext.Current.Response.Write(Environment.NewLine);
    }
}
public class Person
{
    public string name;
    public string address;
    public Person()
    {

    }
    public Person( string name , string address)
    {
        this.name = name;
        this.address = address;
    }
}


Solution By: Rajesh Rolen

Read More

Monday, April 4, 2011

What is use of === and !== in javascript

=== and !== are strict comparison operators:

JavaScript has both strict and type-converting equality comparison. For strict equality the objects being compared must have the same type and:

Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions.
Two numbers are strictly equal when they are numerically equal (have the same number value). NaN is not equal to anything, including NaN. Positive and negative zeros are equal to one another.
Two Boolean operands are strictly equal if both are true or both are false.
Two objects are strictly equal if they refer to the same Object.
Null and Undefined types are == (but not ===).

References: Comparison Operations

Solution By: Rajesh Rolen

Read More
Powered By Blogger · Designed By Seo Blogger Templates