3 ways to ace a software interview

Have an interview with a big IT company like Microsoft, Apple or Google? Not to fear!
Whether you're in quality assurance, testing, development or program manager, here is part 1 of our 3 part series on 10 easy areas that you can practice and study for within 72 hours that will help you nail that job. We've even throw in a few sample questions for you to test yourself. Enjoy!
1) Brainteasers
These are to determine whether or not you are capable of thinking outside the box.
Sample question: A bear walks one mile south, turns left and walks one mile to the east and then turns left again and walks one mile north and arrives at its original position. How many points on Earth can the bear accomplish this and where are these points located.
2) Polymorphism / Inheritance
Polymorphism allows values of different data types to be handled using a uniform interface. Can do this at run-time or statically.
A programmer might use inheritance when he/she needs to make multiple classes use similar methods calls and members. Adding new functionality to the parent class (as protected or public) will ensure that children classes obtain the same functionality. Child classes are considered to be specialized versions of the parent class so parents cannot call child functionalities. Remember, children can wear parent clothing but parents cannot wear children clothing.
Sample question: Say you have a parent class Cat with a method "Roar". This parent class has two child classes, DomesticCat and WildLion, each with their own "Roar" method. What will this output? If it fails, when does it fail and why?
class Cat{
public virtual void Roar()
{
print("I'm a Cat");
}
}
class DomesticCat:Cat
{
public virtual void Roar()
{
print("I'm a DomesticCat");
}
}
class WildLion:Cat
{
public virtual void Roar()
{
print("I'm a WildLion");
}
}
main[String [] args]
{
Cat c;
c = new DomesticCat();
print(c.Roar());
WildLion w;
w = new DomesticCat();
print(w.Roar());
}
3) Interfaces
A programmer might use interfaces when he/she needs to ensure that method calls are similar method calls only. If a new method must be added, it must be added to all related classes else they will fail at compile time. In C#, a class may implement multiple interfaces.
Sample question: You have a class called "Animal" with a method called "Speak", an interface called Fish with method "Swim", an interface called Bird with a method "Fly". Create a class called Duck that implements both interfaces and inherits from Animal. Override all methods.
class Animal {
private string name;
public Animal(string n){n = name;}
public void Speak(){print("My name is "+name);}
}
interface IFish{
public void Swim();
}
interface IBird{
public void Fly();
}
More to come in Part 2....








Comments
Post new comment