Qualifying examination in the software area



Similar documents
City University of Hong Kong. Information on a Course offered by Department of Computer Science with effect from Semester A in 2014 / 2015

Regular Expressions and Automata using Haskell

Row Echelon Form and Reduced Row Echelon Form

A Little Set Theory (Never Hurt Anybody)

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

COMPUTER SCIENCE TRIPOS

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Textbook and References

3. Mathematical Induction

CS 525 Advanced Database Organization - Spring 2013 Mon + Wed 3:15-4:30 PM, Room: Wishnick Hall 113

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Pricing I: Linear Demand

Automata and Computability. Solutions to Exercises

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Chapter 6: Integrity Constraints

Semester Review. CSC 301, Fall 2015

3515ICT Theory of Computation Turing Machines

Reading 13 : Finite State Automata and Regular Expressions

Context free grammars and predictive parsing

Chapter 7: Relational Database Design

Sample Induction Proofs

Method To Solve Linear, Polynomial, or Absolute Value Inequalities:

Chapter 7: Relational Database Design

Basics of Counting. The product rule. Product rule example. 22C:19, Chapter 6 Hantao Zhang. Sample question. Total is 18 * 325 = 5850

Syntaktická analýza. Ján Šturc. Zima 208

Graphing Calculator Workshops

Bottom-Up Parsing. An Introductory Example

Absolute Value Equations and Inequalities

IT2304: Database Systems 1 (DBS 1)

FIRST and FOLLOW sets a necessary preliminary to constructing the LL(1) parsing table

Database Systems Introduction Dr P Sreenivasa Kumar

COMP 356 Programming Language Structures Notes for Chapter 4 of Concepts of Programming Languages Scanning and Parsing

Compiler I: Syntax Analysis Human Thought

Introduction to formal semantics -

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

Chapter 1: Introduction

Introduction to tuple calculus Tore Risch

1 Operational Semantics for While

CSE 562 Database Systems

Introduction to database management systems

Recursive Algorithms. Recursion. Motivating Example Factorial Recall the factorial function. { 1 if n = 1 n! = n (n 1)! if n > 1

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

First programming project: Key-Word indexer

Database System Concepts

IT2305 Database Systems I (Compulsory)

Lesson 4 Web Service Interface Definition (Part I)

03 - Lexical Analysis

Fragmentation and Data Allocation in the Distributed Environments

Chapter 8 Hypothesis Testing Chapter 8 Hypothesis Testing 8-1 Overview 8-2 Basics of Hypothesis Testing

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

arrays C Programming Language - Arrays

MapReduce examples. CSE 344 section 8 worksheet. May 19, 2011

26 Integers: Multiplication, Division, and Order

C H A P T E R Regular Expressions regular expression

Sudoku puzzles and how to solve them

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Automata and Formal Languages

6.2 Permutations continued

Formal Grammars and Languages

Notes on Complexity Theory Last updated: August, Lecture 1

CS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing

EKT150 Introduction to Computer Programming. Wk1-Introduction to Computer and Computer Program

Algorithm & Flowchart & Pseudo code. Staff Incharge: S.Sasirekha

Lecture 9. Semantic Analysis Scoping and Symbol Table

Course Title: Software Development

Computability Theory

Math Circle Beginners Group October 18, 2015

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Programming Languages

Relational Algebra Programming With Microsoft Access Databases

Introduction to Turing Machines

16. Recursion. COMP 110 Prasun Dewan 1. Developing a Recursive Solution

Turing Machines: An Introduction

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Computer Programming I

5 Homogeneous systems

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Schema Design and Normal Forms Sid Name Level Rating Wage Hours

Practice with Proofs

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Unified Lecture # 4 Vectors

Java Application Developer Certificate Program Competencies

Continued Fractions and the Euclidean Algorithm

Software quality improvement via pattern matching

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Computational Models Lecture 8, Spring 2009

MATH10040 Chapter 2: Prime and relatively prime numbers

0.1 Phase Estimation Technique

Applying Attribute Level Locking to Decrease the Deadlock on Distributed Database

NP-Completeness and Cook s Theorem

8 Primes and Modular Arithmetic

Moving from CS 61A Scheme to CS 61B Java

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages

The continuous and discrete Fourier transforms

NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions

Comp151. Definitions & Declarations

Greatest Common Factor and Least Common Multiple

CS321. Introduction to Numerical Methods

Mathematical Induction

Transcription:

Qualifying examination in the software area This is a sample examination involving the following 4 areas: Database systems, compiler design, programming languages, and software engineering. Each area is worth 60 points. You must answer questions from exactly 3 areas of your choosing. Database Systems 1. [5 points] Mention two advantages of a database management system over a file management system. Explain. 2. [20 points] The following tables are part of a relational database. FLIGHTS (Number, DepartureAirportID, ArrivalAirportID, Cost) AIRPORT (AirportID, ZIP) CUSTOMER (CustomerName, ZIP) RETAILER (RetailerName, ZIP) ITEM (ItemID, Model, Brand) ITEM-RETAILER (ItemID, RetailerName, Price, Availability) where primary keys are indicated in bold. Write the following queries using the languages that are indicated. I. [10 points] Find the retailers that have available all the models of brand Western Digital (Relational Algebra). Note: if useful, you can use temporary relational variables. II. [10 points] Find the average price for each retailer of their products of brand Western Digital products. However, we are only interested in retailers that carry at least 10 different models of that brand. (SQL) 3. [15 points] a) [5 points] List all non-trivial functional dependencies that are satisfied by the following relation: S T U s1 t1 u1 s1 t1 u2 s2 t1 u1 s2 t1 u3

