Wednesday, December 5, 2012

Company Question

Aircom Internation

C++

1) what are the basic concept of OOPS
2) What is Polymorphism
3) What is compile time Polymorphism
4)  is template compile time Polymorphism
5)  What is difference  between shallow copy and deep copy
6)  What is singleton pattern.Can you write code for that
7)  What is facade pattern.
8)  What is observer pattern
9)  What is virtual inheritance
9)  What is diamond shape problem
10) if base class one virtual function and derived class also contain virtual function.How many vtable create
11) When is vtable create ?
12) When is vpointer create ?
13) Can you explain vtable
14) Can you explain the compilation process
15) How the executable execute into system
16) What is the reason behind to decide default argument as trailer argument
17) Why do we need function overloading?
18) Why do we need function overriding?
19) Why do you need static object?.
20) What is static function?.
21) if Class B is Friend of A.Class C is Friend of B.What is the relation between A to C


Linux
1) what is sed command
2) what is awk command
3) what is tee command
4) what is difference between grep and find command
5) what is make file rule
6) Find the list of all file which does not contain particular string
7) what is touch command
8) what is main purpose of touch command
9) How will you copy from one machine to another machine
10)how will you delete a line in vi editor
11)How will you delete a word in vi editor
12)How will you delete a single character in vi editor
13)How will you execute a shell command within vi editor.(i.e) you have already
 open file than after you want to execute shell command. How will you execute
 shell command
14)How will you find a string into only particular directory and not recursive directory
15) what is max depth into Linux command
16)How will you search a particular word into vi editor
17)How will you do substitution into vi editor

Thursday, November 1, 2012

Memory Management in c++

http://www.hpl.hp.com/personal/Hans_Boehm/gc/myths.ps

http://www.codeproject.com/Articles/1669/A-Generational-Garbage-Collector-in-C

 http://www.codeproject.com/Articles/4160/Automatic-Garbage-Collection-in-C-using-Smart-poin

Gcov Code Coverage Tool.

Gcov Coverage:
http://codingfreak.blogspot.in/2009/02/gcov-analyzing-code-produced-with-gcc.html

Linux wiki
http://gcc.gnu.org/onlinedocs/gcc/Gcov.html

Error :undefined symbol: __gcov_merge_add (solution)
http://stackoverflow.com/questions/566472/where-are-the-gcov-symbols

Configure
http://www.codecoffee.com/tipsforlinux/articles/27.html

Lcov
http://ltp.sourceforge.net/coverage/lcov.php

Tuesday, September 18, 2012

Managerial Question

Monday, June 4, 2012

Reference Material

C++
1. C++ FAQ
2. Test you skill in C++
3. Test you C skill
4. www.learncpp.com/
5. http://www.cppcoffe.blogspot.in/
6. http://www.geeksforgeeks.org/
7. http://www.tutorialspoint.com/cplusplus
8. Effective C++
9. http://c-pointer.blogspot.in/
10. http://www.careercup.com/



Data Structure
1.Data Structures ( a pseudocode approach with c++)
2.Data Structure and algorithm made easy
3.Cracking coding interview
4. http://www.geeksforgeeks.org/
5. googlegeeks group
6. http://www.careercup.com/
7. IIT delhi video lecture
8. Standford Data Structure Class
9. MIT open course Data Structure
10.Introduction to Algorithum 


DataBase
1.Crack IT interview DataBase
2. http://www.programmerinterview.com/index.php/database-sql/what-is-an-index/
3. http://sql-plsql.blogspot.in/2009/04/sql-interview-questions.html

4. http://www.orafaq.com/faq/what_are_the_difference_between_ddl_dml_and_dcl_commands
5. http://www.1keydata.com/sql/sql.html 
6. http://plsql-tutorial.com/index.htm

7. http://www.sqlcourse.com/index.html (online Compiler)
8. http://www.java2s.com/Tutorial/Oracle/CatalogOracle.htm 
9. http://apex.oracle.com/i/index.html

