Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

Wednesday, 12 February 2014

Freshers walkin

Good News to all the Freshers............. 

Wings International Conducting a Mega Job Fair in Association with Light House Educational Society.....

Quf : Any Degree / Any P.G./B.E/B.Tech 2013/2012
Job Fair Date : 23.02.2013
Reg Fee : Rs. 200/-

Participating Companies :

Snippet Technologies Pvt Ltd, Hyderabad for B.Tech/MCA
Pranava Technologies, Hyderabad for B.Tech/MCA
Streamline Technologies for B.Tech/MCA
IBM Tech Support for Any Graduate

Sunday, 29 September 2013

Interviews

Our Page  https://www.facebook.com/shivashankar4u?ref=tn_tnmn

29 Sept Jobs
• Walk In @ Infosys BPO : Process Executive (voice) : BE, B.Tech, B.Sc, B.Com, BBA, BCA, BA : On 20th September to 31st October 2013
http://www.indiajobsworld.com/2013/09/walk-in-infosys-bpo-process-executive.html
• Walk In @ Capita India For Freshers : BA/B.Com/BCA/B.Sc/BBA/BHM : On 30th September to 4th October 2013
http://www.indiajobsworld.com/2013/09/walk-in-capita-india-for-freshers.html
• Walk In @ Syntel : B.com 2012 & 2013 Batch : Trainee : Mumbai : On 30th September,2013
http://www.indiajobsworld.com/2013/09/walk-in-syntel-bcom-2012-2013-batch.html
• Walk-In @ Nimbus Systems Pvt Ltd For Trainee / Junior – Software Developer / Technical Consultant On 29th September 2013
http://www.indiajobsworld.com/2013/09/walk-in-nimbus-systems-pvt-ltd-for.html
• Walk In @ Spice Jet Limited : Cabin Crew : On 29th September,2013
http://www.indiajobsworld.com/2013/09/walk-in-spice-jet-limited-cabin-crew-on.html
• Multi Industry Job Fair For Freshers & Experienced : Multiple Companies : Multiple Positions On 28th & 29th September 2013
http://www.indiajobsworld.com/2013/09/multi-industry-job-fair-for-freshers.html
• Walk In @ Amazon : Customer Service Associate : On 28th-29th September,2013 @ Hyderabad

Wednesday, 25 September 2013

Walk-in links

Walk-ins 
Every fresher / experince candidate who are looking for they should visit these links at least twice per day . Then there is a chance of getting job in present situation . if you fallow all these links at least you will get one opportunity which suites for your career .. 

Monday, 15 July 2013

LINKS FOR ALL THE MATERIALS

DOWNLOAD LINK FOR ALL THE MATERIALS


So here's is the first material for all you guys, directly download all the materials from the direct links.
  
  
i will keep on updating the Doc and will continuously keep adding the materials for you guys

(1) UNIX COMMANDS

http://www.mediafire.com/?4ya05l3ugwmgt7j

Friday, 7 September 2012

Differences Between C And C++

Differences Between C And C++

C++, as the name suggests is a superset of C. As a matter of fact, C++ can run most of C code while C cannot run C++ code. Here are the 10 major differences between C++ & C.

1. C follows the procedural programming paradigm while C++ is a multi paradigmlanguage(procedural as well as object oriented)

In case of C, importance is given to the steps or procedure of the program while C++ focuses on the data rather than the process.
Also, it is easier to implement/edit the code in case of C++ for the same reason.

2. In case of C, the data is not secured while the data is secured(hidden) in C++
This difference is due to specific OOP features like Data Hiding which are not present in C

3. C is a low-level language while C++ is a middle-level language (Relatively, Please see the discussion at the end of the post)
C is regarded as a low-level language(difficult interpretation & less user friendly) while C++ has features of both low-level(concentration on whats going on in the machine hardware) & high-level languages(concentration on the program itself) & hence is regarded as a middle-level language.

