Sunday, April 19, 2009

Pal - KK

E
Hum rahe ya na rahe kal
A B
Kal yaad aayenge yeh pal
E
Pal, yeh hain pyaar ke pal
A B
Chal, aa mere sang chal
C#m B A E
Chal, soche kya Chhoti si hai zindagi
C#m B A B
Kal mil jaaye to hogi khushnaseebi

E A B E
Hum rahe ya na rahe, yaad aayenge yeh pal




B C#m B C#m
Shaam ka aanchal odhke aayi
A E
Dekho voh raat suhaani
B C#m B C#m
Aa likh de hum donon milke
A B
Apni yeh prem kahaani

E A B E

Hum rahe ya na rahe, yaad aayenge yeh pal


stanza2
chords similar to previous one...
B C#m B C#m
Aane waali subah jaane
A E
Rang kya laaye deewaani
B C#m B C#m
Meri chaahat ko rakh lena
A B
Jaise koi nishaani

E A B E
Hum rahe ya na rahe, yaad aayenge yeh pal

yaaron - Pal chords

KK
Yaaron
Key: F

Chorus
------

F Bb F Bb
yaaro.N dostee ba.Dee hee ha seen hai ye naa

F Bb F Bb
ho to kyaa phir bolo ye zinda gee hai koee

F F/A Bb F F/A Bb
to ho raazdaa r bega raz teraa ho yaar koee

F F/A F
to ho raaz daar


F Bb F Bb
yaaro.N mohabbat hee to banda gee hai ye naa

F Bb F Bb
ho to kyaa phir bolo ye zinda gee hai koee

F F/A Bb F F/A Bb
to dilbar ho yaar jis ko tujhse ho pyaar koee

F F/A F
to dilbar ho yaar

Verse 1
-------

Dm Am Bb F
teree har ek buraayee pe daa.NTe wo dost

Dm Am Bb F
gam kee ho dhoop to saayaa bane teraa wo dost

Bb Am Gm F
naache bhee wo teree khu shee me.N arE

Chorus
------

F Bb F Bb
yaaro.N dostee ba.Dee hee ha seen hai ye naa

F Bb F Bb
ho to kyaa phir bolo ye zinda gee hai koee

F F/A Bb F F/A Bb
to ho raazdaa r bega raz teraa ho yaar koee

F F/A F
to ho raaz daar

Verse 2
-------

Dm Am Bb F
tan man kare tujhpe fidaa mahboob wo

Dm Am Bb F
palko.N pe jo rakhe tujhe mahboob wo

Bb Am Gm F
jiskee wafaa tere liye ho arE

Chorus
------

F Bb F Bb
yaaro.N mohabbat hee to banda gee hai ye naa

F Bb F Bb
ho to kyaa phir bolo ye zinda gee hai koee

F F/A Bb F F/A Bb
to dilbar ho yaar jis ko tujhse ho pyaar koee

F F/A Bb
to dilbar ho yaar

Dil De Diya hai....Masti Chords



This is one of my favorite songs. I tried playing it and it sounds good. Let me know if you find any problems with it. Thanks for visiting....





----------Cm
Dil de diya hai
A#-------
jaan tumhe denge

Cm------Cm
dil de diya hai
A#-------
jaan tumhe denge
G#-----------------Cm
dagaa nahi karenge sanam

------------A#--( D# also seems good here)
hoooo....rabb di kasam ...
--------------Cm
yaara rabb di kasam
(repeat once mukhra)




Cm-----------------------G#
rukh zindagi ne mod liya kaisa

---------A#----------------Cm
humne socha nahi tha kabhi aisa

Cm-----------------------G#
rukh zindagi ne mod liya kaisa

---------A#----------------Cm
humne socha nahi tha kabhi aisa

Cm-----------G#--
aata nahi yakeen

-------A#-------Cm
kya se kya ho gayaa
Cm-------G#-----A#----------Cm--
kis tarah main tumse bewafaa ho gayaa

Cm-------Cm
insaaf kar do

A#
mujhe maaf kar do

G#--------------Cm
itna hee kar do karam

Cm------Cm
dil de diya hai

A#--
jaan tumhe denge

G#-----------------Cm
dagaa nahi karenge sanam



(following stanzas are also like previous one)

Awaargi mein ban gaya diwaana
Cm-----------------------G#

Maine kyun saadgi ko nahin jaana
---------A#----------------Cm

Awaargi mein ban gaya diwaana
Cm-----------------------G#

Maine kyun saadgi ko nahin jaana
---------A#----------------Cm

Chaahat yahi hai ke, is qadar pyaar doon
Cm-------------------------------G#

Qadmon mein tere main, toh jahaan waar doon
--------A#----------------------------Cm

Chain mera le lo, khushi meri le lo
Cm-----------------------A#

De do mujhe dedo saare gham
---------G#----------------Cm


Dil de diya hai, jaan tumhein denge
Cm-----------------------A#

Daga nahin karenge sanam
---------G#----------------Cm

Mere ashq keh rahe meri kahaani
Cm--------------------------G#

Inhein samjho na tum sirf paani) -2
A#-----------------------------Cm