b) [10 points] Use Armstrong s rules to prove the soundness of the union rule: If α β holds and α δ holds, then α β δ holds 4. [5 points] Give an example schedule of transactions which is serializable but not serial. 5. [10 points] Supply is a many-many relationship set between entity set Supplier and entity set Part. Supplier has attributes s# and city and Part has attributes p# and color. How are the two entity sets and the relationship set stored in relational tables? 6. [5 points] Consider a transaction where there is a transfer of funds from one account to another. Identify the property of transactions which is required if during the execution of the transaction, there is a failure.

Compiler Design 1. [10 points] The grammar G1: S -> SS a b is ambiguous. That means *some* (at least one) of the strings in its language have more than one leftmost derivation. However, it may be that some strings in the language have only one derivation. a. Give two examples of strings in G1 that have exactly ONE derivation (i.e., no more than one way to derive the string.) b. Give three strings in G1 that have exactly TWO leftmost derivations in G. 2. [16 points] Programming languages are often described using an extended form of a contextfree grammar, where curly brackets are used to denote a construct that can repeat 0, 1, 2, or any number of times. For example: A -> B {C} D says that an A can be replaced by a B and a D, with any number of {C}'s (including 0) between them. This notation does not allow us to describe anything but context-free languages, since an extended production can always be replaced by several conventional productions. Suppose a grammar has the extended production: A -> 1{2}3 Convert this extended production to conventional productions. 3. [34 points] Consider the given grammar G3. ( denotes the empty string). S -> ABCDE A -> a B -> b C -> c D -> d E -> e a. Compute the FIRST of every non-terminal symbol in the grammar. b. Compute the FOLLOW of every non-terminal symbol in the grammar. c. Compute the LL(1) parsing table for G3.

Programming Languages 1. [20 points] a. Suppose that function f is defined by f(p,q,r) = if p<2 q else r, and that function g is defined by g(z) = g(z)+1. Give the result of the function call f(0,4,g(6)) under call-by-value and call-by-name, respectively. b. Give one disadvantage and advantage of call-by-name over call-by-value? 2. [20 points] a. Consider the following piece of code, where fn x => (x+a) is a function that takes argument x and returns the value of x+a. What is the result of b(6) in the code under static scoping and dynamic scoping, respectively? let a = 1 in let b = fn x => (x+a) in let a = 2 in b(6) b. What is the disadvantage of dynamic scoping over static scoping? 3. [20 points] Discuss the concept of automatic garbage collection in programming languages and describe how an algorithm for garbage collection may typically work. Name at least two programming languages whose implementations (e.g., compilers) always include automatic garbage collection. Name and discuss at least 2 mistakes that programmers can make when they write code in a language that does not support automatic garbage collection.

Software Engineering 1. [15 points] (a) Explain the concept of coupling and cohesion. (b) Give examples to contrast tight vs. loose coupling. (c) Give examples to contrast weak vs. strong cohesion. 2. [15 points] Explain the differences between Data Flow-oriented and Object-oriented Design Methods. 3. [30 points] Mutation testing is an important program analysis technique that is used to evaluate the thoroughness of a test set T supplied to a program P. The basic idea of mutation testing is to generate a set of programs that are similar to P by introducing arbitrary errors in P. The programs obtained in this way are called mutants of P. Test set T is deemed adequate if it distinguishes all mutants of P from P. Test set T distinguishes a mutant M from P if there is at least one test case in T that causes M and P to produce different outputs. Now consider the program P below. (Assume that x and y are real variables.) read(x) ; read(y) ; if (x y 3) or (y x 4) then if x + y 10 then write(1) else write(2) else write(3); Note that program P contains two predicates and one predicate. Suppose that mutants of program P are generated by changing the predicates appearing in P into predicates and vice versa. Note that three mutants are obtained by changing a single predicate. Three additional mutants are obtained by changing two predicates simultaneously. A final mutant is obtained by changing all 3 predicates appearing in P. Thus, we have a combined total of seven mutants of P. Given program P and its seven mutants above, generate a test set T that distinguishes all seven mutants from P. Your test set should not contain more than four test cases.

Textbooks: Database System Concepts, Fifth Edition, Avi Silberschatz, Henry F. Korth, S. Sudarshan, McGraw-Hill. Database Systems Elmasri and Navathe, 5 th edition, Pearson, Addison-Wesley. Software Engineering: A Practitioner's Approach, by Roger Pressman, McGraw Hill Object-Oriented and Classical Software Engineering, by S. R. Schach, McGraw Hill. Compilers (2nd ed, Purple Dragon book.): Principles, Techniques and Tools. Aho, Lam, Sethi, Ulman. 2006 edition. Concepts of Programming Languages. Robert Sebesta. Addison-Wesley. 8/e.