4. C uses the top-down approach while C++ uses the bottom-up approach
In case of C, the program is formulated step by step, each step is processed into detail while in C++, the base elements are first formulated which then are linked together to give rise to larger systems.

5. C is function-driven while C++ is object-driven
Functions are the building blocks of a C program while objects are building blocks of a C++ program.

Thursday, 26 July 2012

C interview Questions


 C Interview Questions 














Thursday, 12 July 2012

Importance Of C


                                                                 C
C is a robust language. means rich set of built in functions and operators  can be used to write any complex program.
Programs written in C are efficent and fast.
There are 32 keywords and several standard functions are available which can be used for developing program.
c is highly portable. this means that c programs written for one computer can be run on another with litte or no modification.
c programing language is structred programming language. means  data can be written in module or function or blocks.
a proper collection of these modules make a complete program.
A simple Program
----------------------------

#include<stdio.h>
main()
{
/* printing begin */
printf(""This is my first program");

}  /* this is main block closed */

Sunday, 8 July 2012

Interview Questions in C language


C INTERVIEW QUESTIONS 
Question: Difference between arrays and pointers?
 Answer: Pointers are used to manipulate data using the address. Pointers use * operator to access the data pointed to by them
 Arrays use subscripted variables to access and manipulate data. Array variables can be equivalently written using pointer expression.

Question: What is the purpose of realloc ( )?
 Answer: The function realloc (ptr,n) uses two arguments. The first argument ptr is a pointer to a block of memory for which the size is to be altered. The second argument n specifies the
new size. The size may be increased or decreased. If n is greater than the old size and if sufficient space is not available subsequent to the old region, the function realloc ( )
may create a new region and all the old data are moved to the new region.

Question: What is static memory allocation and dynamic memory allocation?
Answer: Static memory allocation: The compiler allocates the required memory space for a declared variable. By using the address of operator, the reserved address is obtained and this address may be assigned to a pointer variable. Since most of the declared variable has static memory, this way of assigning pointer value to a pointer variable is known as static memory allocation. Memory is assigned during compilation time.

Dynamic memory allocation: It uses functions such as malloc ( ) or calloc ( ) to get memory dynamically. If these functions are used to get memory dynamically and the values returned by these functions are assigned to pointer variables, such assignments are known as dynamic memory allocation. Memory is assigned during run time.

Question: How are pointer variables initialized?
Answer: Pointer variable are initialized by one of the following two ways
              Ø Static memory allocation
              Ø Dynamic memory allocation

Question: What is a pointer variable?
Answer: A pointer variable is a variable that may contain the address of another variable or any valid address in the memory.

Question: What is a pointer value and address?
Answer: A pointer value is a data object that refers to a memory location. Each memory location is numbered in the memory. The number attached to a memory location is called the address of the location.

Question: What are the advantages of the functions?
Answer :Ø Debugging is easier
Ø It is easier to understand the logic involved in the program
Ø Testing is easier
Ø Recursive call is possible
Ø Irrelevant details in the user point of view are hidden in functions
Ø Functions are helpful in generalizing the program

Question: What is the purpose of main( ) function?
 Answer :The function main( ) invokes other functions within it.It is the first function to be called when the program starts execution.
Ø It is the starting function
Ø It returns an int value to the environment that called the program
Ø Recursive call is allowed for main( ) also.
Ø It is a user-defined function
Ø Program execution ends when the closing brace of the function main( ) is reached.
Ø It has two arguments 1)argument count and 2) argument vector (represents strings passed).
Ø Any user-defined name can also be used as parameters for main( ) instead of argc and argv

Question: What is a function and built-in function?

Binary Tree Operations


 Binary Tree Operations

Traversals of Binary Trees

