Sample Computer Science Placement Exams

Sample Placement Exams for Placement out of CSCI-UA.2:

  • Java
  • JavaScript
  • C++
  • C
  • Python
  • If you have experience programming in some language other than Java, C, C++, JavaScript, or Python, it may be possible to arrange for you to take a placement exam. Inquire at the department undergraduate office.

Sample Placement Exams for Placement out of CSCI-UA.4:


Topics Covered by the Java Placement Exam

The Java version of the placement exam covers the following topics:

  • Variables: declaring, initializing, variable scope
  • Types: char, float, double, short, int, long
  • The arithmetic operators: +, -, *, /
  • Increment and decrement operators (e.g. x++)
  • The relational operators: <, <=, >, >= and ==<
  • The boolean operators: &&, || and !
  • Assignment statements and shorthand assignments (e.g. x *= 10). The if / else-if / else statements, including nested if / else-if / else statements
  • The switch statements
  • The while and do/while statements
  • The for loop, including nested for loops
  • Functions and methods
  • Arrays
  • Strings

The Java version of the placement exam does NOT cover:

  • The bitwise operators
  • Classes and objects

Reference: any book on Java programming.

Two Sample Questions for the Java Placement Exam

  1. Fill in the spaces marked with ______ to complete the following Boolean expressions. Do not use the Boolean operator "!" in your answer. Write only in the spaces marked with ______. Assume that X, Y and Z are integer variables.

    • An expression that is true if X is strictly the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 45, the expression should be true, but if X is 50, Y is 40, and Z is 50, the expression should be false, since X is not strictly greater than Z.

      (______) ______ (______)

    • An expression that is true if X is is one of the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 50, the expression should be true.

      (______) ______ (______)

  2. Assume that System.out.print and System.out.println are print functions (the latter printing a carriage return after the output) and assume that there is a method IO.readInt() that reads in an integer. Consider the following method (procedure) in some class:

    public static void main()
    { 
        int n, k, max; 
        max = IO.readInt();     /* read value for max */
        for (n = 0; n < max; n++)
        {
            for (k = 0; k < max; k++)
            {
                if (n > k)
                    System.out.print(" G ");
                else if (n > k)
                    System.out.print(" L ");
                else
                    System.out.print(" E ");
            }
            System.out.println();
        }
    }
    

    Show the output of main() if:

    • the value input for max is 5
    • the value input for max is 1
    • the value input for max is 0

Topics Covereed by the JavaScript Placement Exam

The JavaScript version of the placement exam covers the following topics:

  • Variables: declaring, initializing, variable scope
  • Types: numbers, strings, booleans, arrays
  • The arithmetic operators: +, -, *, /
  • Increment and decrement operators (e.g. x++)
  • The relational operators: <, <=, >, >= and ==<
  • The boolean operators: &&, || and !
  • Assignment statements and shorthand assignments (e.g. x *= 10)
  • The if / else-if / else statements, including nested if / else-if / else statements
  • The switch statements
  • The while and do/while statements
  • The for loop, including nested for loops
  • Functions
  • Arrays
  • Strings

Note: the placement exam uses the prompt() and alert() methods to receive input from a user and to output messages to the user, respectively.

The JavaScript version of the placement exam does NOT cover:

  • The bitwise operators
  • Classes and objects
  • Using JavaScript to manipulate the HTML DOM (Document Object Model)

Reference: any book on JavaScript programming.