Unix Reference:
1.Crack IT interview with Unix DataBase
2.http://www.folkstalk.com/2011/11/top-unix-interview-questions-part-1.html 
3.www.thegeekstuff.com/2010/11/50-linux-commands/
4.http://faq.programmerworld.net/networking/unix-interview-questions-answers.html

5.linux.101hacks.com/linux-commands/cut-command-examples/
6.http://www.gointerviews.com/top-50-linux-interview-questions/ 
7.http://www.theunixschool.com/2012/04/linux-interview-questions-part-1.html  


Design Pattern:
1.Head & First Design Pattern (Book)
2.http://sourcemaking.com/design_patterns
3. http://www.javabeat.net/2009/02/design-patterns-interview-questions/
4. http://javarevisited.blogspot.in/2012/06/20-design-pattern-and-software-design.html

System Programming:
1.Galvin -Operating System Concept (7 Edition)
2. Programming with POSIX Threads

Verbal & Reasoning Reference :
1. Wren & Martin English Grammar Book
2. Word Power Made Easy
3.  Barron English Book


Saturday, May 19, 2012

Tree_Program

1.Create_tree

 #include<iostream>  
 #define size 3  
 using namespace std;  
 class node  
 {  
  public:       
  int data;  
  node *left;  
  node *right;  
 };  
 class tree  
 {  
  public:  
  node *root;  
  tree();  
  void create_tree(int data);  
  void inorder_traverse(node *s);  
  void print_data();  
 };  
 tree::tree()  
 {  
      root=NULL;  
 }  
 void tree::create_tree(int data)  
 {  
   node *temp = new node;  
   temp->data = data;  
   temp->left =NULL;  
   temp->right =NULL;  
   if(root ==NULL)  
        root =temp;  
   else  
   {  
       node *p =root;  
       node *trail =NULL;  
      while(p!=NULL)  
       {   
         root=p;  
        if(p->data > data)  
         {  
             p =p->left;  
         }  
         else  
           {  
              p=p->right;  
           }  
       }  
       if(root->data > data)  
       {  
         root->left =temp;  
       }  
       else  
       {        
         root->right = temp;  
       }  
   }  
 }  
 void tree::inorder_traverse(node *s)  
 {   
    if(s)       
    {  
         inorder_traverse(s->left);  
         cout<<s->data<<"  ";  
         inorder_traverse(s->right);  
    }  
 }  
 void tree::print_data()  
 {  
      inorder_traverse(root);  
 }  
 int main()  
 {  
  int data;  
  tree t;  
  for(int i=0;i<3;i++)  
  {  
      cout<<"Enter data";  
       cin>>data;  
       t.create_tree(data);  
  }  
  cout<<"inorder: traverse :"<<endl;  
  t.print_data();  
  return 0;  
 }  
Create_tree with level_order_traversal
 #include<iostream>  
 using namespace std;  
 class node  
 {   
   public:       
   int data;  
   node *left;  
   node *right;  
 };  
 class tree  
 {  
   public:  
   node *root;  
   tree();  
   void create_tree(int data);  
   void print_tree();  
   void tree_level_order_traverse(node *root);  
 };  
 tree::tree()  
 {  
   root =NULL;  
 }  
 void tree::create_tree(int data)  
 {  
   node *temp = new node;  
   temp->data = data;  
   temp->left = NULL;  
   temp->right =NULL;  
   if(root==NULL)  
     root=temp;  
   else  
   {  
    node *p=root;  
    node *trail =NULL;  
    while(p!=NULL)  
    {  
      trail=p;  
       if(p->data > data)  
         p=p->left;  
      else  
         p=p->right;  
    }  
    if(trail->data > data)  
       trail->left = temp;  
    else  
       trail->right = temp;  
   }  
 }  
 void tree::tree_level_order_traverse(node *root)  
 {  
   node *data_store[10] = { (node*)0} ;  
   int size=0;  
   int follow_variable=0;  
   while(root)    
   {  
    cout<<root->data<<" :";  
    if(root->left)  
      data_store[size++]=root->left;  
    if(root->right)  
    data_store[size++]=root->right;  
     root=data_store[follow_variable++];  
   }  
 }  
 void tree::print_tree()  
 {  
      tree_level_order_traverse(root);  
 }  
 int main()  
 {  
   tree t;       
   for(int i=0;i<8;i++)  
       t.create_tree(i);  
   cout<<"create successful"<<endl;  
   t.print_tree();   
   return 0;  
 }  
