Chris Pollett> Old Classses >
CS257

( Print View )

Student Corner:
[Final Exam-PDF]

[Submit Sec1]
[Grades Sec1]

[Lecture Notes]
[Discussion Board]

Course Info:
[Texts & Links]
[Description]
[Course Outcomes]
[Outcomes Matrix]
[Course Schedule]
[Grading]
[Requirements/HW/Quizzes]
[Class Protocols]
[Exam Info]
[Regrades]
[University Policies]
[Announcements]

HW Assignments:
[Hw1] [Hw2] [Hw3]
[Hw4] [Hw5] [Quizzes]

Practice Exams:
[Midterm] [Final]

CS257 Fall 2020 Practice Midterm 1

For the midterm I would suggest you:

  • Know how to do (by heart) all the practice problems.
  • Go over your notes at least three times. Second and third time try to see how much you can remember from the first time.
  • Go over the homework problems.
  • Try to create your own problems similar to the ones I have given and solve them.
  • Skim the relevant sections from the book.
  • If you want to study in groups, at this point you are ready to quiz each other.

The practice midterm is below. Here are some facts about the actual midterm:

  1. It is open book, open notes, open internet, however, you are not allowed to discuss problems on the midterm with classmates or other people until after the midterm submission period is over.
  2. It will be posted by the start of class time on the midterm day as one of the links on the side of the class homepage.
  3. You submit the midterm for grading using the same mechanism as to submit homeworks.
  4. It is designed to take an 1h15m, however, you can submit it up until midnight on the day it is posted.
  5. Some problems will be dependent on some personal information about you such as your ID, and you will not receive credit if you don't make use of this information correctly.
  6. One problem will be off the practice midterm.

Practice Problems

On practice midterm day, please post your problem solutions to the Practice Midterm Thread.

  1. Define the following concepts. For each, give an example that makes use of either your first name or your student Id. (a) semi-structured data. (b) a DTD <!ELEMENT ...> tag (b) a DTD <!ATTLIST ...> tag.
  2. Give an example XML Schema that would be suitable for a collection of business cards. Give an XML document consisting of a single business card using this schema involving your name and details. Give an XSLT that could format documents according to this schema as HTML.
  3. Write an XPath expression to retrieve all business cards in a business card collection of people who live in San Jose and whose last name contains your last name. Explain the difference between the DOM API and SAX API for accessing XML documents.
  4. Briefly describe the following three approaches to storing XML in a traditional RDBMS: (a) Document-Oriented Approach, (b) Data-Oriented Approach, and (c) Combined Approach.
  5. Explain how your business card document from Problem 2 might be stored in an RDBMS using a schema oblivious mapping. How could we store and manipulate the XML as XML in Mysql? Postgres?
  6. Explain and give an example using your name of how to use XQUERY FLWOR expressions to (a) order the result of computing an xpath expression, (b) format the results of computing a query as a particular kind of XML document, (c) compute the join on some attributes of two XML documents.
  7. Give a collection of predicates that might be suitable for describing movies. Write down an RDF document using these predicates in N3 notation. Give an example SPARQL query to this document that uses prefix, select, and where clauses.
  8. Give a REST api that might be suitable for a stock quote web site, make sure it has an operation that can return daily stock prices for the last week. Give an example JSON document that might be returned by this operation. Explain how we might store a cache value of such a document using memcached. (Say how to run a memcache server and how such a value could be stored using the memcache protocol.)
  9. Explain how gossiping works in Cassandra and what purpose it serves. Give an example of consistent hashing. Give the CAP theorem.
  10. Explain and give a concrete example of how to create a database and a collection in MongoDB. Give commands to insert several items into this collection, and give an example of query these items and returning the result. Explain how map reduce aggregation can be done in MongoDB.