Two Sample Questions for the JavaScript Placement Exam

  1. Fill in the spaces marked with ______ to complete the following Boolean expressions. Do not use the Boolean operator "!" in your answer. Write only in the spaces marked with ______. Assume that X, Y and Z are integer variables.

    • An expression that is true if X is strictly the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 45, the expression should be true, but if X is 50, Y is 40, and Z is 50, the expression should be false, since X is not strictly greater than Z.

      (______) ______ (______)

    • An expression that is true if X is is one of the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 50, the expression should be true.

      (______) ______ (______)

  2. Assume that the alert() function prints values of any data type to the screen, and assume that there is a function prompt() that receives input from the user as a string. Consider the following function:

    function main()
    {
        var n, k, max;
        max = prompt("Please enter an integer"); /*read value for max */
        max = parseInt(max);
        for (n = 0; n < max; n++) 
        {
            for (k = 0; k < max; k++) 
            {
                if (n > k)
                    alert(" G ");
                else if (n > k)
                    alert("L");
                else
                    alert("E");
    
            }
        }
    }
    

    Show the output of main() if:

    • the value input for max is 5
    • the value input for max is 1
    • the value input for max is 0

Topics Covered by the C++ Placement Exam

The C++ version of the placement exam covers the following topics

  • Variables: declaring, initializing, variable scope
  • Types: char, float, double, short, int, long
  • The arithmetic operators: +, -, *, /
  • Increment and decrement operators (e.g. x++)
  • The relational operators <, <=, >, >= and ==
  • The boolean operators && and || and !
  • Assignment statements and shorthand assignments (e.g. x *= 10)
  • The if / else-if / else statements, including nested if / else-if / else statements
  • The switch statements
  • The while and do/while statements
  • The for loop, including nested for loops
  • Functions
  • Arrays
  • Strings (as provided by the String class, also known as C++ strings)
  • Standard C++ input and output using cin and cout, as illustrated by the following program which reads two integers from the input and prints them to the output. Notice the use of endl to end the line that is output.
    int main()
    {
        int number1, number2;
        cin >> number1 >> number2; /* read two numbers */
        cout << "The first number that was input was " << number1 << endl;
        cout << "The second number that was input was " << number2 << endl;
        ...
    }
    

The C++ version of the placement exam does NOT cover

  • The bitwise operators
  • Classes and objects
  • Pointers

Reference: any book on C++ programming.

Two Sample Questions for the C++ Placement Exam

  1. Fill in the spaces marked with ______ to complete the following Boolean expressions. Do not use the Boolean operator "!" in your answer. Write only in the spaces marked with ______. Assume that X, Y and Z are integer variables.

    • An expression that is true if X is strictly the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 45, the expression should be true, but if X is 50, Y is 40, and Z is 50, the expression should be false, since X is not strictly greater than Z.

      (______) ______ (______)

    • An expression that is true if X is is one of the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 50, the expression should be true.

      (______) ______ (______)

  2. Consider the following program:

    int main()
    { 
        int n, k, max; 
        cin >> max;     /* read value for max */
        for (n = 0; n < max; n++)
        {
            for (k = 0; k < max; k++)
            {
                if (n > k)
                    cout << " G ";
                else if (n < k)
                    cout << " L ";
                else
                    cout << " E ";
            }
            cout << endl;
        }
        return 0;
    }
    

    Show the output of the program if

    • the value input for max is 5
    • the value input for max is 1
    • the value input for max is 0

Topics Covered by the C Placement Exam

The C version of the placement exam covers the following topics:

  • Variables: declaring, initializing, variable scope
  • Types: char, float, double, short, int, long
  • The arithmetic operators: +, -, *, /
  • Increment and decrement operators (e.g. x++)
  • The address of operator &
  • The relational operators <, <=, >, >= and ==
  • The boolean operators && and || and !
  • Assignment statements and shorthand assignments (e.g. x *= 10)
  • The if / else-if / else statements, including nested if / else-if / else statements
  • The switch statements
  • The while and do/while statements
  • The for loop, including nested for loops
  • Functions
  • Arrays
  • Strings (commonly known as C-strings or null terminated arrays of characters)
  • Standard C input and output using printf and scanf, as illustrated by the following program which reads two integers from the input and prints them to the output.
    int main()
    {
        int number1, number2;
        scanf("%d", &number1);
        scanf("%d", &number2);
        printf( "The first number that was input was %d \n", number1 );
        printf( "The second number that was input was %d \n", number2 );
    }
    