Ro ro ke aansuon ke daag dhool jaayenge
Cm-------------------------------A#

In mein wafa ke rang, aaj ghool jaayenge
G#-------------------------------Cm

Paas tum rahogi, bhool ab na hogi
Cm---------------------------A#

Karoonga na tumpe sitam
G#----------------------Cm

Dil de diya hai, jaan tumhein denge
Daga nahin karenge sanam
Ho...rab di kasam yaara, rab di kasam
(Dil de diya hai, jaan tumhein denge
Daga nahin karenge sanam) -2

Tuesday, April 14, 2009

New C++ questions....

Surprisingly the number of interview questions posts have increased since I am appearing for a number of interviews..... but surely this helps me and I hope that it will help some other people too.


1. Tell me the fundamentals of OOPS.

--> Encapsulation, Inheritance, Polymorphism. Define them.

Surprisingly I was asked that I missed abstraction. I believe it is a generic term for encapsulation.


2. Implementation of polymorphism in recent projects...

Implemented the Logger class to log all the install scripts as well as other database related scripts.


3. What kind of polymorphism did you implement in the recent projects?

--> Run time polymorphism.


4. Explain operator overloading.


5. What is a virtual funtion?


6. What are memory leaks?


7. What is a function pointer?


8. What is a VPT (Virtual Pointer Table)?


--> The virtual table is actually quite simple, though it’s a little complex to describe in words. First, every class that uses virtual functions (or is derived from a class that uses virtual functions) is given it’s own virtual table. This table is simply a static array that the compiler sets up at compile time. A virtual table contains one entry for each virtual function that can be called by objects of the class. Each entry in this table is simply a function pointer that points to the most-derived function accessible by that class.


9. What is a smart pointer?


-->Smart pointers are objects which store pointers to dynamically allocated (heap) objects. They behave much like built-in C++ pointers except that they automatically delete the object pointed to at the appropriate time. Smart pointers are particularly useful in the face of exceptions as they ensure proper destruction of dynamically allocated objects. They can also be used to keep track of dynamically allocated objects shared by multiple owners.

Friday, April 3, 2009

C++/Perl/Bash/Python questions

As usual some interview questions and answers that I encountered in one of the telephonic ones.

1. What is the difference between Bash/Shell, perl, python scripting languages?

--> Perl and Python can be used for web based scripting while bash cannot be used.
--> Easy portability for perl and python since both are platform independent while bash is not.
--> Various flavors of shell scripting, bash, korn, ksh, etc.

2. Why is a virtual constructor not possible?

A constructor cannot be virtual because at the time when the constructor is invoked, the virtual table would not be available in the memory. Hence we cannot have a virtual constructor.

3. Can we have an array of references?

No we cannot have an array of references because references cannot be null as pointers can be. Once a reference is created, it cannot be later made to reference another object. We can say it cannot be reseated which is often done with pointers.

References cannot also be uninitialized.

4. Describe the callback function syntax.


5. What is the difference between exec() and system() in perl/bash?

exec() executes in the same shell while system() executes in another shell.

6. Define a constructor and how it might be called.

Constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized.

There are two ways of calling a constructor

1. Implicitly - automatically by compiler when an object is created.
2. Explicitly - Calling the constructors explicitly is possible but it makes code unverifiable.

class Point
{
int x,y;
public:
Point():x(0),y(0) {} // Default constructor with no arguments
};

void main()
{
Point MyPoint; // Implicit constructor call. In order to allocate memory on stack, the default constructor is implicitly called.
Point *pPoint = new Point(); //Explicit constructor call. In order to allocate memory on heap we call the default constructor.


What is a modifier?

A modifier, also called a modifying function is a member function that changes the value of at least one data member. In other words, an operation that modifies the state of an object. Modifiers are also known as ‘mutators’. Example: The function mod is a modifier in the following code snippet:

class test
{
int x,y;
public:
test()
{
x=0; y=0;
}
void mod()
{
x=10;
y=15;
}
};

What is an accessor?

An accessor is a class operation that does not modify the state of an object. The accessor functions need to be declared as const operations
Differentiate between a template class and class template.
Template class: A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates. Class template: A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It’s jargon for plain classes

Differentiate between a template class and class template.

Template class: A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates. Class template: A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It’s jargon for plain classes.

What is a const method?

Marking a method as const signs a contract with the client code guaranteeing that you will not try to change the internal values of the object within the method.


If you try to declare a method const that actually modifies a data member, the compiler will complain.
You cannot declare a static method const because it is redundant.
Static methods do not have an instance of the class so it would be impossible for them to change internal values.
const works by making it appear inside the method that you have a const reference to each data member. Thus, if you try to change the data member the compiler will flag an error.

A non-const object can call const and no-const methods. However, a const object can only call const methods.

Syntax of a const method:

double SpreadSheetCell::getValue() const
{
return(mValue);
}

string SpreadSheetCell::getString() const
{
return (mString);
}

One should not get into the habit of declaring const all methods that don't modify the object so that you can use references to const objects in your program.

Note that const objects can still be destroyed, and their destructor can be called. You shouldn't try to mark the destructor const.