Interview Tips Interview Tips, Interview Questions and Answers

30Aug/100

Interview Questions on Networking

What are the factors that affect the performance of NIC?
The following factors affect the performance of NIC,
Bus Speed :- It depends on ISA or PCI slot. PCI has higher speed.
Memory :- More the memory, better the performance.
Memory Access Method :- DMA is faster than I/O method.

What is datagram in a TCP/IP network?
At the network layer of TCP/IP model the data unit created is called the 'datagram '.

ST connectors or SMA connectors are used with which type of cable?
NOTE: This is objective type question, Please click question title for correct answer.

What is a Passive Hub?
Passive hub is a type of hub that do not provide the amplification of signals.

These hub also do not require any external electrical supply.

What are different switching methods used by a switch to send data?
Switch adopts two methods for sending data,

Cut Through Switching:-
In this method of switching data frames are send to the destination computer without error and integrity checking.

Store and Forward Switching:-
In this method the switch sends the data frames after receiving all the frames well as after error and integrity checking.

29Aug/100

Software Testing – Quality Assurance Interview Questions

What is Gray-box testing?
Gray-box testing is the combination of White-box and Black-box

Difference between blackbox testing and whitebox testing
Black box testing - Testing a system without having specific knowledge .
whitebox testing - Testing a system with knowing the internal logic.

What isWhite box testing?
White box testing is opposite to Black box it requires internal know how of how the logic flows. As this testing needs know how of the internal structure it can only be done programmers. Unit testing is one of the ways of doing White box testing in which programmers use NUNIT or JNUIT to test each class individually. White box testing can be done by programmer by either stepping through the code or testing the classes and components in isolation.

What is black box testing
Black box testing is also termed as functional testing. It ignores how the internal
functionality of a system works and depends only what are the outputs on specified
inputs. Source code availability is not an important in back box testing. Black box testing is mostly to ensure that it meets the user functionality.

22Feb/100

What are design patterns

Design patterns are documented tried and tested solutions for recurring problems in a given context. So basically you have a problem context and the proposed solution for the same. Design patterns existed in some or other form right from the inception stage of software development. Let’s say if you want to implement a sorting algorithm the first thing comes to mind is bubble sort. So the problem is sorting and solution is bubble sort. Same holds true for design patterns.

There are three basic classifications of patterns Creational, Structural, and Behavioral patterns.

Creational Patterns

Abstract Factory:- Creates an instance of several families of classes
Builder: - Separates object construction from its representation
Factory Method:- Creates an instance of several derived classes
Prototype:- A fully initialized instance to be copied or cloned
Singleton:- A class in which only a single instance can exist

Note: - The best way to remember Creational pattern is by ABFPS (Abraham Became First President of States).
Structural Patterns

Adapter:-Match interfaces of different classes.
Bridge:-Separates an object’s abstraction from its implementation.
Composite:-A tree structure of simple and composite objects.
Decorator:-Add responsibilities to objects dynamically.
Façade:-A single class that represents an entire subsystem.
Flyweight:-A fine-grained instance used for efficient sharing.
Proxy:-An object representing another object.

Note : To remember structural pattern best is (ABCDFFP)
Behavioral Patterns

Mediator :-D efines simplified communication between classes.
Memento:-Capture and restore an object's internal state.
Interpreter:- A way to include language elements in a program.
Iterator:-Sequentially access the elements of a collection.
Chain of Resp: - A way of passing a request between a chain of objects.
Command:-Encapsulate a command request as an object.
State:-Alter an object's behavior when its state changes.
Strategy:-Encapsulates an algorithm inside a class.
Observer: - A way of notifying change to a number of classes.
Template Method :-D efer the exact steps of an algorithm to a subclass.
Visitor :-D efines a new operation to a class without change.

23Jan/100

Project Management Interview Questions

How do you decide what gets top priority when scheduling your time?
Paid work first! If there is a client waiting for a report or a letter, this takes priority over any other task I have waiting for me.

What are the 4 stages of team development?
1.Forming
2.Storming
3.Norming
4.Performing

Which process is applied to break down the project into smaller, more manageable elements?
Scope Definition is incorrect answer according to A Guide to the Project Management Body of Knowledge (PMBOK) published by PMI. At least the 3rd edition of it which I have. But if I recall it right, it has not been changed in the last draft of the 4th edition I saw.

The process is called Create Work Breakdown Structure (WBS) and it is performed to subdivide the major project deliverables and project work into smaller and more manageable components. The output of this processs is the WBS which represents all work that the team has to perform. See Section 5.3 in the 3rd edition.