The C version of the placement exam does NOT cover:

  • The bitwise operators
  • Pointers

Reference: any book on C programming

Sample Questions for the C Placement exam

  1. Fill in the spaces marked with ______ to complete the following Boolean expressions. Do not use the Boolean operator "!" in your answer. Write only in the spaces marked with ______. Assume that X, Y and Z are integer variables.

    • An expression that is true if X is strictly the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 45, the expression should be true, but if X is 50, Y is 40, and Z is 50, the expression should be false, since X is not strictly greater than Z.

      (______) ______ (______)

    • An expression that is true if X is is one of the largest of the three variables X, Y and Z. For example, if X is 50, Y is 40 and Z is 50, the expression should be true.

      (______) ______ (______)

  2. Consider the following program:

    int main()
    {
       int n, k, max;
       scanf("%d", &max);   /* read value for max */
       for (n = 0; n < max; n++)
       {
          for (k = 0; k < max; k++)
          {
             if (n > k)
                printf(" G ");
             else if (n > k)
                printf(" L ");
             else
                printf(" E ");
           }
           printf("\n");
       }
       return 0;
    }
    

    Show the output of the program if:

    • the value input for max is 5
    • the value input for max is 1
    • the value input for max is 0

Topics Covered by the Python Placement Exam

The Python version of the placement exam covers the following topics:

  • Variables: integers, floats, strings, and boolean values
  • The arithmetic operators: +, -, *, /, //
  • The relational operators: <, <=, >, >=, and ==
  • The boolean operators: and, or
  • The if / elif / else statements, including nested if / elif / else statements
  • for and while loops, including nested for and while loops
  • lists
  • strings
  • functions and modules
  • dictionaries

The Python version of the placement exam does NOT cover:

  • Classes and objects
  • File I/O

Reference: any book on Python programming

Two Sample Questions for the Python Placement Exam

  1. Write a program that reads 10 different integers and prints the one that has the largest value.

  2. Consider the following: (Note that print(...end='') will print to the same line; and print( ... ) will print to the next line.)

    m = int(input("Enter a number: "))
    for n in range(m):
        for k in range(m):
            if (n > k):
                print (" G ", end='')
            elif (n < k):
                print (" L ", end='')
            else:
                print(" E ", end='')
        print(" ")
    

    Show the output if:

    • the value input for m is 5
    • the value input for m is 1
    • the value input for m is 0

Topics Covered on the Introduction to Web Design Placement Exam

The Web Design placement exam covers the following topics:

  • HTML - page content (text, multi-media, hypertext, tables, lists and other elements that comprise the basic HTML page structure)
  • CSS - page layout, formatting content
  • Photoshop - image manipulation, preparing images for use on the web

It does NOT cover:

  • JavaScript, PHP or other web development languages
  • Adobe Creative Suite - InDesign, Flash, etc.

Two Sample Questions for the Introduction To Web Design Placement Exam

  1. How is the padding property used in CSS? Describe and illustrate your answer with code.

  2. Given the following excerpt from a webpage:

    <head>
        <title>Come to New York City!</title>
        <link href="styles1.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            .lowerHeading {
                font-variant: small-caps;
                color: #336699;
            }
        </style>
    </head>
    
    • TRUE/FALSE: It is clear from the code above that there are images in the body of this webpage.
    • TRUE/FALSE: It is clear from the code above that the first line in the body of this webpage will read "Come to New York City!"
    • TRUE/FALSE: It is clear from the code above that this page contains one in-line style.
    • TRUE/FALSE: It is clear from the code above that an external stylesheet is linked from this page.
    • TRUE/FALSE: Using <span class="lowerHeading">Sample</span> in the body of this webpage will render the word Sample in small-caps.

For further information, please e-mail the Undergraduate Program Administrator.