Motorola – Test Pattern

MOTOROLA Technical Questions

  1. ____________allows for these paration of object interactions from classes and inheritance in to distinct layers of abstraction.
    • Dispatching
    • Loosening
    • Decoupling
    • Detaching


  2. The least frequently used (LFU) page replacement algorithm requires
    • the page with the smallest count to be replaced.
    • the page with the longest count to be replaced.
    • the page with the smallest count was brought in,yet to be used.
    • the page with the longest count was brought in,yet to be used.

  3. What is meant by parametric polymorphism?
    • A function or a data type can be written generically so that it can handle values identically without depending on their type
    • A function or a data type can be written generically so that it can handle values identically being dependant on their type
    • A function or a data type that can accept parameters
    • Both(A)and(C)
  4. Recursive functions are executed in a
    • last in first out order
    • first in first out order
    • parallel order
    • last in last out order

  5. Follow the code snippet and chose the correct statement(s)
    Int m;
    void f2()
    {
    int m=1; // line1
    ::m=2; // line2
    m=2; //line3
    }
    • The statement inline 1 throws a compilation error
    • Inline 2, m=2 is assigned to the global m
    • Inline 3, m=2 is assigned to the global m and line2 throws compilation error
    • Both A and B

  6. Assume that the Point class is existing with the following snippet in the header file
    Point.h:
    class Point
    { Point(); Pont(int, int); int GetX();
    int GetY();
    void SetX(int);
    void SetY(int);
    };
    If the objects of Point are created as Point oPointOne, oPointTwo(2,3); Which of the following statements are correct?
    (i) The statement oPointOne.SetX(20); will compile and run successfully.
    (ii) The statement oPointOne.SetX(20).SetY(30); will compile successfully but will give a run time error.
    • Only (i) is correct
    • Both (i) and (ii) are correct
    • Both (i) and (ii) are incorrect
    • Only (ii) is correct