Showing posts with label On-Campus. Show all posts
Showing posts with label On-Campus. Show all posts

Monday, July 15, 2013

Aricent Interview Experience of Isha Aggarwal

Written : 
This time, Aricent had an online test instead of written test.
It comprised of 4 sections.

Section 1 :

Questions based on English and verbal ability were there.
Comprehension based questions were there.
Some other questions included : improve the italicized part of the sentence, or to select the synonym or antonym of the given word, to arrange the given sentences in an order, and so on..

Section 2:
This section was to judge your Quantitative aptitude. Questions on Logarithms,profit and loss, speed distance time, work, calculating cost of fencing, etc. type questions were there. Just revise your concepts and main formulas, and that would be enough.
During your mock tests, try making a note of formulas simultaneously.. It wont burden you in the end!

Section 3:
It was a mix of DS concepts and programming concepts. It was a simple section. Just be thorough with basic concepts. In some questions Pseudo codes were given, and output was asked. A few questions on C++ were also there. Only basic concepts.

Section 4:
It was the logical ability section.
Questions were simple in this section as well. Complete the series type, Given a para of information, and then answer the questions. Blood relations, a string encoded as another word, so what will be the code for another word. Notation of operators changed, and then answering the questions that follow. Data sufficiency questions were there.


People who cleared the written were asked to fill the
 Critical incidence form which consisted of questions like:
  • State a situation when you had too many tasks at one time and how did you handle it.
  • State a situation when you yourself was busy but still helped someone out.
  • When you were in a very difficult situation and you came out of it.
  • what was the most difficult decision you ever had to make.
  • Write an incidence when you stated an unpopular opinion.
  • State a task you completed of which you had very little/no knowledge.
For every question, you have to write what was the situation, how you handled it and what was the outcome!
This form will be discussed in detail during HR. So don't cook up stories.Try to think of real incidents..
Include 
We were then called for GD in a group of 10 or 12, and it was a non-eliminatory round.



INTERVIEW :

I was first asked about the programming language I am comfortable in and about some programs that I have done.
Then he asked me to write a factorial program optimally, I wrote both the recursive and iterative approach, and told him about the pros and cons of each.
Next he asked me to write a program to swap 2 numbers optimally. For this I wrote the program without using any temporary variable. I then told him about XOR method as well. He then asked me what is XOR operation and asked me to do swapping using XOR with an example.

Then he asked me to explain Quicksort with an example. He basically wanted complete dry run. Then he asked me the running time of quicksort. When I answered about worst case running time, he asked me to give a worst case input for QS.
Then he asked me differences between Insertion sort and Bubble sort, again with an example of each.

Next, he asked me to explain how to implement stack using Linked list.Where push and pop will be done, etc.
And then implementation of queue with linked list. etc.

Then he moved to OS :
Asked me what is a process, characteristics of a process. Structure of PCB. Difference between a thread and a process.What is a semaphore.Why is it used. Types of semaphore etc.

I guess that was all. He then discussed the critical incidence form in detail, so no seperate HR for me!

All the very best to all :)

Friday, June 14, 2013

Adobe Interview of Samarth Gupta

Written:
It consisted of 3 sections viz Apti and Quant, C and Engineering.
C paper consisted of 10 questions that were based on pointers and functions.
Check if an expression has valid parenthesis

Engineering Paper:
  1. Each instruction on JVM is in byte code. How many such instructions are possible?
  2. Some Memory and Process Scheduling based scenario was given along with 4 options.
  3. Synchronization of two processes using the following code:
     boolean lock;  
     while(lock) ;  
     lock = true;  
     /* critical section code */  
     lock = false;  
    
    Is it feasible?
  4. Reverse a Singly linked list
  5. Check if a number is palindrome without converting it to string
  6. Implement multiplication recursively
  7. A number has 3 on it's unit place if one of it's multiples has 1 on all it's places. e.g. 111 is a multiple of 3, 111111 is a multiple of 13. You need to find such multiple of a given number. The multiple may be very large and exceed the limits. Don't use any complex data structures.
  8. A matrix having 0s and 1s is there. Each row can not have a 1 followed by a 0. You need to find the row having maximum 1's.

