Sunday, August 21, 2011

SORTING COMPLEXITIES

 

SORTING

BEST CASE

AVERAGE CASE

WORST CASE

Insertion Sort

O(n)

O(n2)

O(n2)

Bubble Sort

O(n)

O(n2)

O(n2)

Selection Sort

O(n2)

O(n2)

O(n2)

Quick Sort

O(n log n)

O(n log n)

O(n2)

Merge Sort

O(n log n) typically , O(n)

O(n log n)

O(n log n)

Heap Sort

O(n log n)

O(n log n)

O(n log n)

Radix Sort

O(kn)

O(kn)

O(kn)

Counting Sort

O(n+k)

O(n+k)

O(n+k)

PLACEMENT QUESTIONS–I

 

Here I post some of the placement questions. These are very simple..

Question 1 : Ugly numbers are numbers whose only prime factors are 2, 3 or 5. 
The sequence
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...
shows the first 11 ugly numbers.
By convention, 1 is included.

Write a program to find and print the 1500'th ugly number.
Question 2 : int main()
{
int i, n = 20;
for (i = 0; i < n; i--)
printf("*");
return 0;
}

Change/add only one character and print '*' exactly 20 times.
(there are atleast 3 solutions to this problem)
Question 3 : You are provided with two stacks, and pop() and push() 
functions for them.
You have to implement queue i.e. enqueue() and dequeue() using the
available operations.
Question 4 : How do you reverse the words in a string?

"My name is Ajit Agarwal"
to
"Agarwal Ajit is name My"

A O(n) and 'in space' solution is appreciable.
Question 5 : Given an array of numbers, except for one number all the others, 
occur twice. 
Give an algorithm to find that number which occurs only once in the
array.
Question 6 : There is a series of numbers in ascending order. All these numbers
have the same number of binary 1s in them. Given the number of 1 bits set in
the numbers, write an algorithm/C program to find the nth number in
the series.
Question 7 : Given a string s1 and a string s2, write  a snippet to say 
whether s2 is a rotation of s1 using only one 
call to strstr routine?

(eg given s1 = ABCD and s2 = CDAB, return  true,
given s1 = ABCD, and s2 = ACBD , return false)
Question 8 : 
What's the  "condition" so that the following code
snippet  prints both HelloWorld !

if  "condition"
printf ("Hello");
else
printf("World");

Wednesday, August 10, 2011

TREE PROBLEMS - II

1. Given two trees, return true if they are
structurally identical.

int sameTree(struct node* a, struct node* b) {
  // 1. both empty -> true
  if (a==NULL && b==NULL) return(true);

  // 2. both non-empty -> compare them
  else if (a!=NULL && b!=NULL) {
    return(
      a->data == b->data &&
      sameTree(a->left, b->left) &&
      sameTree(a->right, b->right)
    );
  }
  // 3. one empty, one not -> false
  else return(false);
}

2. code to count number of leaves in the tree

void count_leaf(mynode *root)
{
   if(root!=NULL)
   {
      count_leaf(root->left);
      if(root->left == NULL && root->right==NULL)
      {
        // This is a leaf!
        count++;
      }
      count_leaf(root->right);
   }
}

3. code to create copy of tree


mynode *copy(mynode *root)
{
  mynode *temp;
  if(root==NULL)return(NULL);
  temp = (mynode *) malloc(sizeof(mynode));
  temp->value = root->value;
  temp->left  = copy(root->left);
  temp->right = copy(root->right);
  return(temp);
}

4. code to create mirror copy of tree


mynode *copy(mynode *root)
{
  mynode *temp;
  if(root==NULL)return(NULL);
  temp = (mynode *) malloc(sizeof(mynode));
  temp->value = root->value;
  temp->left  = copy(root->right);
  temp->right = copy(root->left);
  return(temp);
}

5. Implementing level order traversal of a tree

If this is the tree,

        1
   2         3
5   6     7   8

its level order traversal would be

1 2 3 5 6 7 8

void levelOrderTraversal(mynode *root)
{
  mynode *queue[100] = {(mynode *)0}; // Important to initialize!
  int size = 0;
  int queue_pointer = 0;
  while(root)
  {
      printf("[%d] ", root->value);
      if(root->left)
      {
        queue[size++] = root->left;
      }
      if(root->right)
      {
        queue[size++] = root->right;
      }
      root = queue[queue_pointer++];   
  }
}

Friday, April 29, 2011

books for interviews

These are the 2 important books for computer science students who are
attending interview.
1. Programming interview exposed
2. Do the new - career cup



Monday, March 21, 2011

Top 7 Tips to Crack Telephone Interviews

