Last updated 2017 March 22

Exam Questions by topic

Look at and become familiar with the exam instructions. exam instructions for class exams and the final examination.

Exam questions can be based on the following sources: (1) on-line web sites, (3) classes, (4) reports, (5) exercises, and (6) course web pages. The class detail on exam days gives the topics for that exam.

Consider all concepts and terminology used in on-line web sites, reports, and classes and ask the typical questions - how, why, when, where and what -- individually and in combination. In particular, variations are based on "describe", "explain", "define", "what is meant by", etc. you will be asked to do variations of some of the exercises done in class and in reports.

History of the web questions

  1. Describe four reasons why HTML5 is a good thing for web developers.
  2. Describe the origins of the Internet.
  3. Describe the creation of the World Wide Web.

How does the Internet work questions

  1. Provide a brief definition for HTML and HTTP and explain the difference between the two.
  2. Describe what are static and dynamic websites, and what is the difference between the two?
  3. Describe what is an IP address.
  4. Describe what the system DNS, Domain Name Server, does.

HTML questions

  1. What does HTML stand for?
  2. What is a markup language?
  3. What is the basic structure of a markup language?
  4. What is an HTML tag? What is its relationship to an HTML element?
  5. Given a table, give good and correct HTML text that would render the table.
  6. Given a diagram of a page, give good and correct HTML text to render the page.
  7. Given an HTML file, find and describe the errors in the file.

CSS questions

  1. Describe the CSS box model for styling HTML elements.
  2. Given a CSS style sheet explain to which elements in an HTML file each style affects; i.e. what do the style selectors select.
  3. Given a picture of a part of a web page, give correct HTML and CSS text that would render the contents of the diagram.
  4. Given a CSS style sheet describe how given HTML elements would be rendered.
  5. Describe the general structure of a two-column page as demonstrated in the examples page header in the right column and page header across the top of both columns.
  6. Describe the general structure of a two-column page as demonstrated in the examples page header in the right column and page header across the top of both columns.
  7. Describe how you can alternate between one- and two-column layout on a page.
  8. For each of the following selectors describe which elements of an HTML file are affected, and when each style selector affects those elements.
    1. p:before { ... }
    2. p.tip { ... }
    3. p .tip { ... }
    4. ::selection { ... }
    5. a.ex1:hover { ... }
    6. a.ex1:active { ... }
    7. div + p { ... }
    8. p ~ ul { ... }
    9. div > p { ... }
    10. .mynav ul ul { ... }
    11. .mynav ul ul li { ... }
    12. nav ul:after { ... }
    13. nav ul li { ... }
    14. nav ul li:hover { ... }
    15. nav ul li:hover a { ... }
    16. nav ul li a { ... }
    17. nav ul ul li a { ... }
    18. nav ul li:hover > ul { ... }

JavaScript generic questions

All these and similar questions can be answered by thinking about the items in the JavaScript topics page and the example programs discussed in class.
  1. Given a script determine what it does.
  2. Given a partial script fill in the blanks to accomplish the specified task.
  3. Given one or more functions describe what they do. For example, what would be written to a web page?
  4. Given an function written with if..else statements, write a corresponding program with a switch statement, and vice-versa.
  5. Given a function written with a while loop, write the algorithm a do..until loop, and vice-versa.
  6. Describe the two types of choice-control structure in JavaScript. When do you choose one type over the other; i.e. what are their respective advantages and disadvantages.
  7. Describe the how to handle errors with the try-catch-throw statements.
  8. Describe the three types of control structure used in programming in any language.
  9. Describe the sources of errors in a program.
  10. Describe the types of error provided by JavaScript.
  11. What is an object literal and how is it used?

JavaScript examples of functions that you could be asked to write

All of these and other functions can be written with the concepts shown on the JavaScript topics page and the example programs we have discussed in class. You have to write the algorithm; you cannot use a built-in function that does the task.
  1. Return the maximum of three numbers. For example:
              var max =  max_of_three(2, 30, -5)
              // The value of max would be 30
  2. Reverse the items in an array or list. For example:
              var a1 = [1, 2, 3, 4, 5];
              var a2 = reverse(a1):
              // The value of a2 would be [5, 4, 3, 2, 1]. And
              var a3 = reverse(a2);  // has the value [1, 2, 3, 4, 5]
  3. Find the maximum number a list of numbers.
  4. Find the length of each string a in list with different types of items.
  5. Find the sum of the numbers in a list, where the list could contain both numbers and non-numbers. For example in the list [1, “a”, “b, 2, true, 3] the sum of the numbers is 6.
  6. Given a list of arbitrary items. Count the number of strings or numbers or Booleans the list contains. There are many criteria that could be used for counting: how many are negative numbers; how many numbers are bigger than 100; how many strings contain the letter ‘A’ and are of length less than 5.
  7. Given two lists of numbers, do the lists have the same numbers in the same order?
              // r1 is true.
              var r1 = same_numbers( [1, 2, 3, 4, 5], [1, 2, 3, 4, 5])
              // r2 is false.
              var r2 = same_numbers([1, 2 ,3, 4, 5], [1, 2, 3, 5, 4])