Interview 1:
It started off with compilers. Explain Parsing, different types of parsing, LR(1), LALR(1). 
Steps of compilation, explain lexical analysis, linker, loader.
Examples of syntax error, semantic error, linker error, relocatable addressing.

OS:
Process management, memory management, process v/s thread, file descriptor, synchronization techniques etc.

C/C++:
Some questions for output, overloading v/s overriding, structures v/s classes, inheritance, virtual functions, can constructors and destructors be virtual? why or why not? diamond inheritance problem, and a lots of questions on pointers. Some statements were there and I had to read them properly i.e. 
 int *p;  
 P is a pointer to integer  
Complex ones were there.
In C, functions are evaluated right to left. Why, any benefit?

Data Structures and algorithms:
Convert an expression from infix to postfix and vice versa (code)
Merge two sorted linked lists removing duplicates.
Reverse a Linked List (any other method than the one I had written in the engineering paper)
Height of a tree (he asked me more than one method. I was able to give 3 solutions)
2 sorted lists, you have to find the element of rank k in their merger without actually merging them

Assembly code to generate factorial of a number (I assumed some basic instructions like ADD, SUB, JMP etc)


Interview 2:
Design a base 64 encoder for an infinite stream of data.
Implement cin and cout using printf and scanf
Implement LRU Cache
Design a class to give following 3 functions in O(1):
  • void insert(int data)
  • void delete(int data)
  • int getRandom()

Serialization and de-serialization of a binary tree.
What are smart pointers?
How garbage collection works in java?
Malloc and Free
Maps (Hash maps) and how they work?
Average of 4 unsigned integers (simple addition might result in overflow)


Interview 3:
It was with the director of the acrobat team. Started off with my intro, what I do in leisure time, and it continued for next 20 minutes on Online Gaming. Next 20 minutes were on my project in snapdeal and next 20 mins were on what Acrobat Team does and how acrobat helps adobe earn profit.
Then he moved to DS and Algo:
Reverse a Doubly Linked List (proper code)
You are given an infinite sequence of words. what you need to do is when a new word is there, store it. whenever a word is repeated, throw an exception. Make sure you do not spend too much time in searching. Give a solution using some DS and design an algo for the same. Then this moved to phrases, then he asked me to store the sequence as well.
That's it..

Interview 4 (HR Round):
This was a casual round where we discussed about adobe, job profile, facilities etc. 

Hope it helps!
All the best.. :)

Wednesday, February 13, 2013

Microsoft Interview of Monika Bisla

Written Test (Nov, 2012):
30 MCQs based on Algorithms & logical aptitude and 2 coding problems.

Telephonic Interview (7th January, 2013):
All questions related to your resume & projects and some behavioral questions.

Interviews (27th January, 2013):

Round 1:
  1. Write code for run-length encoding of a given string in-place (without using any extra memory).
    Sample Input: aaaaaaaaaabcccccc Output: a10bc6
  2. Write code for a function which converts a given integer to a string. (Use only one for-loop).Check for all the boundary cases.
  3. Suppose you are going to organize a party from 9:00 am to 20:00 pm. You have invited 'n' number of guests for the party. You are given the arrival time and the departure time of all guests. Every time a new guest arrives, you give him a glass of wine and when he leaves, you take the glass back. If someone has left and returned the glass, you can give the same glass to a new guest who has just arrived.
    Based on the given schedule for guests, determine the minimum number of glasses required for the party. A guest can come or leave at any time, but you are given the fixed schedule. Write code for the given problem.
Round 2:
Some questions related to resume and subjects studied in the curriculum.
  1. How can we do a Tree Traversal without using a stack (not even the stack for recursion). Write code for an in-order traversal without using stack. What would be the changes in the function if we want to do a pre-order or post-order traversal?
  2. Write code for finding loop in the singly linked list and fixing it.
  3. Given a linked list with two pointers, one is next pointer and another is a random pointer which can point to any node in the list (forward, backward or itself), you have to make a copy of this list without tempering the original list. Write the code for the same in O(n) time complexity.
