CSE 3901 FINAL – RAILS ACTUAL
EXAM PAPER 2026 QUESTIONS WITH
ANSWERS GRADED A+
◍ mod 1 question 2 : printing.
Answer: what prints? --> don't use quotationsgive statement: functionName
(x), where x is _______(acceptable values)or give valueslist out acceptable
values
◍ mod 1 question 3 : conversion code and math operators.
Answer: def functionName (param): conversion code block math operators:
+, -, *, / return convertedValue
◍ mod 1 question 4: what is a test case.
Answer: test case: possible input together with corresponding correct output
format: input(#), output(# or "str")or functionName(input)----> output # or
"str"
◍ Advantages Thin Clients have over Thick Clients.
Answer: performance, flexibility, robustness, security
◍ mod 2 question 2: for loops JS.
Answer: just write values produced for first parts use OFfor (var i of
array){}array.length function call
◍ Unit Testing.
Answer: Individual components are tested in isolation under unit test (UUT).
Black box is testing only to specifications, White box is testing based on
code structure
◍ mod 2 question 2: sumLargercalculate the sum of numbers larger than 2nd
paramif <= 2nd param , return 0.
, Answer: function sumLarger(arr, num){ var retVal = 0; for ( var i of arr){ if
( var i > num){ retVal = retVal + i; } } return retval;}
◍ mod 2 question 2: countLargercalculate the number of array entries whose
lengths are >= 2nd param else, return 0.
Answer: function countLarger (array, num){ var retVal = 0; for ( var i of
array){ if ( i.length >= num){ retVal = retVal + 1; } }return retVal;}
◍ mod 2 question 3: lists.
Answer: creating an empty list appending an empty list for var i in range (0,
len(list), num)
◍ mod 2 question 2: prodNegativecalculate the product of all the numbers that
are < 0if all numbers = 0 or >0, return 1.
Answer: function prodNegative (array) { var retVal = 1; for ( var i of array){
if ( i < 0){ retVal = retVal * i } } return retVal; }
◍ mod 2 question 3: doubleStrreturns newList with 2 copies of each entry.
Answer: def doubleStr (list): retVal = [ ] for i in list: retVal.append(i)
retVal.append (i) return retVal
◍ mod 2 question 3: strPrefixreturns new list containing the same number of
entries as first param but each entry contains 2nd param str added a start of
entry.
Answer: def strPrefix (list, prefix): retVal = [ ] for i in list: retVal. append(
prefix + i) return retVal
◍ Integration Testing.
Answer: Modules are tested in combination to check interfaces. Best done
incrementally. Bottom Up: start with most basic, easy to exercise all
features, can write a driver for higher levelsTop down: Start at top (main)
test interfaces early
◍ System Testing.
Answer: Verify that systems as a whole meet the requirements and
specifications.alpha: tested by developers before releasebeta: by "friendly
customers" before general releaseacceptance: by end customer, they better
, be happy!
◍ mod 2 question 3: skipListreturn new list containing every nth value, n is
value of 2nd param.
Answer: def skipList (list, num): retVal = [ ] for i in range ( i, len(list),
num): retVal.append(list[i]) return retVal
◍ TDD.
Answer: Test Driven Development
◍ Repository = ?.
Answer: working tree + store
◍ mod 2 question 4: csv files.
Answer: format goes through each line give example lines where won't print
because the line isn't true under if statement
◍ working tree.
Answer: the project itself, an ordinary directory including files and sub
directories. developers retrieve copies to work on
◍ store.
Answer: hidden directory (.git) in root directory of working tree. Brings in a
time component. You should never access .git directly
◍ mod 3 question 2.
Answer: JSONpython import json json.loads()---> JSON to readible
json.dumps()--> readible to JSONJS JSON.parse() ---> JSON to
readibleJSON.stringify() --> readible to JSON
◍ Commit.
Answer: creates a snapshot, each is identified by a hash and is almost
guaranteed to be unique.
◍ Index.
Answer: virtual snapshot stored at .git/index. this is a gateway for moving
changes made in the working tree to the store
◍ Snapshot.
EXAM PAPER 2026 QUESTIONS WITH
ANSWERS GRADED A+
◍ mod 1 question 2 : printing.
Answer: what prints? --> don't use quotationsgive statement: functionName
(x), where x is _______(acceptable values)or give valueslist out acceptable
values
◍ mod 1 question 3 : conversion code and math operators.
Answer: def functionName (param): conversion code block math operators:
+, -, *, / return convertedValue
◍ mod 1 question 4: what is a test case.
Answer: test case: possible input together with corresponding correct output
format: input(#), output(# or "str")or functionName(input)----> output # or
"str"
◍ Advantages Thin Clients have over Thick Clients.
Answer: performance, flexibility, robustness, security
◍ mod 2 question 2: for loops JS.
Answer: just write values produced for first parts use OFfor (var i of
array){}array.length function call
◍ Unit Testing.
Answer: Individual components are tested in isolation under unit test (UUT).
Black box is testing only to specifications, White box is testing based on
code structure
◍ mod 2 question 2: sumLargercalculate the sum of numbers larger than 2nd
paramif <= 2nd param , return 0.
, Answer: function sumLarger(arr, num){ var retVal = 0; for ( var i of arr){ if
( var i > num){ retVal = retVal + i; } } return retval;}
◍ mod 2 question 2: countLargercalculate the number of array entries whose
lengths are >= 2nd param else, return 0.
Answer: function countLarger (array, num){ var retVal = 0; for ( var i of
array){ if ( i.length >= num){ retVal = retVal + 1; } }return retVal;}
◍ mod 2 question 3: lists.
Answer: creating an empty list appending an empty list for var i in range (0,
len(list), num)
◍ mod 2 question 2: prodNegativecalculate the product of all the numbers that
are < 0if all numbers = 0 or >0, return 1.
Answer: function prodNegative (array) { var retVal = 1; for ( var i of array){
if ( i < 0){ retVal = retVal * i } } return retVal; }
◍ mod 2 question 3: doubleStrreturns newList with 2 copies of each entry.
Answer: def doubleStr (list): retVal = [ ] for i in list: retVal.append(i)
retVal.append (i) return retVal
◍ mod 2 question 3: strPrefixreturns new list containing the same number of
entries as first param but each entry contains 2nd param str added a start of
entry.
Answer: def strPrefix (list, prefix): retVal = [ ] for i in list: retVal. append(
prefix + i) return retVal
◍ Integration Testing.
Answer: Modules are tested in combination to check interfaces. Best done
incrementally. Bottom Up: start with most basic, easy to exercise all
features, can write a driver for higher levelsTop down: Start at top (main)
test interfaces early
◍ System Testing.
Answer: Verify that systems as a whole meet the requirements and
specifications.alpha: tested by developers before releasebeta: by "friendly
customers" before general releaseacceptance: by end customer, they better
, be happy!
◍ mod 2 question 3: skipListreturn new list containing every nth value, n is
value of 2nd param.
Answer: def skipList (list, num): retVal = [ ] for i in range ( i, len(list),
num): retVal.append(list[i]) return retVal
◍ TDD.
Answer: Test Driven Development
◍ Repository = ?.
Answer: working tree + store
◍ mod 2 question 4: csv files.
Answer: format goes through each line give example lines where won't print
because the line isn't true under if statement
◍ working tree.
Answer: the project itself, an ordinary directory including files and sub
directories. developers retrieve copies to work on
◍ store.
Answer: hidden directory (.git) in root directory of working tree. Brings in a
time component. You should never access .git directly
◍ mod 3 question 2.
Answer: JSONpython import json json.loads()---> JSON to readible
json.dumps()--> readible to JSONJS JSON.parse() ---> JSON to
readibleJSON.stringify() --> readible to JSON
◍ Commit.
Answer: creates a snapshot, each is identified by a hash and is almost
guaranteed to be unique.
◍ Index.
Answer: virtual snapshot stored at .git/index. this is a gateway for moving
changes made in the working tree to the store
◍ Snapshot.