By Sunder Ramachandran

Most organizations are saving time and effort by conducting an initial round of telephonic interview before calling you for a personal round to their office. Given this, your voice and the way you project yourself over the phone can make all the difference.

  1. Visit the employers' website
    Visit the employers' website and learn about the firm. Most companies upload the job specifications in the 'career' or 'work with us' section of the website. This will give you a fair idea about the key skills required for a certain role.
  2. Make notes
    Keep some notes ready about the job description and your key strengths and accomplishments. It's a good idea to keep your resume in front of you as well. Remember, they can't see if you have these documents for review.
  3. Mock calls
    Call a friend from your and ask them to listen to your voice on the phone. Maybe your voice shrills; you speak too softly or too fast to be understood. As for feedback and request them to critique your voice.
  4. Get to the point fast
    The employer is already expecting calls from candidates, so don't waste their time by giving them a reference of where you saw their advertisement or asking them, if there are any openings. Greet them, state your name and get to the point
  5. Keep a note pad and pen ready
    Write down their questions so that you can stay on purpose. Too often, people forget the original question and beat around the bush. Stay on target
  6. Sound energetic
    Your voice is your only sales tool. Don't allow yourself to sound tired or uninterested over the phone. Sound energetic and excited, even if they've asked you the same question again. Keep a glass of water ready next to you.
  7. Be courteous
    Be courteous and try not to speak over the interviewer or cut them off. If you do, say "I apologise for interrupting, please complete your question" and let the interviewer continue

Sunder Ramachandran is a Managing Partner at W.C.H (We Create Headstarts) Solutions - http://www.wchsolutions.com, a Training solutions organisation. He can be reached at sunder@wchsolutions.com

Source: http://Top7Business.com/?expert=Sunder_Ramachandran

link referred : http://top7business.com/?Top-7-Tips-to-Crack-Telephone-Interviews&id=2213

PLACEMENT GUIDE

Subjects need to be studied are:
Basic subject
1. C
2. DS
3. OOPS
4. BASIC CONCEPTS IN THE FOLLOWING CHAPTERS ALSO

Extra Subject
1. ALGORITHM
2. OS
3. DBMS
4. NETWORKS
5. DIGITAL
6. SYSTEM SOFTWARE
7. TOC
8. COMPILER
9. JAVA
10.MICROPROCESSOR
11.SOFT. ENGG
12.OOAD
 Subjects are given in the order of importance. To attend any kind of
company we have to study the all extra subjects also.
 Basic Subjects need to be covered by all, Other subjects are just like
electives (area of interest).
 If we studied all the stuffs no one can overtake us in any company
Stuffs need to be covered in each Subject
· C
 Dennis Ritchie book start to end.
 Aucse questions
 Test your C skills using ‘Yashwanth kanithkar’ book
 String.h (implement all functions in this header)
 Study about memory.h functions
· Data Structure
 Use “Robert kurse” or “Schaum’s series” book.
 Arrays to Hashing with hand code.
 Linked List, Tree will be given for onsite problem solving.
 Recursive algorithms.
 Mail will be sent to all you people for some material of this
section. (Who all want hard copy get it from me).
· Object Oriented Programming Concepts
 Study all oops concepts
(‘Balagurusamy’,’Ravichandran’,’Rajagoalan’ Use any of these
books).
 Static and Dynamic memory management.
 Similarities and Difference between Java and C++.
 See Concepts and FAQs in Net. (If we got good link, we’ll
intimate you later).
 No need to study STL in deep.
· Basic Concepts
 Those who are not interested in studying all chapters, at least
study basics concepts like what it is? and why it is?, in OS,
Algorithm, DBMS, Networks.
· Algorithm
 Cormen 15 Chapters.
 Searching, Sorting (Complexity, situation of use).
 Hand code for these.
· OS Concepts
 Process, Memory management (chap 4-10 in Silberschatz).
 I/O, File (If needed chapter 11).
· DBMS
 Thorough with Mam notes and assignments.
 ACID
 Locks, Serialization, Normalization, Keys, Terminologies.
 Problems involved.
 Know little bit various available DBMS.
· Networks
 OSI Model, TCP/IP Suite.
 Topology.
 Network Elements.
 Protocols.
 IP Addressing (A, B, C, D, E).
 Subnetting, Supernetting (CIDR).
 IPV4 Vs IPV6.
· Digital Design
 Combination and logics (First 5 Chapters in our text book).
· System Software
 Assembler, Loader, Linker (Basics).
· Toc
 Regular Expression, Grammar, Automata.
· Compiler
 Pre compiling Vs Post compiling.
 Phases of Compiler.