Round 3:
  1. Give different possible approaches for Checking whether two strings are anagrams (with and without using hash tables). What are the possible advantages and drawbacks of each approach? Write code for the approach which involves first sorting the two strings and then matching character by character (O(n lg n) approach). Which sorting you will use and why? Write test cases also.
  2. Write code for counting the number of inversions in an array in the minimum time possible. What could be different possible approaches?
  3. Given two huge numbers represented as linked list, write a function to add them and return a number in the same format.
    Ex: 950 represented as 9->5->0->NULL
    150 represented as 1->5->0->NULL
    then, the output should be 1->1->0->0->NULL
  4. We have ‘n’ people in a party, out of whom only one can be a celebrity. And he may or may not be present in the party. A celebrity is known to everyone but he does not know anyone. All other person may or may not know each other. If a person ‘A’ knows ‘B’, it does not implies that ‘B’ also knows ‘A’. You can ask only one question to someone ‘Do you know this (‘X’) person?’ and he can only reply in YES or NO. Your job is to find the celebrity in minimum number of questions.
Round 4:
First he asked general questions from resume.
  1. Write code for finding the least common ancestor of two given nodes in a binary tree. ( both recursive and iterative approach).
  2. Which data-structure you will use for implementing the ‘malloc’ and ‘free’ functions? (You have been given with a pointer which points to a large chunk of memory).Write full codes for implementing these two functions.
Each face-to-face round duration was approximately 1 hour. Results were declared after 4 days of interviews. Every interview was an eliminating round. Questions were not very hard but they were very keen on accuracy and efficiency of code (it should run on all possible input cases).

Monday, October 22, 2012

National Instruments Interview of Monika Bisla

Written:


  • sqrt(b^2 - 4ac), if a =[0, 0.5] and b=[4, infinity), Whats the range of c?
  • Write a recursive function to get the product of all the digits of a number.(eg: for 123: output 1*2*3; for 56: output 5*6=30)
  • Find the 100th number of the series 2, 4, 8, 14, 22, 32....
  • Find the 20,000th element of the series 1, 2,2, 3,3,3, 4,4,4,4, ....
  • Write a single statement to check whether a given number is a power of 2.
  • T(n) = 2*T(n-1)+2^(n-1); T(1) = 1. Find T(7).

  •  int index, i=0, k=0, j=0;  
     for(index=0; index <= some_number; index++){  
       i = i+1;  
       if( (i/5) == 1 ){  
         i=0;  
         k = k+1;  
         if( (k/5) == 1){  
           k=0;  
           j = j+1;  
         }  
       }  
     }  
    

    What's the value of i, k, j interms of 'some_number' after the the execution of for loop?
  • A bag contains 3 coins out of which * 1 coin is painted RED both the sides * 1 coin is painted BLUE both the sides* 1 coin is painted RED with one side and BLUE with another. Two coins are selected from the bag and tossed. Find the probability of  getting both as RED.
  • What's the effect of(or write a common code) the following code on an array of 8 elements?
     for(i=0; i<4; i++)  
       a[i] += a[i+4];  
     for(i=0; i<4; i++)  
       a[i] += a[i+2];  
     for(i=0; i<4; i++)  
       a[i] += a[i+1];  
    
  • Write a function for generating random number between a given range.
    Using above, write a function to generate random integers between a given range such that probability of each integer is same.
  • How many edges are there in a complete graph of n vertices.
    Using the formula in question above, find number of graphs possible with ‘n’ vertices (graphs need not to be complete).
  • Calculate number of inversions in a given array.
    In general what would be the number of inversions in the worst case and what is that worst case.
  • Let us define a walk from v to v in the given graph:

    Number of 1-walk is represented by W(1) and given by:
            V-V                               // W(1) = 1
    Number of 2-walk is represented by W(2) and given by:
            V-V-V
            V-W-V                           //W(2) = 2
    Find W(3) and W(4).
    Also find W(n) in general.
  • Draw a DFA for a language which ends with 0101.
Interview 1:
In this interview, they basically discussed written test only and some extra questions:
  • Write code for making a copy of Binary Tree.
  • Write code for finding maximum root to leaf path sum.
    Write code for both approaches (top-down and bottom-up).
