CS 151 - Key Skills and CS 151 - Key Skills - Quiz: Difference between pages

From Computer Science at Indiana State University
(Difference between pages)
Jump to navigation Jump to search
m 1 revision imported
 
wiki_previous>Jkinne
 
Line 1: Line 1:
The following are key skills/knowledge that you need to retain after completing CS 151 Introduction to Computer Science.  For any course that has CS 151 as a prerequisite, we will assume that on day one of the new course you could "ace" a quiz on all of the following contentThis is the most important content to be ready for the next courses. See also [[CS Skills Assessments]] for other courses as well.   
Note that this is an example of what can be used as a quiz over CS 151 material for courses that have CS 151 (or CS 201 or 202) as a prerequisite.  For example, those taking CS 201 are assumed to have gained/retained the skills/knowledge to do well on this quiz.   


''Note - this list is a first draft and is being reviewed by the faculty.''
Note that this sample quiz is not exhaustive.  See [[CS 151 - Key Skills]] for a full list of the key skills.


=Key Skills/Knowledge=
Note that for an actual quiz, it is likely that the following questions would be put in random order and your instructor would likely only take a subset of each type.
==Linux==
All commands and shortcuts listed in and linked from [[Linux and CS Systems - Getting Started]].  You should be able to (a) match each command and shortcut with its basic description, (b) use all of the commands and shortcuts to accomplish basic tasks (e.g., create a new directory HW in your home directory and copy all files from ~cs151/HW/ into your new HW directory), (c) describe what a given command would do (e.g., ls -l /u1/class/).


==Programming==
Note - please do study these, and the rest of the items from the [[CS 151 - Key Skills]]! We want you to be ready for the class, and studying for this skills quiz should help!
* Python cheat sheets listed at the end of [[Python Programming - Getting Started]].  You should be able to give the short description given any of the keywords, function names, or operators (and vice versa). 
* Basic programs - able to complete the programs listed in [[Programming Assignments - Beginning 1]] on demand without much trouble and without consulting the internet. You should be able to produce a correct program for any of these in a short amount of time (right away for many of them, for most of the others you might need a little bit of time).  You should be able to do this on paper or on the computer. You should be able to do the same for other programming tasks of similar difficulty.
* Complete the missing code - if given mostly complete code to accomplish a task that is roughly as complex as those programs, you are able to complete the code (e.g., filling in the right condition on a loop, the right statement to update a variable, anything that is just one line or so).
* Play computer - given code you are able to trace out what happens to the variables and what is printed on the screen as the program is run.
* Syntax errors - given code that contains a syntax error you are able to identify and fix the syntax error (e.g., mismatched (), using [] where should have been (), improper indenting, missing :, mis-spelled or mis-capitalized python keyword or function, etc.)
* Logical errors - given code with some logical error(s) and a description of what the program is supposed to do, you are able to debug to fix the problems.


==Math==
=Linux and Terminal=
You should have all of the items in [[Math for CS - Getting Started]] memorized and be able to apply them as needed.
Fill in the blank, what is the shortcut or key used in the linux terminal for each of the following.
* Press this key to execute a command:
* Keys that let you run a previously typed command again:
* Key to press to auto-complete a filename or command:
* Shortcut for current directory (one character):
* Shortcut for directory one level up from current:
* Shortcut for your home directory (one character):
* Shortcut for the top of the entire file system (one character):
* Characters to put around a filename that has spaces:
* Wildcard character:


==CS Terms==
Fill in the blank, what is the linux command to do each of the following.
You should have all of the items in [[CS Terms - Getting Started]] memorized.
* Get how long since last system reboot:
==System Setup==
* Get information about disk free space:
You have access to a computer that is setup as directed in [[Linux and CS Systems - Getting Started]].  In particular you should have Python installed, an sftp program installed (FileZilla or WinSCP recommended), and a terminal program installed (Putty if using Windows, Terminal if using Mac).
* Get which user is currently logged in on the terminal:
* Get what computer are you currently running commands on:
* Get which directory are you inside of:
* Clear the terminal screen:
* See which other users are currently logged in:
* Help about a command (manual):
* Change directory:
* Make a new directory:
* List directory contents:
* Flag/option to use with previous command to list details of files:
* Copy file(s):
* Remove files:
* Remove directory:
* Move or rename a file or directory:
* A terminal text editor:
* Change your password:
* Print out first few lines of a file:
* Change file permissions:
* Display current system memory usage:
* See current time and date:


==Algorithms Basics==
Give the complete linux terminal command to complete each of the following tasks.  ''Tasks such as these could be asked about.''
You should understand how the following algorithms work, be able to trace through running the algorithm on paper, and understand the time complexity of the algorithm (worst and best-case): linear search, binary search, selection sort. You should understand the basics of asymptotic running time notation and concepts. An understanding at the level covered at [TutorialsPoint](https://www.tutorialspoint.com/data_structures_algorithms/index.htm) is all that is required (and note that you only need to know these particular topics, not everything from the TutorialsPoint link).
* Create a new directory HELLO in your home directory:
* Copy the contents of jkinne's GREAT directory into your home directory:
* Change directory to your home directory:
* Check to see who is logged in:
* List the contest of the directory ~cs151/ including the sizes of the files:


=Example Quiz=
=Python Keywords and Functions=
Note that the following example quiz contains questions from most, but not all, of the topics listed above.
What is the python keyword or function for each of the following.
* exit the current loop:
* in a loop, go to next iteration of the loop:
* determine whether two objects are the same object (not just value):
* load a module (two keywords):
* declare a function:
* loop with only condition:
* conditional statements (three keywords):
* loop with that iterates through a list:
* keyword to send a value back from a function:
* boolean operator, True only if both sides are True:
* boolean operator, True if either side is True:
* boolean operator, negates:
* boolean values (two keywords):
* remove from a list by position:
* handle an exception, basic use (2 keywords):
* raise/indicate an exception (2 keywords):
* test if something is inside of a list/string/tuple/dictionary:
* special value for a variable that has no value:
* empty statement that does not do anything:
* function to write to the screen:
* functions to convert to integer, floating point number, or string (3 functions):
* function to generate a sequence of numbers:
* function to get the length of a string, list, or tuple:


[[CS 151 - Key Skills - Quiz]]
What is the name of the following programming concept.
* text data type:
* data type for True and False:
* data type that stores numbers with fractional parts (e.g., 3.14 or 2.2):
* data type that stores only integers:


=Assessment of Prior Learning=
=Python Operators and Expressions=
For those who have the skills and knowledge detailed on this page but have not taken the course CS 151 (and do not have transfer credit for an equivalent course), it may be possible to be evaluated, pay a reduced tuition amount (25% of the normal cost of tuition for the course), and get credit for the course. This would be done through a challenge exam.
What are the Python3 operators for each of the following.
* multiplication, subtraction, addition:
* integer division:
* floating point division:
* remainder:
* exponentiation:
* testing membership in a string, tuple, or list:


The challenge exam has two parts: (1) a closed-notes timed exam taken through the university's course management system, (2) a follow up interview with a CS evaluator. The timed exam is graded using the same standards that are used in CS 151.
Evaluate the following Python3 expressions.  ''Expressions similar to these could be asked.''
For the follow up interview, the evaluator asks for explanations of some of the responses from the timed exam and asks some follow up questions from the timed exam. The follow up interview is scored using the same standards that are used for interview exams in beginning CS courses. The total score for the challenge exam is a simple average of the two parts of the exam. A student is normally judged to have passed the challenge exam if their total score is at or above 80%.
* 4 - 2 * 1
* 1 + 2 ** 3
* 7 // 2
* 'hello'[0:2]
* range(0, 4)
* '3' + '2'
* int('3') + int('2')
* '3' * 2
* 'Hello'.upper()
* len('hi there')


If you are considering going through this process, please look through all of the material linked from this page. Pay particular attention to the CS 151 exam study guides (at the bottom of [[CS 151 - Key Skills - Quiz]]), and make sure that you think you are likely to score higher than 80% on these types of questions.  
=Basic Python Programs=
Write a complete and correct Python3 program to do the following.  ''Programs of similar complexity as these could be asked.''
* Print the integers from 1 to 10 along with those numbers squared.
* Take two integers as input from the user and print a rectangle of *'s with those dimensions.
* Ask the user for the answer.  If they type "42", print "but what is the question.".  If they don't type "42" ask again, and keep asking until they type "42".
* Print the powers of 2 up to 1024 (which is 2**10).


If you would like to go through with the evaluation, you start the process by completing and following the instructions on this form -
=Play Computer=
https://catalog.indstate.edu/mime/media/53/1846/Assessment+of+Prior+Learning.pdf
Write down all variables in each of the following programs and keep track of their values as well as what is printed on the screen.  ''Programs of similar complexity as these could be asked.''
<pre>
def fun(n):
  if n <= 0: return
  print(n)
  fun(n//2)
fun(42)
</pre>


Some more information on the process is at https://catalog.indstate.edu/content.php?catoid=53&navoid=2639#de
<pre>
for i in range(0, 5):
  for j in range(i, 5):
    print('x'*j)
</pre>
 
<pre>
L = 'what is the meaning of this?'.split()
for x in L:
  print(x, 'a' in x)
</pre>
 
=Math=
Complete each of the following math rules.
* 2<sup>a+b</sup> =
* y<sup>a</sup> * y<sup>b</sup> =
* log<sub>b</sub>x = y, means:
* log<sub>b</sub>(x<sup>y</sup>) =
* Arithmetic Sum: (1 + 2 + ... + n) =
* not (A and B) is equivalent to:
 
=CS Terms=
What is the definition of each of the following.
* bit:
* byte:
* KB:
* K Hz:
* RAM:
* SSD:
* CPU:
 
=Base Systems=
Do the following conversions between bases. Show your work. 0 work == 0 credit.
* Convert 15 from decimal to binary:
* Convert 1010 from binary to decimal:
* Convert 1010 from binary to hexadecimal:
 
What is the largest number possible for each of the following. Show your work. 0 work == 0 credit.
* Decimal number with 3 digits:
* Binary number with 3 bits (it's binary and decimal value):
* Hexadecimal number with 2 digits (it's hex and decimal values):
 
=Algorithms=
Should understand the following basic algorithms: linear search, binary search, selection sort.  Should be able to "play computer" to show how the algorithms would work on a sample input.  Should know the big-O running times of these algorithms and roughly what this means.
 
=Additional Questions=
Additional sample questions - [https://cs.indstate.edu/info/files/cs151-exam1-study-guide-s2022.pdf CS 151 Exam 1 Study Guide], [https://cs.indstate.edu/info/files/cs151-exam2-study-guide-s2022.pdf CS 151 Exam 2 Study Guide]

Revision as of 16:19, 8 August 2022

Note that this is an example of what can be used as a quiz over CS 151 material for courses that have CS 151 (or CS 201 or 202) as a prerequisite. For example, those taking CS 201 are assumed to have gained/retained the skills/knowledge to do well on this quiz.

Note that this sample quiz is not exhaustive. See CS 151 - Key Skills for a full list of the key skills.

Note that for an actual quiz, it is likely that the following questions would be put in random order and your instructor would likely only take a subset of each type.

Note - please do study these, and the rest of the items from the CS 151 - Key Skills! We want you to be ready for the class, and studying for this skills quiz should help!

Linux and Terminal

Fill in the blank, what is the shortcut or key used in the linux terminal for each of the following.

  • Press this key to execute a command:
  • Keys that let you run a previously typed command again:
  • Key to press to auto-complete a filename or command:
  • Shortcut for current directory (one character):
  • Shortcut for directory one level up from current:
  • Shortcut for your home directory (one character):
  • Shortcut for the top of the entire file system (one character):
  • Characters to put around a filename that has spaces:
  • Wildcard character:

Fill in the blank, what is the linux command to do each of the following.

  • Get how long since last system reboot:
  • Get information about disk free space:
  • Get which user is currently logged in on the terminal:
  • Get what computer are you currently running commands on:
  • Get which directory are you inside of:
  • Clear the terminal screen:
  • See which other users are currently logged in:
  • Help about a command (manual):
  • Change directory:
  • Make a new directory:
  • List directory contents:
  • Flag/option to use with previous command to list details of files:
  • Copy file(s):
  • Remove files:
  • Remove directory:
  • Move or rename a file or directory:
  • A terminal text editor:
  • Change your password:
  • Print out first few lines of a file:
  • Change file permissions:
  • Display current system memory usage:
  • See current time and date:

Give the complete linux terminal command to complete each of the following tasks. Tasks such as these could be asked about.

  • Create a new directory HELLO in your home directory:
  • Copy the contents of jkinne's GREAT directory into your home directory:
  • Change directory to your home directory:
  • Check to see who is logged in:
  • List the contest of the directory ~cs151/ including the sizes of the files:

Python Keywords and Functions

What is the python keyword or function for each of the following.

  • exit the current loop:
  • in a loop, go to next iteration of the loop:
  • determine whether two objects are the same object (not just value):
  • load a module (two keywords):
  • declare a function:
  • loop with only condition:
  • conditional statements (three keywords):
  • loop with that iterates through a list:
  • keyword to send a value back from a function:
  • boolean operator, True only if both sides are True:
  • boolean operator, True if either side is True:
  • boolean operator, negates:
  • boolean values (two keywords):
  • remove from a list by position:
  • handle an exception, basic use (2 keywords):
  • raise/indicate an exception (2 keywords):
  • test if something is inside of a list/string/tuple/dictionary:
  • special value for a variable that has no value:
  • empty statement that does not do anything:
  • function to write to the screen:
  • functions to convert to integer, floating point number, or string (3 functions):
  • function to generate a sequence of numbers:
  • function to get the length of a string, list, or tuple:

What is the name of the following programming concept.

  • text data type:
  • data type for True and False:
  • data type that stores numbers with fractional parts (e.g., 3.14 or 2.2):
  • data type that stores only integers:

Python Operators and Expressions

What are the Python3 operators for each of the following.

  • multiplication, subtraction, addition:
  • integer division:
  • floating point division:
  • remainder:
  • exponentiation:
  • testing membership in a string, tuple, or list:

Evaluate the following Python3 expressions. Expressions similar to these could be asked.

  • 4 - 2 * 1
  • 1 + 2 ** 3
  • 7 // 2
  • 'hello'[0:2]
  • range(0, 4)
  • '3' + '2'
  • int('3') + int('2')
  • '3' * 2
  • 'Hello'.upper()
  • len('hi there')

Basic Python Programs

Write a complete and correct Python3 program to do the following. Programs of similar complexity as these could be asked.

  • Print the integers from 1 to 10 along with those numbers squared.
  • Take two integers as input from the user and print a rectangle of *'s with those dimensions.
  • Ask the user for the answer. If they type "42", print "but what is the question.". If they don't type "42" ask again, and keep asking until they type "42".
  • Print the powers of 2 up to 1024 (which is 2**10).

Play Computer

Write down all variables in each of the following programs and keep track of their values as well as what is printed on the screen. Programs of similar complexity as these could be asked.

def fun(n):
  if n <= 0: return
  print(n)
  fun(n//2)
fun(42)
for i in range(0, 5):
  for j in range(i, 5):
    print('x'*j)
L = 'what is the meaning of this?'.split()
for x in L:
  print(x, 'a' in x)

Math

Complete each of the following math rules.

  • 2a+b =
  • ya * yb =
  • logbx = y, means:
  • logb(xy) =
  • Arithmetic Sum: (1 + 2 + ... + n) =
  • not (A and B) is equivalent to:

CS Terms

What is the definition of each of the following.

  • bit:
  • byte:
  • KB:
  • K Hz:
  • RAM:
  • SSD:
  • CPU:

Base Systems

Do the following conversions between bases. Show your work. 0 work == 0 credit.

  • Convert 15 from decimal to binary:
  • Convert 1010 from binary to decimal:
  • Convert 1010 from binary to hexadecimal:

What is the largest number possible for each of the following. Show your work. 0 work == 0 credit.

  • Decimal number with 3 digits:
  • Binary number with 3 bits (it's binary and decimal value):
  • Hexadecimal number with 2 digits (it's hex and decimal values):

Algorithms

Should understand the following basic algorithms: linear search, binary search, selection sort. Should be able to "play computer" to show how the algorithms would work on a sample input. Should know the big-O running times of these algorithms and roughly what this means.

Additional Questions

Additional sample questions - CS 151 Exam 1 Study Guide, CS 151 Exam 2 Study Guide