Common parent-child traversals
Inorder: visit left subtree, visit root, visit right subtree 
Preorder: visit root, visit left, visit right 
Postorder: visit left, visit right, visit root 
private void Inorder(BSTNode root) 
{ 
  if(root != null) { 
    Inorder(root.left);
    Process(root.value);
    Inorder(root.right);
  } 
}
public void Inorder(){
    Inorder(root);
}

private void Preorder(BSTNode root) 
{ 
  if(root != null) {
    Process(root.value);
    Preorder(root.left);
    Preorder(root.right);
  } 
}
public void Preorder(){
    Preorder(root);
}

private void Postorder(BTSNode root)
{ 
  if(root != null) {
    Postorder(root.left);
    Postorder(root.right);
    Process(root.value); 
  } 
}
public void Postorder(){
    Postorder(root);
}

Level order traversal: starting with the root, process all nodes at each level left to right before proceeding to the next level. What data structure will you need to accomplish this?
Note the traversals as implemented in BinaryTreePT.java
 
 
 

Examples of Traversals

Deletion of an entire tree (post order traversal)
void DeleteAll(BTNode cur)
{
    if(cur != NULL) {
        DeleteAll(cur.left);
        DeleteAll(cur.right);
        cur = null;
    }
}






Implementation of isEmpty and isFull


  public boolean isEmpty()
  // Determines whether this BST is empty
  {
    return (root == null);
  }
 
  public boolean isFull()
  // Determines whether this BST is full
  {
    return false;
  }




Number of Nodes

Note difference in code complexity for recursive and nonrecursive solutions
  private int recNumberOfNodes(BSTNode tree)

Saturday, 7 July 2012

c++ Interview Questions


 

1. Introduction:-

This note introduces some simple C++ concepts and outlines a subset of C++ that is easier to learn and use than the full language. Although we originally wrote this note for explaining the C++ used in the Nachos project, I believe it is useful to anyone learning C++. I assume that you are already somewhat familiar with C concepts like procedures, for loops, and pointers; these are pretty easy to pick up from reading Kernighan and Ritchie's ``The C Programming Language.''
I should admit up front that I am quite opinionated about C++, if that isn't obvious already. I know several C++ purists (an oxymoron perhaps?) who violently disagree with some of the prescriptions contained here; most of the objections are of the form, ``How could you have possibly left out feature X?'' However, I've found from teaching C++ to nearly 1000 undergrads over the past several years that the subset of C++ described here is pretty easy to learn, taking only a day or so for most students to get started.
The basic premise of this note is that while object-oriented programming is a useful way to simplify programs, C++ is a wildly over-complicated language, with a host of features that only very, very rarely find a legitimate use. It's not too far off the mark to say that C++ includes every programming language feature ever imagined, and more. The natural tendency when faced with a new language feature is to try to use it, but in C++ this approach leads to disaster.
Thus, we need to carefully distinguish between (i) those concepts that are fundamental (e.g., classes, member functions, constructors) -- ones that everyone should know and use, (ii) those that are sometimes but rarely useful (e.g., single inheritance, templates) -- ones that beginner programmers should be able to recognize (in case they run across them) but avoid using in their own programs, at least for a while, and (iii) those that are just a bad idea and should be avoided like the plague (e.g., multiple inheritance, exceptions, overloading, references, etc).
Of course, all the items in this last category have their proponents, and I will admit that, like the hated goto, it is possible to construct cases when the program would be simpler using a goto or multiple inheritance. However, it is my belief that most programmers will never encounter such cases, and even if you do, you will be much more likely to misuse the feature than properly apply it. For example, I seriously doubt an undergraduate would need any of the features listed under (iii) for any course project (at least at Berkeley this is true). And if you find yourself wanting to use a feature like multiple inheritance, then, my advice is to fully implement your program both with and without the feature, and choose whichever is simpler. Sure, this takes more effort, but pretty soon you'll know from experience when a feature is useful and when it isn't, and you'll be able to skip the dual implementation.

c++ Interview Q and Ans


Question and Answers


This chapter is meant to answer some of the questions that were not discussed in the earlier.