Interview 2:
  • Given a long formula for a carbon compound, Write a code for counting the number of carbon atoms.
    Ex: (C2H6(CH2)6CH2C3H4)4CH2C6H6C5H5
    Handle all the cases.
    Give code for iterative as well as recursive approach.
  • Given a Binary tree, where internal nodes of the tree represents an AND or an OR gate and leaf nodes consists of values either 0 or 1.
    Write code for finding the final resultant at the root node.
  • In the Question given above, add one more argument to your function which gives the expected value of the result.
    If result calculated by your function and expected values are not same, flip the gates in internal nodes of tree in such a manner such that result and expected values comes out to be equal.
    Do this in minimum number of flips possible.
    Also handle those cases where it is impossible to achieve the expected value.
    Write the code for above problem.
Then, there were some normal HR questions and that was it!! 

Friday, August 10, 2012

Thoughtworks Interview of Monika Bisla

1st round:
11 logical assessment question based on some flow charts.

2nd round:
Coding round.

Interview 1:
  • Tell us about yourself.
  • What all subjects in Computer science u like ??
  • Then they asked: Are u comfortable with OOPs? I said, yes.
    He asked "Have u seen movie avatar"? I said, No. He said..does not matter..
    Suppose there is a rocket , it contains a Spaceship.I want to send some people on Mars.People are there in the spaceship.Write a program to lend the spaceship on Mars planet. Make all the classes.
    Then, they said, Suppose tomorrow i change my requirements, i want to send 'N' number of things top Mars , Or i may also send rocket empty,just for testing. Incorporate all these things in your classes n show us the main program, How all these classes are related, how will u make the spaceship lend on Mars.
    It took around 20 mins in this question only.
  • Do u know about recursion. Write a program to print a given character 100 times.
  • 2 more coding problems:
    1. Write a program to find 1st and 2nd maximum from an array.
      I wrote it...I used swapping in the program at one place. Then they said..do it without swapping.
    2. Given Input :: x1y2z3 Output :: xxyyzzz
      I wrote the program Then they said, suppose input could be anything like
      Input:: abc3defgh1aa3 Output:: abcabcabcdefghaaaaaa
      Change your program accordingly.
  • Are u comfortable with DBMS ? What is normalization.
  • Do u use Twitter..?? I said, No, I use facebook. They asked, u make post on ur wall.Simulate a database for this.What all table will u make.??
    I made only 4 tables (since they were specifically asking about posts)
    • User's Table :: user_id , user_name , Place , d.o.b , rel_status
    • Friend's Table:: user_id , friend_id
    • Post Table:: Post_id , User_id , Likes , Post_text
    • Comments Table:: Post_id, Comment_text , Friend's Id(who made the comment)

    Then they gave me an SQL query:
    Write a query to retrieve all the comments made by USER 'X' on all of his friend's posts.
    I wrote the query using three nested sub-query.
    They asked, Is there any other way of doing this?
    I told it can be done using Views but I don't know how to do that.
  • Then, they asked , Have u heard about the sudoku game? Make a class for that and how will u solve the game , given some random values? What all data structure will u use? Give us the proper implementation.
  • Would u take a 9*9 grid or how will u do that ?
    I said i will make a class of 3*3 grid. N i will make 9 objects of that class.
    How will u do that?
     class sub_mat {  
       int a[3][3];  
       public:  
         . . .  
     }   
     int main() {  
       sub_mat sudoku[3][3];  
     }  
    

    Then , they asked me to do the initialization. I made a function for that. - Then , they asked me how would u solve it now? I told them my approach. - they asked me to show the syntax of that function n how would i call it? What all things will be used?
    I made a static function in the class, in which i passed the whole grid.. Then i calculated all the possible values for each cell.