· Java
 Complete Reference first 5 Chapters.
· Microprocessor
 Notes.
 8085 and 8086 (memory segments and external devices).
· Soft. Engg
 Lifecycle Model and Delta testing.
· OOAD
 Phases of OO approach.
 Difference between Procedure and Object oriented approach.

compiled by MIT 2005 batch

NMS–interview process

Company Name: NMSWorks Software Private Limited
Headquarters located at
#C3, 6th Floor
IIT Madras Research Park, Taramani
Chennai - 600 113
INDIA
Website Link: http://www.nmsworks.co.in
Company Profile:
NMSWorks Software delivers network management solutions to some of the largest and most demanding telecom service providers, network equipment vendors and enterprises.
To address clients' emerging business challenges and driven by a passion to "Stay Ahead of Competition", NMS constantly innovate to bring distinct and comprehensive software solutions in Network, Services and Business Layers across a spectrum of communication networks - Wireline, Wireless, Next Generation and IP Networks. Backed by a strong research team it deliver cutting-edge network management framework and mediation adapters to integrate many third party EMS and network elements including proprietary and legacy systems under NMS solutions. NMSWorks, headquartered in India (Chennai) is principally funded by Polaris Software - a Top10 Software Solutions company of India and the world's first CMMi Level-5 certified company.
The technology incubation for NMSWork's is provided by the TeNeT Group - one of the world's renowned telecommunication research group based in IIT- Chennai which is widely recognized a premier technology institute in the world. The TeNeT Group has been involved in incubating several technology companies including MIDAS Communications, Nexge, iSoftech etc.
NMSWorks is backed by leading venture partners including Venture East and UTI Ventures. The research and development of CygNet-OTNMS are partly funded by the Technology Development Board (TDB), under the aegis of Department of Science and Technology, Government of India - that selects, recognizes and supports leading edge innovations in indigenous science and technology.
NMS’s flagship product CygNet™ is a carrier-class, vendor-independent and standards-compliant network management solution. In comparison to competing solutions, CygNet is rapidly deployable and easily customizable. CygNet offers specific solutions designed for different telecom/datacom verticals in wire line, wireless, next generation and IP networks.
CygNet solutions are successfully deployed in managing complex networks in some of the largest Telecom, Defense, Banking, Internet Exchange networks in the world.
Interview Process:
2 rounds: written test, technical round
Written test:
    section 1: java descriptive questions (Many questions from Advanced Java)
    section 2:c objective questions
    section 3:dbms descriptive questions.
Technical round:
   They covered basics in all subjects.(not even a single HR question). some of d quest which i remember r
      1.Discussed the questions of written test nd they expected the answers from me since i had interview on the next day.
     2.usual final year project.
     3.C program using pointers (swap with & without temp).
     4. unix(fork() system call)
     5.memory leak concept.
     6.concepts in java( like threading, inheritance, package)
     7.How compilation done(linux command).
     8.Object oriented analysis & design(difference bt aggregation and composition).

compiled by geetha.

Technorati Tags:

Global Scholar–interview process

Global scholar:
      -  E-learning company.
Three rounds of interview :
  1) written.
  2) technical.
  3) technical + HR.
1) Written
10 aps question
10 c and c++ and datastructure question. (easy)
c++ and c are faqs you find it in net.
datastructures question involved finding time complexity and stable sort
2) technical round (easy one)
        1. reversing the linked list.
                 recursion  (pls memorize that three lines without any error and understand it)
        2. swapping two nodes in linked list.
                reversing linked list of size k.
               1->2->3->4->5->6
                k = 3
                3->2->1->6->5->4
                 use stack of size k.
        3. binary search question.
       indexes          0   1  2  3 4  5  6  7
       values            -3 -2  -1 0 3 5  7  9
             find value where index == value.
       4.  why it is bad to swap datas in linked list.
       5.   .h ie header files contains declarations or definitions
                  ans: declarations.
       6.   given you a window of length ‘l’.
             given you a binary tree
             print the binary tree to fit in the window
             printed tree should be aligned in window    
           root should be present in the middle  (0+l)/2
           its left child should be at  ( 0+ l/2 ) / 2 
           its right child should be at ( l/2+ l ) / 2
             this follows for all nodes.
      7.  print the tree in spiral order from leaf to root.
      8.  another tree question
Draw a vertical line that passes through some nodes.
see below
345 400 1265 850 1000
Guess whats value is
345 = 225 + 120
400 = 150 + 250
1265 = 200+300+170+325+270
850 = 500+350
1000 = 600 + 400
sum of the nodes that lie in the same vertical line.
9. c question
   fun( int *a)
   {
        a = malloc(sizeof(int));
       *a = 10;
   }
   main()
{
    int *a = malloc(sizeof( int) );
    *a = 5;
         fun(a);
printf(“%d”,a);
}
it prints 5
he asked to explain all stack and heap values.
10. N celebrity puzzle . google for it.
11. Tell me about yourself.