1Q.) What is the difference between structure and class?


First of all there is this common assumption that a structure can only contain data and cannot contain functions. Well, structures can contain member functions as well. Then there is the belief that structures do not have private and public areas. In fact structures also have private and public areas within them. The next assumption is that we cannot have constructors; but even that is possible in structures. You might be thinking that this isn’t true. Check out the example below:


struct counter
{
private:
    int count;


public:
counter( )
{
count=10;
}


void input( )
{
cout<<endl<<"Enter the count : ";
cin>>count;
}


void display( )
{
cout<<endl<<"The count is : "<<count;
}


};


int main( )
{
counter c1;
c1.display( );
c1.input( );
c1.display( );
return 0;
}


The output is:


The count is : 10
Enter the count : 3
The count is : 3


Can we have destructors? Yes, even that is possible in a structure. Well, so what is the difference between a structure and a class? The point to be noted is that structures were actually part of the C language. In C we did not have data encapsulation and neither did we have object oriented programming. But when C++ was developed the capability of structures was extended to such an extent that they were similar to classes. The only difference between a class and a C++ structure is that in a class by default everything is made private. In structures, by default, everything would be public. That’s the only difference between a C++ structure and a class (note the words: "C++ structure").

TCS Sample C Test



This test consists of 50 questions.The Set Code for this paper is D.
1. The C language terminator is
(a) semicolon
(b) colon
(c) period
(d) exclamation mark

2. What is false about the following -- A compound statement is
(a) A set of simple statments
(b) Demarcated on either side by curly brackets
(c) Can be used in place of simple statement
(d) A C function is not a compound statement.

3. What is true about the following C Functions
(a) Need not return any value
(b) Should always return an integer
(c) Should always return a float
(d) Should always return more than one value

4. Main must be written as
(a) The first function in the program
(b) Second function in the program
(c) Last function in the program
(d) Any where in the program

5. Which of the following about automatic variables within a function is correct ?
(a) Its type must be declared before using the variable
(b) Tthey are local
(c) They are not initialised to zero
(d) They are global

6. Write one statement equivalent to the following two statements
x=sqr(a);
return(x);
Choose from one of the alternatives
(a) return(sqr(a));
(b) printf("sqr(a)");
(c) return(a*a*a);
(d) printf("%d",sqr(a));

7. Which of the following about the C comments is incorrect ?
(a) Ccommentscan go over multiple lines
(b) Comments can start any where in the line
(c) A line can contain comments with out any language statements
(d) Comments can occur within comments

8. What is the value of y in the following code?
x=7;
y=0;
if(x=6) y=7;
else y=1;
(a) 7
(b) 0
(c) 1
(d) 6

Monday, 25 June 2012

C,C++ Questions


C,C++ Questions




1. Base class has some virtual method and derived class has a method with the same name. If we initialize the base class pointer with derived
object,. calling of that virtual method will result in which method being called? 

a. Base method
b. Derived method..

Ans. b
2. For the following C program
#define AREA(x)(3.14*x*x)
main()
{float r1=6.25,r2=2.5,a;
a=AREA(r1);
printf("\n Area of the circle is %f", a);
a=AREA(r2);
printf("\n Area of the circle is %f", a);
}

What is the output?

Data Structures interview Questions


Data Structures

                                    HCL
1.What data structes you will use if you want to go to first record from
the last and vice versa?
ans.: doubly linked circular list

2.  given a height balanced tree. If we add one more node , how
    many nodes gets unbalanced ? Ans. 3

3. Given a arbitrary pointer  to an element in a singly linked list?
    what is the time complexity for its deletion . 

Sunday, 17 June 2012

C language Interview Questions

C language FAQ


1. The C language terminator is 
(a) semicolon
(b) colon
(c) period
(d) exclamation mark


2. What is false about the following -- A compound statement is 
(a) A set of simple statments
(b) Demarcated on either side by curly brackets
(c) Can be used in place of simple statement
(d) A C function is not a compound statement.