Interview 2:
  • They again started with OOPS concepts.
    They asked," u must have travelled in DTC bus ". Write a class and its member functions.
    I made a class for vehicle..added data members (like model_no , price , serial_number , Type of vehicle , name..etc) then i added some functions like (start(),stop()...etc.)
    I made a class Bus, I made vehicle class public to it. I added data members and functions for bus class. They wanted to add more and more functions. 
  • Then, they said suppose there are three type of seats (Women, Senior citizen and conductor), how will u implement this thing in your class?
    I implemented it using a 3*3 array in which i stored type_id for a particular seat and then a range for that particular type.
  • Then, they said, Suppose we do not have any range , we can give any seat randomly to anyone, how will u implement it now, and there can be 'n' number of types of seat. -I made a hash table kind of thing. Then they said there is lot of pointer kind of things in this bus class. Make a separate class for this data-structure for seats. 
  • Then they said, "you have also done Java, Is there any data-structure available in java for this ?" Implement that also.
  • They asked.., shouldn't you categorize your vehicle class more,on the basis of type of vehicles. what all classes should be there and what all member functions should be in each class. (they spent half an hour on this question only.)
  • You have done compiler , So tell us what is a linker and what is a parser? How do they work? Who call them when a program gets executed and to whom they return their values?
  • Make a parser for a language in which i have data-types like :: tni a; taolf b;
  • Tell us about various scheduling algorithms.
    • How would u implement Remaining Time First ?? (I did it using min-heaps)
  • What is preemption?
  • What is Process Control Block? How does it gets implemented in memory?
  • U have done K-means algorithm , Let me ask u a puzzle.
    Suppose u have a Car , U have infinite amount of fuel , U have to go to some city "XYZ". U have never heard the name of the city, U dont know anything about it. U dont know in which direction it is and u cant get any information from any source. What strategy u will make to go to that city?
    I asked, Sir , can u tell me the distance. He said, no, It can be anywhere..it can be thousands miles away in any direction.
    My answer : I will first go straight from wherever i am , then i put a mark there, and take a circular round to ensure that place is not located in that radius.then , i again travel straight and take a circular round and so on until I find the place..
    then he asked, Is it a BFS or DFS ?? I said, first we go straight (i.e. DFS) and then we take a round (i.e. BFS) , so it is a mixture of both BFS and DFS.
    He said, Suppose now i am ready to tell u one hint, What will you ask for and what will be ur strategy? I said, tell me the distance.
    He said, it is 10,000 miles away.
    I answered, I will go straight 10,000 miles and take a circular round..:)
And that was it.
(Important part was that they wanted implementation of all things and you had to do everything on board.)

Friday, August 3, 2012

Google Written On Campus

Google visited our campus for the first time. The procedure consists of the following rounds:
  • Written test
  • Sets of Interviews
The Written Test
The written test consisted of 2 sections: 
  1. MCQs: There were 20 questions consisting of questions from OS, Algo, general logic etc. They covered all the things from basics of each subject to advanced concepts like NP Hard Problems etc.
  2. Coding Section: Coding section consisted of 2 programming problems:
    1. Problem 1: Two friends Atul and Vinay went for a picnic on an island. The island is a grid of m x n. While going back to home, Atul went and Vinay was left on the island. Now upon realizing this mistake, Atul is coming back to the island. In the meanwhile, Vinay will be wandering on the island. His probability of taking a step in any of the 4 direction (up, down, left, right) is equal. This means that he may fall into the sea as well and drown. Given the no of steps (k) he'll be taking before Atul arrives, size of the island (m x n) and his initial position (x,y), find the total probability that he'll be alive after Atul arrives.

      int ProbabilityOfBeingAlive(x,y,m,n,k)

    2. Problem 2: Write a code to multiply two integers.

      int Multiply(a,b)
Candidates shortlisted were called for the interviews in B'lore later.

Tuesday, July 17, 2012

Nagarro Interview Experience of Amit Kumar

Written Test: 2 papers
Paper 1: Aptitude (mathematical section) and analytical reasoning (only Problem solving type puzzles)

This paper includes two sections
  1. Mathematical section problems on mensuration, geometry, trigonometry, profit-loss, percentage, problems on train, boat-stream etc.
  2. Analytical reasoning (only Problem solving type puzzles).
The level of Mathematical section is more than average as compared to other companies
And also the level of Analytical reasoning questions is good.

Paper 2: Coding round
3 problems are given to be coded in 75 minutes (I attempted all 3).

  1. Given an array of integers which contains positive and negative numbers you have to arrange the negative number first then positive numbers in O (n) time.
  2. Given an array of integers and a number “k”, you have to find the all such elements whose sum is equal to “k”.
    This is a subset sum problem.
    Ex:- {1,2,3,4,5,6,7,8,9} k=10
    O/P:- {1,2,3,4}, { 1,3,6}, { 1,2,7}, {1,4,5}, {1,9}, {2,8}, {3,7}, { 4,6}, {2,3,5}.
  3. Given an integer array of positive numbers, you have to find all pairs of “next nearest consecutive numbers” in array, if not present then nothing to print, if present then print all such pairs.
    Ex: - Input1:- {1, 4, 2, 5, 7, 8} O/P is {7, 8}
    Input2:- {1,4,2,5,7,8,9,10} O/P is {7,8}{8,9}{9,10}
    Input3:- {1, 6, 9, 11} No output.