19Jan/100

Design Pattern – proxy pattern

Proxy fundamentally is a class functioning as in interface which points towards the actual class which has data. This actual data can be a huge image or an object data which very large and can not be duplicated. So you can create multiple proxies and point towards the huge memory consuming object and perform operations. This avoids duplication of the object and thus saving memory. Proxies are references which points towards the actual object.

Figure ‘Proxy and actual object’ shows how we have created an interface which is implemented by the actual class. So the interface ‘IImageProxy’ forms the proxy and the class with implementation i.e. ‘clsActualImage’ class forms the actual object. You can see in the client code how the interface points towards the actual object.

Figure: - Proxy and actual object

The advantages of using proxy are security and avoiding duplicating objects which are of huge sizes. Rather than shipping the code we can ship the proxy, thus avoiding the need of installing the actual code at the client side. With only the proxy at the client end we ensure more security. Second point is when we have huge objects it can be very memory consuming to move to those large objects in a network or some other domain. So rather than moving those large objects we just move the proxy which leads to better performance.

19Jan/100

What the difference between visitor and strategy pattern

Visitor and strategy look very much similar as they deal with encapsulating complex logic from data. We can say visitor is more general form of strategy.
In strategy we have one context or a single logical data on which multiple algorithms operate. In the previous questions we have explained the fundamentals of strategy and visitor. So let’s understand the same by using examples which we have understood previously. In strategy we have a single context and multiple algorithms work on it. Figure ‘Strategy’ shows how we have a one data context and multiple algorithm work on it.

Figure: - Strategy

In visitor we have multiple contexts and for every context we have an algorithm. If you remember the visitor example we had written parsing logic for every data context i.e. customer, address and phones object.

Figure: - Visitor

So in short strategy is a special kind of visitor. In strategy we have one data context and multiple algorithms while in visitor for every data context we have one algorithm associated. The basic criteria of choosing whether to implement strategy or visitor depends on the relationship between context and algorithm. If there is one context and multiple algorithms then we go for strategy. If we have multiple contexts and multiple algorithms then we implement visitor algorithm.

19Jan/100

Interview question, state pattern

State pattern allows an object to change its behavior depending on the current values of the object. Consider the figure ‘State pattern example’. It’s an example of a bulb operation. If the state of the bulb is off and you press the switch the bulb will turn off. If the state of bulb is on and you press the switch the bulb will be off. So in short depending on the state the behavior changes.

Figure: - State pattern example

Now let’s try to implement the same bulb sample in C#. Figure ‘State pattern in action’ shows both the class and the client code. We have made a class called as ‘clsState’ which has an enum with two state constants ‘On’ and ‘Off’. We have defined a method ‘PressSwitch’ which toggles its state depending on the current state. In the right hand side of the same figure we have defined a client which consumes the ‘clsState’ class and calls the ‘PressSwitch()’ method. We have displayed the current status on the textbox using the ‘getStatus’ function.
When we click the press switch it toggles to the opposite state of what we have currently.

Figure: - State pattern in action

(I) Can you explain strategy pattern?

Strategy pattern are algorithms inside a class which can be interchanged depending on the class used. This pattern is useful when you want to decide on runtime which algorithm to be used.
Let’s try to see an example of how strategy pattern works practically. Let’s take an example of a math’s calculation where we have strategies like add and substract. Figure ‘Strategy in action’ shows the same in a pictorial format. It takes two numbers and the depending on the strategy it gives out results. So if it’s an addition strategy it will add the numbers, if it’s a substraction strategy it will give the substracted results. These strategies are nothing but algorithms. Strategy pattern are nothing but encapsulation of algorithms inside classes.

Figure: - Strategy in action

So the first thing we need to look in to is how these algorithms can be encapsulated inside the classes. Below figure ‘Algorithm encapsulated’ shows how the ‘add’ is encapsulated in the ‘clsAddStatergy’ class and ‘substract’ in the ‘clsSubstractStatergy’ class. Both these classes inherit from ‘clsStratergy’ defining a ‘calculate’ method for its child classes.

Figure: - Algorithms encapsulated

Now we define a wrapper class called as ‘clsMaths’ which has a reference to the ‘clsStatergy’ class. This class has a ‘setStatergy’ method which sets the strategy to be used.

Figure: - Strategy and the wrapper class

Below figure ‘Strategy client code’ shows how the wrapper class is used and the strategy object is set on runtime using the ‘setStatergy’ method.

Figure: - Strategy client code