Monday, 4 June 2012

Data Structure aptitude


ta1.      What is data structure?

A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data.


2.      List out the areas in which data structures are applied extensively?        
Ø  Compiler Design,
Ø  Operating System,
Ø  Database Management System,
Ø  Statistical analysis package,
Ø  Numerical Analysis,
Ø  Graphics,
Ø  Artificial Intelligence,
Ø  Simulation

3.      What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model.
Ø  RDBMS                         – Array  (i.e. Array of structures)
Ø  Network data model      – Graph
Ø  Hierarchical data model – Trees

4.      If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.
      
5.      Minimum number of queues needed to implement the priority queue?
Two. One queue is used for actual storing of data and another for storing priorities.

6.      What is the data structures used to perform recursion?
Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls.
            Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.

7.      What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?
            Polish and Reverse Polish notations.

8.      Convert the expression ((A + B) *  C – (D – E) ^ (F + G)) to equivalent Prefix and Postfix notations.
            Prefix Notation:
            ^ - * +ABC - DE + FG
Postfix Notation:
            AB + C * DE - - FG + ^
9.      Sorting is not possible by using which of the following methods?
            (a) Insertion    
            (b) Selection    
            (c) Exchange     
            (d) Deletion

            (d) Deletion.
Using insertion we can perform insertion sort, using selection we can perform selection sort, using exchange we can perform the bubble sort (and other similar sorting methods). But no sorting method can be done just using deletion.

10.  A binary tree with 20 nodes has            null branches?
            21
            Let us take a tree with 5 nodes (n=5)

 




                                                                                                            




It will have only 6 (ie,5+1) null branches. In general,
            A binary tree with n nodes has exactly n+1 null nodes.

11.  What are the methods available in storing sequential files ?
Ø  Straight merging,
Ø  Natural merging,
Ø  Polyphase sort,
Ø  Distribution of Initial runs.

12.  How many different trees are possible with 10 nodes ?
            1014
            For example, consider a tree with 3 nodes(n=3), it will have the maximum combination of 5 different (ie, 23 - 3 =  5) trees.


 







                        i                       ii                      iii                        iv                       v


            In general:
            If there are n nodes, there exist 2n-n different trees.

13.  List out few of the Application of tree data-structure?
Ø  The manipulation of Arithmetic expression,
Ø  Symbol Table construction,
Ø  Syntax analysis.

14.  List out few of the applications that make use of Multilinked Structures?
Ø  Sparse matrix,
Ø  Index generation.

15.  In tree construction which is the suitable efficient data structure?
            (a) Array           (b) Linked list              (c) Stack           (d) Queue   (e) none

(b) Linked list

16.  What is the type of the algorithm used in solving the 8 Queens problem?
            Backtracking

17.  In an AVL tree, at what condition the balancing is to be done?
            If the ‘pivotal value’ (or the ‘Height factor’) is greater than 1 or less than –1.

18.  What is the bucket size, when the overlapping and collision occur at same time?
            One. If there is only one entry possible in the bucket, when the collision occurs, there is no way to accommodate the colliding value. This results in the overlapping of values.

19.  Traverse the given tree using Inorder, Preorder and Postorder traversals.
 


















Ø  Inorder :    D H B E A F C I G J
Ø  Preorder:   A B D H E C F G I J
Ø  Postorder:  H D E B F I J G C A

20.  There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree?
15.
In general:
            There are 2n-1 nodes in a full binary tree.
By the method of elimination:
Full binary trees contain odd number of nodes. So there cannot be full binary trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete binary tree but not a full binary tree. So the correct answer is 15.
Note:
            Full and Complete binary trees are different. All full binary trees are complete binary trees but not vice versa.

21.  In the given binary tree, using array you can store the node 4 at which location?
 












At location  6

                       
1
2
3
-
-
4
-
-
5
                       