Those who cleared the written test were called for the technical interviews.
TIP: - Try to attempt all codes.

Interviews

It started with discussion of the codes one by one.
For codes which were not optimal, he asked me for other optimal approaches.

For Question 1:-
I had used extra memory to store the result, sir pointed out that I could have done the same thing using O(1) (constant) space and I did with constant space(with different approach).
He was trying to entangle me by the question “You haven't handled the case of ZERO (0)” then I said that ZERO is neither positive nor negative.


For Question 2:-
My code would not have printed all outputs if the input size would increase, so he asked me to think different approaches. I told him an approach that use all (2^n) subsets of the give array of size n, that takes sum of the elements of the subset and then check with the given sum. If they equal print all elements of that and I repeat this process to all (2^n) subset of array.

He said that same approach is written by your friend, than I said that it may happen, then he asked me again to think different approach. I said that I don't have any alternative solution.

For Question 3:-
My code prints the all such pairs that differ by one, so sir asked me to correct the code then I said that I can find the minimum difference of two indexes and also the difference of the element at these indexes equal to one.
Again, he was trying to entangle me by the question “You want to make array of difference of indexes”, then I said that no I will use only two variables.

After this, he asked me to write a code to print the following pattern
12345
23451
34512
45123
51234

That's all for the technical interview.

HR Interview
  • About yourself
  • Marks, JAM Rank, how many candidates appeared for JAM that year.
  • Interests
  • About Nagarro - Where do you see yourself in 5 years, how many seniors you know in Nagarro, is this your first interview, technology you'd like to work upon, how will you manage transportation to Gurgaon etc. 
That's it. :)

Saturday, July 7, 2012

Aricent Interview of Monika Bisla


Written exam was same for all. For details regarding written, click here.

Interview
My interview started with my resume. The interviewer had a look at my resume and asked about my recent projects. I told him briefly.

Then he started with C questions like

  • What will happen in this code :
main()
{
        main();
}
I replied with Segmentation Fault. Then he asked what is a segmentation fault? In which conditions segmentation fault can occur?
  • Which loops are used in C language? Difference between while and do-while?
  • Types of storage classes in C? Difference between auto, static, extern and global variables. What is their scope and where do they get stored in memory.
  • How can we write structures in a text file and then retrieve it?
  • Fopen and Fclose commands in C,  how they are implemented?
  • OOPS concepts, What is polymorphism and types of polymorphism? What is function Overloading?
  • Can we use sizeof() operator in #define preprocessors? If not, why?


After this he switched to Software Engg.

  • SDLC(S/w develoopement life-cycle.)
  • Various models? Why watrefall model is called waterfall? What is an Agile model?
  • When we do requirement analysis, which is the most basic step?
  • What is RISK? How do we do risk management? (he also asked, “Is joining Aricent a Risk”? :))
  • What are various kind of testings? Unit Testing , Integration Testing, Regression Testing?
  • When do we do all these testings during developement of software?


Switching to Operating Systems,

  • How do we implement Cache?
  • What is purging?
  • What is a page fault? How do we handle it?
  • What is a deadlock? Give an example.

After this, he asked about difference between Stack and queues and their applications? Which data structure do we use for recursion? Why stack is used for recursion?

Starting with Computer Networks,

  • What is the difference between TCP and UDP? where are they used?
  • Layers of ISO model, protocols used in application layer and transport layer.
  • What is the difference between packet switching and circuit Switching? TCP and UDP use what?
  • What is difference between http and https?
  • Port number of FTP, HTTP?
  • What is difference between a switch and a router? In which layer they are implemented? What are L2 and L3 switches?
  • What is a VPN? Is it implemented using internet?
  • What is VLAN?
  • How do we implement a WAN?
  • What is GSM? How it is implemented? Is it used for voice or data or both?
  • What is GPRS? how it is implemented? Can we send voice packets on GPRS?
That's it. 
Overall, he covered all the topics.