Me got Placed
Posted by Subash | 8:29 PM
[1] Comments
Posted by Subash | 8:29 PM
[1] Comments
Posted by Subash | 11:33 PM
[0] Comments
Posted by Subash | 11:41 PM
[0] Comments
Posted by Subash | 6:56 PM
[2] Comments
delete this;
int __ = 0;
main() {
int ___ = 2;
printf("%d\n", ___ + __);
}
Posted by Subash | 7:36 PM
[0] Comments
Posted by Subash | 7:34 PM
[1] Comments
Posted by Subash | 5:59 PM
[0] Comments
Posted by Subash | 12:14 AM
[0] Comments
1.What is pipelining?
2.What are the five stages in a DLX pipeline?
3.For a pipeline with ‘n’ stages, what’s the ideal throughput? What prevents us from achieving this ideal throughput?
4.What are the different hazards? How do you avoid them?
5.Instead of just 5-8 pipe stages why not have, say, a pipeline with 50 pipe stages?
6.What are Branch Prediction and Branch Target Buffers?
7.How do you handle precise exceptions or interrupts?
8.What is a cache?
9.What’s the difference between Write-Through and Write-Back Caches? Explain advantages and disadvantages of each.
10.Cache Size is 64KB, Block size is 32B and the cache is Two-Way Set Associative. For a 32-bit physical address, give the division between Block Offset, Index and Tag.
11.What is Virtual Memory?
12.What is Cache Coherency?
13.What is MESI?
14.What is a Snooping cache?
15.What are the components in a Microprocessor?
16.What is ACBF(Hex) divided by 16?
17.Convert 65(Hex) to Binary
18.Convert a number to its two’s compliment and back
19.The CPU is busy but you want to stop and do some other task. How do you do it?
20.What is the difference between a MicroProcessor and a MicroController?
Posted by Subash | 8:11 PM
[0] Comments
1. What is the output of printf("%d")
2. What will happen if I say delete this
3. Difference between "C structure" and "C++ structure".
4. Diffrence between a "assignment operator" and a "copy constructor"
5. What is the difference between "overloading" and "overridding"?
6. Explain the need for "Virtual Destructor".
7. Can we have "Virtual Constructors"?
8. What are the different types of polymorphism?
9. What are Virtual Functions? How to implement virtual functions in "C"
10. What are the different types of Storage classes?
11. What is Namespace?
12. What are the types of STL containers?.
13. Difference between "vector" and "array"?
14. How to write a program such that it will delete itself after exectution?
15. Can we generate a C++ source code from the binary file?
16. What are inline functions?
17. Talk sometiming about profiling?
18. How many lines of code you have written for a single program?
19. What is "strstream" ?
20. How to write Multithreaded applications using C++?
21. Explain "passing by value", "passing by pointer" and "passing by reference"
22. Write any small program that will compile in "C" but not in "C++"
23. Have you heard of "mutable" keyword?
24. What is a "RTTI"?
25. Is there something that I can do in C and not in C++?
26. Why preincrement operator is faster than postincrement?
27. What is the difference between "calloc" and "malloc"?
28. What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?
29. What is Memory Alignment?
30. Explain working of printf.
31. Difference between "printf" and "sprintf".
32. What is "map" in STL?
33. When shall I use Multiple Inheritance?
34. What are the techniques you use for debugging?
35. How to reduce a final size of executable?
36. Give 2 examples of a code optimization.
Posted by Subash | 8:09 PM
[23] Comments
Some companies certainly ask for these puzzles. Specially Microsoft.
1. Write a "Hello World" program in 'C' without using a semicolon.
2. Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;
3. C/C++ : Exchange two numbers without using a temporary variable.
4. C/C++ : Find if the given number is a power of 2.
5. C/C++ : Multiply x by 7 without using multiplication (*) operator.
6. C/C++ : Write a function in different ways that will return f(7) = 4 and f(4) = 7
7. Remove duplicates in array
8. Finding if there is any loop inside linked list.
9. Remove duplicates in an no key access database without using an array
10. Convert (integer) number in binary without loops.
11. Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed.
12. From a 'pool' of numbers (four '1's, four '2's .... four '6's), each player selects a number and adds it to the total. Once a number is used, it must be removed from the pool. The winner is the person whose number makes the total equal 31 exactly.
13. Given an array (group) of numbers write all the possible sub groups of this group.
Posted by Subash | 7:51 PM
[0] Comments
Posted by Subash | 11:03 AM
[1] Comments
1. Differentiate persistent & non-persistent objects?
Persistent refers to an object's ability to transcend time or space. A persistent object stores/saves its state in a permanent storage system with out losing the information represented by the object.
A non-persistent object is said to be transient or ephemeral. By default objects are considered as non-persistent.
How can a '::' operator be used as unary operator?
Answer:
The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn’t have a name, the notation :: member-name refers to a member of the global namespace. This can be useful for referring to members of global namespace whose names have been hidden by names declared in nested local scope. Unless we specify to the compiler in which namespace to search for a declaration, the compiler simple searches the current scope, and any scopes in which the current scope is nested, to find the declaration for the name.
Describe the main characteristics of static functions.
Answer:
The main characteristics of static functions include,
What is name mangling?
Answer:
Name mangling is the process through which your c++ compilers give each function in your program a unique name. In C++, all programs have at-least a few functions with the same name. Name mangling is a concession to the fact that linker always insists on all function names being unique.
Example:
In general, member names are made unique by concatenating the name of the member with that of the class e.g. given the declaration:
class Bar
{
public:
int ival;
...
};
ival becomes something like:
// a possible member name mangling
ival__3Bar
Consider this derivation:
class Foo : public Bar
{
public:
int ival;
...
}
The internal representation of a Foo object is the concatenation of its base and derived class members.
// Pseudo C++ code
// Internal representation of Foo
class Foo
{
public:
int ival__3Bar;
int ival__3Foo;
...
};
Unambiguous access of either ival members is achieved through name mangling. Member functions, because they can be overloaded, require an extensive mangling to provide each with a unique name. Here the compiler generates the same name for the two overloaded instances(Their argument lists make their instances unique).
What is slicing?
Answer:
Slicing means that the data added by a subclass are discarded when an object of the subclass is passed or returned by value or from a function expecting a base class object.
Explanation:
Consider the following class declaration:
class base
{
...
base& operator =(const base&);
base (const base&);
}
void fun( )
{
base e=m;
e=m;
}
As base copy functions don't know anything about the derived only the base part of the derived is copied. This is commonly referred to as slicing. One reason to pass objects of classes in a hierarchy is to avoid slicing. Other reasons are to preserve polymorphic behavior and to gain efficiency.
What is a smart pointer?
Answer:
A smart pointer is an object that acts, looks and feels like a normal pointer but offers more functionality. In C++, smart pointers are implemented as template classes that encapsulate a pointer and override standard pointer operators. They have a number of advantages over regular pointers. They are guaranteed to be initialized as either null pointers or pointers to a heap object. Indirection through a null pointer is checked. No delete is ever necessary. Objects are automatically freed when the last pointer to them has gone away. One significant problem with these smart pointers is that unlike regular pointers, they don't respect inheritance. Smart pointers are unattractive for polymorphic code. Given below is an example for the implementation of smart pointers.
Example:
template
class smart_pointer
{
public:
smart_pointer(); // makes a null pointer
smart_pointer(const X& x) // makes pointer to copy of x
X& operator *( );
const X& operator*( ) const;
X* operator->() const;
smart_pointer(const smart_pointer
const smart_pointer
~smart_pointer();
private:
//...
};
This class implement a smart pointer to an object of type X. The object itself is located on the heap. Here is how to use it:
smart_pointer
Like other overloaded operators, p will behave like a regular pointer,
cout<<*p;
p->raise_salary(0.5);
Name the operators that cannot be overloaded.
Answer:
Name some pure object oriented languages.
What is an adaptor class or Wrapper class?
Answer:
A class that has no functionality of its own. Its member functions hide the use of a third party software component or an object with the non-compatible interface or a non- object- oriented implementation.
What is a dangling pointer?
Answer:
A dangling pointer arises when you use the address of an object after its lifetime is over.
This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed.
What is an Iterator class?
Answer:
A class that is used to traverse through the objects maintained by a container class. There are five categories of iterators:
An iterator is an entity that gives access to the contents of a container object without violating encapsulation constraints. Access to the contents is granted on a one-at-a-time basis in order. The order can be storage order (as in lists and queues) or some arbitrary order (as in array indices) or according to some ordering relation (as in an ordered binary tree). The iterator is a construct, which provides an interface that, when called, yields either the next element in the container, or some value denoting the fact that there are no more elements to examine. Iterators hide the details of access to and update of the elements of a container class.
The simplest and safest iterators are those that permit read-only access to the contents of a container class. The following code fragment shows how an iterator might appear in code:
cont_iter:=new cont_iterator();
x:=cont_iter.next();
while x/=none do
...
s(x);
...
x:=cont_iter.next();
end;
In this example, cont_iter is the name of the iterator. It is created on the first line by instantiation of cont_iterator class, an iterator class defined to iterate over some container class, cont. Succesive elements from the container are carried to x. The loop terminates when x is bound to some empty value. (Here, none)In the middle of the loop, there is s(x) an operation on x, the current element from the container. The next element of the container is obtained at the bottom of the loop.
What is the use of ‘using’ declaration.
Answer:
A using declaration makes it possible to use a name from a namespace without the scope operator.
Define namespace.
Answer:
It is a feature in c++ to minimize name collisions in the global name space. This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions. Furthermore, the compiler uses the namespace signature for differentiating the definitions.
Posted by Subash | 8:16 PM
[1] Comments
VLSI Design:
1) Explain why & how a MOSFET works
2) Draw Vds-Ids curve for a MOSFET. Now, show how this curve changes (a) with increasing Vgs (b) with increasing transistor width (c) considering Channel Length Modulation
3) Explain the various MOSFET Capacitances & their significance
4) Draw a CMOS Inverter. Explain its transfer characteristics
5) Explain sizing of the inverter
6) How do you size NMOS and PMOS transistors to increase the threshold voltage?
7) What is Noise Margin? Explain the procedure to determine Noise Margin
8) Give the expression for CMOS switching power dissipation
9) What is Body Effect?
10) Describe the various effects of scaling
11) Give the expression for calculating Delay in CMOS circuit
12) What happens to delay if you increase load capacitance?
13) What happens to delay if we include a resistance at the output of a CMOS circuit?
14) What are the limitations in increasing the power supply to reduce delay?
15) How does Resistance of the metal lines vary with increasing thickness and increasing length?
16) You have three adjacent parallel metal lines. Two out of phase signals pass through the outer two metal lines. Draw the waveforms in the center metal line due to interference. Now, draw the signals if the signals in outer metal lines are in phase with each other
17) What happens if we increase the number of contacts or via from one metal layer to the next?
18) Draw a transistor level two input NAND gate. Explain its sizing (a) considering Vth (b) for equal rise and fall times
19) Let A & B be two inputs of the NAND gate. Say signal A arrives at the NAND gate later than signal B. To optimize delay, of the two series NMOS inputs A & B, which one would you place near the output?
20) Draw the stick diagram of a NOR gate. Optimize it
21) For CMOS logic, give the various techniques you know to minimize power consumption
22) What is Charge Sharing? Explain the Charge Sharing problem while sampling data from a Bus
23) Why do we gradually increase the size of inverters in buffer design? Why not give the output of a circuit to one large inverter?
24) In the design of a large inverter, why do we prefer to connect small transistors in parallel (thus increasing effective width) rather than lay out one transistor with large width?
25) Given a layout, draw its transistor level circuit. (I was given a 3 input AND gate and a 2 input Multiplexer. You can expect any simple 2 or 3 input gates)
26) Give the logic expression for an AOI gate. Draw its transistor level equivalent. Draw its stick diagram
27) Why don't we use just one NMOS or PMOS transistor as a transmission gate?
28) For a NMOS transistor acting as a pass transistor, say the gate is connected to VDD, give the output for a square pulse input going from 0 to VDD
29) Draw a 6-T SRAM Cell and explain the Read and Write operations
30) Draw the Differential Sense Amplifier and explain its working. Any idea how to size this circuit? (Consider Channel Length Modulation)
31) What happens if we use an Inverter instead of the Differential Sense Amplifier?
32) Draw the SRAM Write Circuitry
33) Approximately, what were the sizes of your transistors in the SRAM cell? How did you arrive at those sizes?
34) How does the size of PMOS Pull Up transistors (for bit & bit- lines) affect SRAM's performance?
35) What's the critical path in a SRAM?
36) Draw the timing diagram for a SRAM Read. What happens if we delay the enabling of Clock signal?
37) Give a big picture of the entire SRAM Layout showing your placements of SRAM Cells, Row Decoders, Column Decoders, Read Circuit, Write Circuit and Buffers
38) In a SRAM layout, which metal layers would you prefer for Word Lines and Bit Lines? Why?
39) How can you model a SRAM at RTL Level?
40) What’s the difference between Testing & Verification?
41) For an AND-OR implementation of a two input Mux, how do you test for Stuck-At-0 and Stuck-At-1 faults at the internal nodes? (You can expect a circuit with some redundant logic)
42) What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?
Infineon:
43) How do you tackle coupling when design deep submicron SRAM memories?
44) Power Optimization Techniques for deep sub micron?
Digital Design:
1) Give two ways of converting a two input NAND gate to an inverter
2) Given a circuit, draw its exact timing response. (I was given a Pseudo Random Signal Generator; you can expect any sequential ckt)
3) What are set up time & hold time constraints? What do they signify? Which one is critical for estimating maximum clock frequency of a circuit?
4) Give a circuit to divide frequency of clock cycle by two
5) Design a divide-by-3 sequential circuit with 50% duty circle. (Hint: Double the Clock)
6) Suppose you have a combinational circuit between two registers driven by a clock. What will you do if the delay of the combinational circuit is greater than your clock signal? (You can't resize the combinational circuit transistors)
7) The answer to the above question is breaking the combinational circuit and pipelining it. What will be affected if you do this?
8) What are the different Adder circuits you studied?
9) Give the truth table for a Half Adder. Give a gate level implementation of the same.
10) Draw a Transmission Gate-based D-Latch.
11) Design a Transmission Gate based XOR. Now, how do you convert it to XNOR? (Without inverting the output)
12) How do you detect if two 8-bit signals are same?
13) How do you detect a sequence of "1101" arriving serially from a signal line?
14) Design any FSM in VHDL or Verilog.
Posted by Subash | 7:26 PM
[10] Comments
Aptitude Questions
1.One of the following is my secret word:AIM DUE MOD OAT TIE.With the list in front of you, if I were to tell you any one of my secret word, then you would be able to tell me the number of vowels in my secret word.Which is my secret word?
Ans.TIE
2.In the following figure:A B C
D
E F G
H
I
Each of the digits 1, 2, 3, 4, 5, 6, 7, 8, and 9 is:
a)Represented by a different letter in the figure above.
b)Positioned in the figure above so that each of A + B + C,C + D +E,E + F + G, and G + H + I is equal to 13.
Which digit does E represent?
Ans.E is 4
3.One of Mr. Horton,his wife,their son,and Mr. Horton's mother is a doctor and another is a lawyer.
a)If the doctor is younger than the lawyer, then the doctor and the lawyer are not blood relatives.
b)If the doctor is a woman, then the doctor and the lawyer are blood relatives.
c)If the lawyer is a man, then the doctor is a man.
Whose occupation you know?
Ans.Mr. Horton:he is the doctor.
4.Here is a picture of two cubes:
a)The two cubes are exactly alike.
b)The hidden faces indicated by the dots have the same alphabet on them.
Which alphabet-q, r, w, or k is on the faces indicated by the dots?
Ans.q
5.In the following figure:
A D
B G E
C F
Each of the seven digits from 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 is:
a)Represented by a different letter in the figure above.
b)Positioned in the figure above so that A*B*C,B*G*E, and D*E*F are equal.
Which digit does G represent?
Ans.G represents the digit 2.
6.Mr. and Mrs. Aye and Mr. and Mrs. Bee competed in a chess tournament.Of the three games played:
a)In only the first game werethe two players married to each other.
b)The men won two games and the women won one game.
c)The Ayes won more games than the Bees.
d)Anyone who lost game did not play the subsequent game.
Who did not lose a game?
Ans.Mrs.Bee did not lose a game.
7.Three piles of chips--pile I consists one chip, pile II consists of chips, and pile III consists of three chips--are to be used in game played by Anita and Brinda.The game requires:
a)That each player in turn take only one chip or all chips from just one pile.
b)That the player who has to take the last chip loses.
c)That Anita now have her turn.
From which pile should Anita draw in order to win?
Ans.Pile II
8.Of Abdul, Binoy, and Chandini:
a)Each member belongs to the Tee family whose members always tell the truth or to the El family whose members always lie.
b)Abdul says ''Either I belong or Binoy belongs to a different family from the other two."
Whose family do you name of?
Ans.Binoy's family--El.
9.In a class composed of x girls and y boys what part of the class is composed of girls
A.y/(x + y)
B.x/xy
C.x/(x + y)
D.y/xy
Ans.C
10.What is the maximum number of half-pint bottles of cream that can be filled with a 4-gallon can of cream(2 pt.=1 qt. and 4 qt.=1 gal)
A.16
B.24
C.30
D.64
Ans.D
11.If the operation,^ is defined by the equation x ^ y = 2x + y,what is the value of a in 2 ^ a = a ^ 3
A.0
B.1
C.-1
D.4
Ans.B
12.A coffee shop blends 2 kinds of coffee,putting in 2 parts of a 33p. a gm. grade to 1 part of a 24p. a gm.If the mixture is changed to 1 part of the 33p. a gm. to 2 parts of the less expensive grade,how much will the shop save in blending 100 gms.
A.Rs.90
B.Rs.1.00
C.Rs.3.00
D.Rs.8.00
Ans.C
13.There are 200 questions on a 3 hr examination.Among these questions are 50 mathematics problems.It is suggested that twice as much time be spent on each maths problem as for each other question.How many minutes should be spent on mathematics problems
A.36
B.72
C.60
D.100
Ans.B
14.In a group of 15,7 have studied Latin, 8 have studied Greek, and 3 have not studied either.How many of these studied both Latin and Greek
A.0
B.3
C.4
D.5
Ans.B
15.If 13 = 13w/(1-w) ,then (2w)2 =
A.1/4
B.1/2
C.1
D.2
Ans.C
16. If a and b are positive integers and (a-b)/3.5 = 4/7, then
(A) b < a
(B) b > a
(C) b = a
(D) b >= a
Ans. A
17. In june a baseball team that played 60 games had won 30% of its game played. After a phenomenal winning streak this team raised its average to 50% .How many games must the team have won in a row to attain this average?
A. 12
B. 20
C. 24
D. 30
Ans. C
18. M men agree to purchase a gift for Rs. D. If three men drop out how much more will each have to contribute towards the purchase of the gift/
A. D/(M-3)
B. MD/3
C. M/(D-3)
D. 3D/(M2-3M)
Ans. D
19. A company contracts to paint 3 houses. Mr.Brown can paint a house in 6 days while Mr.Black would take 8 days and Mr.Blue 12 days. After 8 days Mr.Brown goes on vacation and Mr. Black begins to work for a period of 6 days. How many days will it take Mr.Blue to complete the contract?
A. 7
B. 8
C. 11
D. 12
Ans.C
20. 2 hours after a freight train leaves Delhi a passenger train leaves the same station travelling in the same direction at an average speed of 16 km/hr. After travelling 4 hrs the passenger train overtakes the freight train. The average speed of the freight train was?
A. 30
B. 40
C.58
D. 60
Ans. B
21. If 9x-3y=12 and 3x-5y=7 then 6x-2y = ?
A.-5
B. 4
C. 2
D. 8
Ans. D
22. There are 5 red shoes, 4 green shoes. If one draw randomly a shoe what is the probability of getting a red shoe
Ans 5c1/ 9c1
23. What is the selling price of a car? If the cost of the car is Rs.60 and a profit of 10% over selling price is earned
Ans: Rs 66/-
24. 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen.
Ans: Cannot be determined.
25. The price of a product is reduced by 30% . By what percentage should it be increased to make it 100%
Ans: 42.857%
26. There is a square of side 6cm . A circle is inscribed inside the square. Find the ratio of the area of circle to square.
Ans. 11/14
27. There are two candles of equal lengths and of different thickness. The thicker one lasts of six hours. The thinner 2 hours less than the thicker one. Ramesh lights the two candles at the same time. When he went to bed he saw the thicker one is twice the length of the thinner one. How long ago did Ramesh light the two candles .
Ans: 3 hours.
28. If M/N = 6/5,then 3M+2N = ?
29. If p/q = 5/4 , then 2p+q= ?
30. If PQRST is a parallelogram what it the ratio of triangle PQS & parallelogram PQRST .
Ans: 1:2
31. The cost of an item is Rs 12.60. If the profit is 10% over selling price what is the selling price ?
Ans: Rs 13.86/-
32. There are 6 red shoes & 4 green shoes . If two of red shoes are drawn what is the probability of getting red shoes
Ans: 6c2/10c2
33. To 15 lts of water containing 20% alcohol, we add 5 lts of pure water. What is % alcohol.
Ans : 15%
34. A worker is paid Rs.20/- for a full days work. He works 1,1/3,2/3,1/8.3/4 days in a week. What is the total amount paid for that worker ?
Ans : 57.50
35. If the value of x lies between 0 & 1 which of the following is the largest?
(a) x
(b) x2
(c) -x
(d) 1/x
Ans : (d)
36. If the total distance of a journey is 120 km .If one goes by 60 kmph and comes back at 40kmph what is the average speed during the journey?
Ans: 48kmph
37. A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?
Ans: 6%
38. An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it?
Ans: 9
39. If A/B = 3/5,then 15A = ?
Ans : 9B
40. Each side of a rectangle is increased by 100% .By what percentage does the area increase?
Ans : 300%
41. Perimeter of the back wheel = 9 feet, front wheel = 7 feet on a certain distance, the front wheel gets 10 revolutions more than the back wheel .What is the distance?
Ans : 315 feet.
42. Perimeter of front wheel =30, back wheel = 20. If front wheel revolves 240 times. How many revolutions will the back wheel take?
Ans: 360 times
43. 20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution
Ans: 36%
44City A's population is 68000, decreasing at a rate of 80 people per year. City B having population 42000 is increasing at a rate of 120 people per year. In how many years both the cities will have same population?
Ans: 130 years
45Two cars are 15 kms apart. One is turning at a speed of 50kmph and the other at 40kmph . How much time will it take for the two cars to meet?
Ans: 3/2 hours
46A person wants to buy 3 paise and 5 paise stamps costing exactly one rupee. If he buys which of the following number of stamps he won't able to buy 3 paise stamps.
Ans: 9
47There are 12 boys and 15 girls, How many different dancing groups can be formed with 2 boys and 3 girls.
48Which of the following fractions is less than 1/3
(a) 22/62
(b) 15/46
(c) 2/3
(d) 1
Ans: (b)
49There are two circles, one circle is inscribed and another circle is circumscribed over a square. What is the ratio of area of inner to outer circle?
Ans: 1 : 2
50Three types of tea the a,b,c costs Rs. 95/kg,100/kg and70/kg respectively.
How many kgs of each should be blended to produce 100 kg of mixture worth Rs.90/kg,
given that the quntities of band c are equal
a)70,15,15
b)50,25,25
c)60,20,20
d)40,30,30
Ans. (b)