compiled by navin and dinesh

MIND TREE–interview process

TECHNICAL:
1)Explanation of mean,mode computation code
2)Gave me code snippet and asked output
3)Questions about networking basics like ARP,RARP,DHCP
HR:
1)Why mindtree?
2)What are your expectations?
3)My areas of interests

compiled by shanmu

CISCO - interview process

The selection process consisted of three rounds. The first round is written followed by one technical round. The third round comprised of few technical questions and then moved on to HR questions.
Round 1:
        The first round had both aptitude and technical questions. The aptitude questions ranged from being easy to moderately difficult. It can be cracked by mastering the questions in the following link:
http://indiabix.com/
        Technical questions were not limited to certain major topics. There were questions from microprocessors and programming languages. There were no questions from JAVA but the section had questions from semiconductors as the company is equally important to ece students. Hence brushing up the basics of EDC ( collector, emitter kind of questions and Zener diode) will help you to score more. There were no questions asking to write coding or algorithms as all the questions were multiple choice with options. The questions had negative marking.
Round 2:
         They shortlisted 18 students for the second round. The round had questions from all the subjects. Questions were  primarily from projects. Projects were given much importance and hence have sound knowledge in the working of the project. The questions to me were like:
1. Draw the ER diagram of your project.
2. Given a situation what datastructure will you use ?
3. What are different scheduling algorithms ? Advantages and Disadvantages?
4. Situation where no process is requesting any resource and still a deadlock arises ?
5. Types of databases ? Characteristics of each ?
6. Questions in pointers in C.
7. Types of Semaphores ? usage ?
8. One question using bitwise operators.
9.Paging and segmentation
       The major topics will be OS, Datastructures but they had questions from all the subjects. The questions were basic .
      NPTEL materials will be useful in answering the questions.
Round 3:
       Similar to Round 2 there were some questions . The questions were centered around the hobby and extra curricular activities. They expect confident answers.
        These are excerpts from my interview. Different panels do in different way. The basic point to note when preparing is to make an all round preparation without concentrating only on core subjects. All the Best!

compiled by Ganeshram

IBM–interview process

4 Rounds:
1.Written- 3 sections
            i)Matrix transformations (left rotate,right rotate) and what is the current pos of                           a value in the matrix
           ii)Questions from find the next no in the series
           iii)Aptitude qns
2.Group discussion
        Topic: Impact of movies on youngsters
         i)They expected good comm skills ,not much of importance on what we talk.
3.Technical Intrvw
        i)Qns from ur resume oly and basic knowledge on unix commands, oops, dbms,netwok.
        ii)Good knowledge about ur projects.
4.HR intrview
        i)Common qns (Tell about urself, why u prefer IBM)
        ii)Strengths and weakness
        iii) Greatest achievement of u

compiled by gallic gunners

Renault and Nissan–interview process

 

Selection process consisted of three rounds
1.Written test
2.Technical interview
3.HR interview

Written test had 50 aptitude questions to be solved in 1 hour. Questions were from almost all the topics of any standard aptitude book.

Technical Interview-30 min
Tell me about yourself and all further questions stemmed from here. I was asked questions from C,C++, Data structures,networks, about my projects, few questions on compiler design and software engineering.

HR interview-10 min
Why Renault Nissan? Are u interested to work abroad? Then questions about my family background, my schooling and hobbies.

 

METAMATION–interview process

India Metamation Software Pvt. Ltd.

4 rounds:

      1. Written test
      2. Tech & HR Interview
      3. Company Visit
      4. Final Selection

1.Written test:

    • contained 2 parts.
    • (i) Aptitude (45min):
      • No RS Agarwal! No Verbal & Analytical!
      • Lot of 9th & 10th standard maths questions like finding area, angle, no. of trailing zero.
      • Puzzles like 3 switch & 3 bulb puzzle, no. of outer coloured cubes in a bigger cube, next no. in the series & odd man out.

    (ii) Technical (45min):

      • If we collect the very first questions from all topics in any study material, we can get the entire Question paper. All were very basic questions.

Subjects covered:

C – defining a new datatype & data structure, Which bitwise operation is equivalent for multiplying by 2?

C++ - debugging a piece of code.

OS – What is deadlock & livelock?

Programming – code/flowchart for Fibonacci series.