Root
LC1
RC1
LC2
RC2
LC3
RC3
LC4
RC4

where LCn means Left Child of node n and RCn means Right Child  of node n

22.  Sort the given values using Quick Sort?

           
65
70
75
80
85
60
55
50
45

            Sorting takes place from the pivot value, which is the first value of the given elements, this is marked bold. The values at the left pointer and right pointer are indicated using L and R respectively.     

65
70L
75
80
85
60
55
50
45R

Since pivot is not yet changed the same process is continued after interchanging the values at L and R positions

65
45
75 L
80
85
60
55
50 R
70
                       
65
45
50
80 L
85
60
55 R
75
70

65
45
50
55
85 L
60 R
80
75
70


65
45
50
55
60 R
85 L
80
75
70
                       
When the L and R pointers cross each other the pivot value is interchanged with the value at right pointer. If the pivot is changed it means that the pivot has occupied its original position in the sorted order (shown in bold italics) and hence two different arrays are formed, one from start of the original array to the pivot position-1 and the other from pivot position+1 to end.

60 L
45
50
55 R
65
85 L
80
75
70 R

55 L
45
50 R
60
65
70 R
80 L
75
85

50 L
45 R
55
60
65
70
80 L
75 R
85

In the next pass we get the sorted form of the array.

45
50
55
60
65
70
75
80
85


23.  For the given graph, draw the DFS and BFS?
           
 












Ø  BFS:          A X G H P E M Y J

Ø  DFS:         A X H P E Y M J G

24.  Classify the Hashing Functions based on the various methods by which the key value is found.
Ø  Direct method,
Ø  Subtraction method,
Ø  Modulo-Division method,
Ø  Digit-Extraction method,
Ø  Mid-Square method,
Ø  Folding method,
Ø  Pseudo-random method.  

25.  What are the types of Collision Resolution Techniques and the methods used in each of the type?
Ø  Open addressing (closed hashing),
The methods used include:
                        Overflow block,
Ø  Closed addressing (open hashing)
The methods used include:
Linked list,
Binary tree…

26.  In RDBMS, what is the efficient data structure used in the internal storage representation?
            B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes.    

27.  Draw the B-tree of order 3 created by inserting the following data arriving in sequence – 92  24  6  7  11  8  22  4  5  16  19  20  78
 












28.            Of the following tree structure, which is, efficient considering space and time complexities?
(a)   Incomplete Binary Tree
(b)   Complete Binary Tree     
(c)    Full Binary Tree

            (b) Complete Binary Tree.
By the method of elimination:
Full binary tree loses its nature when operations of insertions and deletions are done. For incomplete binary trees, extra storage is required and overhead of NULL node checking takes place. So complete binary tree is the better one since the property of complete binary tree is maintained even after operations like additions and deletions are done on it. 

29.  What is a spanning Tree?
            A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.

30.  Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?
            No.
            Minimal spanning tree assures that the total weight of the tree is kept at its minimum. But it doesn’t mean that the distance between any two nodes involved in the minimum-spanning tree is minimum.

31.  Convert the given graph with weighted edges to minimal spanning tree.
           

 

           







the equivalent minimal spanning tree is:
32.  Which is the simplest file structure?
(a)   Sequential
(b)   Indexed
(c)    Random

(a) Sequential

33.  Whether Linked List is linear or Non-linear data structure?
            According to Access strategies Linked list is a linear one.
            According to Storage Linked List is a Non-linear one.

34.  Draw a binary Tree for the expression :

            A * B - (C + D) * (P / Q)
 

















35.  For the following COBOL code, draw the Binary tree?

01 STUDENT_REC.
     02 NAME.
          03 FIRST_NAME PIC X(10).
                03 LAST_NAME PIC X(10).
           
            02 YEAR_OF_STUDY.
                03 FIRST_SEM PIC XX.
                03 SECOND_SEM PIC XX.