Tree_header_file
 #include<iostream>  
 using namespace std;  
 class node  
 {  
   public:  
   int data;  
   node *left;  
   node *right;  
 }  
 class tree  
 {  
  public:  
  node *root;  
  tree();  
  void create_tree(int data);  
 };  
 tree::tree()  
 {  
  root =NULL;  
 }  
 void tree::create_tree(int data)  
 {  
      node *temp= new node;  
      temp->data = data;  
      temp->left =NULL;  
      temp->right =NULL;  
      node *p=root;  
      while(p!=NULL)  
      {  
       root =p;  
        if(p->data > data)  
          p=p->left;  
        else  
          p=p->right;  
      }  
      if(root->data > data)  
           root->left = temp;  
      else  
           root->right = temp;  
 }  

Find_Max_Element_without_Recursion

 template<class T>  
 int tree<T>::find_max_element(node *root)  
 {  
  node *queue[10]= {(node*)0};  
  node *p=root;  
  int data;  
  int size=0;  
  int follow_variable =0;  
  int max=0;  
  while(p!=NULL)  
  {  
   if(max < p->data)  
       max = p->data;         
   if(p->left)  
        queue[size++] = p->left;  
   if(p->right)  
        queue[size++] = p->right;  
    p = queue[follow_variable++];  
  }    
    cout<<"the max data :"<<max<<endl;  
  return max;  

Find_Max_Element_with_Recursion

 int tree<T>::find_max_element(node *root)  
 {  
  int root_value;  
  int left;  
  int right;  
  int max =0;  
  if(root!=NULL)  
  {  
    root_value = root->data;  
    left = find_max_element(root->left);  
    right = find_max_element(root->right);  
    if(right > left)  
         max=right;  
    else  
         max=left;  
  if(root_value > max)  
       max=root_value;  
  }  
  return max;  
Reverse_level_order_traverse
 void tree::reverse_level_order(node *root)  
 {  
   node *temp_storage[10]= {(node *)0};  
   int size =0;  
   int flow_variable =0;  
   while(root)  
   {  
    cout<<" "<<root->data;  
    if(root->right)  
    {  
          temp_storage[size++]=root->right;  
    }  
    if(root->left)  
    {  
         temp_storage[size++] = root->left;  
    }   
    root=temp_storage[flow_variable++];  
  }  
 }  

Thursday, April 14, 2011

C++ Program list 2

1. reverse string program
2. Find out the day of a given  date in particular year
3. Print Pascal Triangle
4. To remove same word from the string 
5. we need to find any particular string and replace with convert string
  
reverse string program

/*


* This file contain reverse string program

* */

#include<iostream>
using namespace std;

template<class T>
class str
{
public:
char *p;
str();
void reverse();
void show();
};

template<class T>
str<T>::str()
{
p=new char[20];
cout<<" enter the string"<<endl;
cin>>p;
}

template<class T>
void str<T>::reverse()
{
char temp;
int count=0;
while(p[count]!='\0')
count++;
for(int i=0;i<count/2;i++)
{
temp =p[count-i-1];
p[count-i-1]=p[i];
p[i]=temp;
}
}
template<class T>
void str<T>::show()
{
cout<<p;
}
int main()
{
str<char>s;
s.reverse();
s.show();
return 0;
}

Find out the day of a given  date in particular year
#include<iostream>

#include<string>
#define BASEYEAR 100

using namespace std;
template<class T>
class leap
{
public:
leap();
int leap_year(int year);
long today;
void get_day();
};
template<class T>
leap<T>::leap()
{
today =0;
}
template<class T>
int leap<T>::leap_year(int year)
{
if((year%4==0 && year%100!=0)
(year%400==0))
return 1;

else
return 0;
}

template<class T>
void leap<T>::get_day()
{
int date;
cout<<" Enter date"<<endl;
cin>>date;
int month;
cout<<" Enter month"<<endl;
cin>>month;
int year;
cout<<"Enter year"<<endl;
cin>>year;
string day[]={"sunday","monday","tuesday","wednesday","thursday","friday","saturday"};
int day_of_month[]= {31,28,31,30,31,30,31,31,30,31,30,30};

for(int i=BASEYEAR;i<year-1;i++)
{
if(leap_year(i))
today=today+366;
else
today=today+365;
}

if(leap_year(year))
day_of_month[1]=29;

for(int i=0;i<month-1;i++)
today =today+day_of_month[i];

today+=date;
cout<<"today--->"<<today<<endl;
int wday =today%7;

cout<<" The day is ---->"<<day[wday];
}

Print Pascal Triangle


* Print Pascal Triangle


*

* 1

* 1 1

* 1 2 1

* 1 3 3 1

*

* */

#include<iostream>
using namespace std;
int main()
{
int a[20];
a[0]=1;
int k;
for(int i=0;i<10;i++)
{
int y=0;
for(int j=10;j>=i;j--)
cout<<" ";

for(k=0;k<=i;k++)
{
int p=y+a[k];
y=a[k];
a[k]=p;
cout<<p<<" ";
}

a[k]=0;
cout<<endl;
}
return 0;
}

To remove same word from the string
 
#include<iostream>

using namespace std;

char* word(char *p)
{
char *filter =new char[20];
int count=0;
int i=0;
while(p[count]!='\0')
count++;

for(i=0;p[i]!='\0';i++)
{
for(int j=i+1;p[j]!='\0';j++)
{
if(p[i]==p[j])
{
p[j]=p[j+1];
i=0;
cout<<" inside if block"<<endl;
}
}
}
p[i]='\0';
return p;
}
int main()
{
char *w=new char[20];
cout<<"enter the word"<<endl;
cin>>w;
cout<<word(w);
return 0;
}

/*

* we need to find any particular string and replace with convert string
* Ex.
* hi ss
* abhishek --->ab(hi)shek----->abssshek
*
* */

#include<iostream>

using namespace std;
char *change(char *p,char *find,char *replace)
{
int find_length=0;
while(find[find_length]!='\0')
find_length++;

int replace_length=0;
while(replace[replace_length]!='\0')
replace_length++;

for(int i=0;p[i]!='\0';i++)
{
for(int j=0;p[j]!='\0';j++)
{
if(p[i]==p[j])
{
int k=i;
int j=0;
while(find[j]!='\0')
{
if(p[k++]!=find[j])
break;
j++;
}
if(j==find_length)
{
int re =0;
//if the replace length are same
if(find_length==replace_length)
{
while(replace[re]!='\0')
{
p[i++]=replace[re++];
cout<<p[i]<<endl;
cout<<i<<endl;
}
}
//if the replace lenth are less
if(find_length>replace_length)
{
while(replace[re]!='\0')
p[i++]=replace[re++];

while(p[i]!='\0')
{
p[i]=p[i+2];
i++;
}
}
}
}
}
}
return p;
}
int main()
{
char *p=new char[40];
cout<<"Enter the string"<<endl;
cin>>p;
char *find =new char[40];

cout<<" Enter the find string"<<endl;
cin>>find;
char *replace =new char[40];

cout<<"Enter the replace"<<endl;
cin>>replace;


cout<<" final string "<<change(p,find,replace)<<endl;
return 0;
}





 
 



int main()

{

leap<int> l;

l.get_day();



return 0;

}