TOC – they asked to write a grammar (I didn't remember).

Datastructure – Best case running time of Quicksort?

Algo – An array consisting of 1 to n integers is given. One particular no. is missing             and some another no. is existing twice. What are those no.s?
        And one from Networks.

2. Tech & HR interview(for around 25min):

    (i)Tell me about yourself.
    (ii)If a project comes to you, how would you split it & assign them to your teammates?
    (iii)When can you give your best performance? Either as an individual or in a team?
    (iv)Why do you want to join metamation? Why not TCS or CTS?
    (v)Can you sit infront of a computer day & night and code?
    (vi)What are the subjects are you studying in this semester?
    (vii)What are the topics covered in your subject 'Mobile Computing'?
    (viii)Tell us about your final year project. Is coding there?
    (ix)How Linked list is better than Array? And why?
    (x)Write code for this: An array of size is 200 given. In that upto some index values are                  filled. Other positions are filled with zeroes. Now an index & a value is given to you.
        Insert it. If already a value is there push them. (Simple array insertion)
    (xi) Your current CGPA?
    Third and Fourth round weren't conducted.

 

Monday, March 14, 2011

HP BAS interview process

BAS – best applications shore services

I attend this company as oncampus recruitment. totally 3 rounds.

1. WRITTEN TEST

2. TECHNICAL ROUND

3. HR ROUND

all the three rounds are very similar to the rounds in HP R&D. but , questions are little easy when compared to that. so , if you are eligible to get placed in HP R&D , you ll be surely get placed in HP BAS.

for HP R&D interview process, refer previous post :)

HP R&D INTERVIEW PROCESS

I attend HP R&D interview thro’ my oncampus recruitment. Totally there are 3 rounds. Totally there are 3 rounds.

1. Written test – contains upto 6 to 7 sections that includes english (writing letter or email) , dbms , networks , os , c or cpp or java (anyone language) , aptitude questions , comprehension questions , logical questions…

note : sectional cutoff is there and will give you another section questions only when you return the previous section question and answers within time.

2 . Technical round – it will be around 45 to 75 minutes interview (mostly depends upon panel members). some panel will be very technical. some panel will be not less than HR interview.

3. HR round  - it will be around 20 minutes interview. it is an formal interview to know about candidates.

note: in our college, there are 6 to 7 panels. some are very technical and some are jovial. it is our luck to be in good panel. for HP R&D , we must be very technical. Mostly development is going on HP than the research.

Sunday, March 13, 2011

HUAWEI TECHNOLOGIES - INTERVIEW PROCESS

There are totally 3 Face to Face interviews. I get into PEP test that is conducted by careernet. so, no written test in company. we got call letter for interview on march 12th ,10am , bangalore.

1st technical round
1. Tell me about yourself
2. pattern matching
3. == and equals
4. exception , final , abstract , static , malloc and calloc , interface
5. decimal to octet and hexadecimal
6. string compare
7. some HR questions

2nd technical round
1. search in binary tree
2. reverse the linked list
3. questions in pointers
4. final year project

3rd HR round

1. tell me about yourself
2. why you want to switch from TCS to huawei
3. why you took computer science ??
4. what are your subjects in final sem ?
5. final year project
6. HARDWORK or SMARTWORK
7. OS questions

people who are going to attend interview , should know more about company and ask questions about the company when interviewer asks. this may create some good impressions.

Sunday, January 2, 2011

I have nokia 5320 xpressmusic and cant send SMS

530_xpressmusic_cellular_phone_954572[1]

Problem with the Nokia 5320 XpressMusic Cellular Phone

I have nokia 5320 xpressmusic and cant send SMS

I have nokia 5320 xpressmusic and cant send messages other than that it is working on fine. i have checked with my service provider and have also changed the handset i which case the message sending problem is solved. My handset is not sending sms on any SIM i use. I have recently upgraded the Firmware too but the problem persist. Any solution to this?

BEST SOLUTION :

Try to to soft-reset your unit. (6 steps)
1. BUT Make sure you backup your phone memory to your memory card. Soft-reset deletes all data saved in your phone memory, including factory settings and pre-stored music, videos, etc.
2. Dial *#7370#. This would take at least 2 minutes.
3. Try sending messages to your own number.
4. If sending messages is working, you may now restore your backup of phone memory.
5. After restoring phone memory backup, try to send messages again.
6. If sending messages is not working again, chances are, your original phone memory is full and you should delete messages and contacts. You have to repeat soft-reset (steps 1-3). But your previous data should be accessed directly from your memory card so as not to directly save to your phone memory.


link referred : http://www.fixya.com/support/t2744116-nokia_5320_xpressmusic_send_sms