Complete Real Exam Questions And Correct Answers
(Verified Answers) Already Graded A+ | Newest Exam |
Just Released!!
What maps to an object in ruby - ANSWER-everything
How to identify the reference value in code - ANSWER-
object_id
How to invoke instance - ANSWER-"."
Can you invoke instance on primitives? - ANSWER-yes.
3.to_s
3.odd?
Equality Operator: == - ANSWER-object value equality
s1, s2 = "hi", "hi"
s1 == s2 #=> true
Equality Operator: .equal? - ANSWER-reference value equality
,s1, s2 = "hi",
"hi"
s1.equal? s2 #=>
false
Assignment copies the
_______.
Therefore, they point to (different/same) object(s). - ANSWER-
reference value.
same object.
Aliasing implications on changing variable object values -
ANSWER-changing a
object value one of aliased objects,
changes all values
NOT FOR PRIMITIVE
Immutability in Ruby - ANSWER-numbers, boolean, nil,
symbols
Strings in ruby are (mutable/immutable) - ANSWER-mutable
Arithmetic contraction - ANSWER-+= -= *= /= %= **=
Logical contraction - ANSWER-||= &&=
think of it as x || x = y
,Parallel Assignment - ANSWER-x, y, z = y, 10, radius
equivalent to
x=yy
= 10 z =
radius
Dynamically Typed Signatures - ANSWER-no type specified
def parse(s, i) ...
end
out = parse
t, x
Change Dynamic Type? (NBD/BD) - ANSWER-NBFD
What kind of errors may occur with strongly typed? -
ANSWER-Incompatible
types produce (run
time)
error
Instance of Class Range - ANSWER-ranger =
Range.new(0, 5)
- ( ) not
necessary
, - literal syntax (0..3)
works also
Git Repository - ANSWER-working tree + store + index
Git Working Tree - ANSWER-project itself
Ordinary directory with files & subdirectories
Git Store - ANSWER-history of project
Git Index - ANSWER-virtual snapshot
Gateway for moving changes in the working tree into the store
Git History - ANSWER-DAG of commits
Each commit represents a complete snapshot of the entire
project
Git Revision - ANSWER-Just the manual editing of the file
Git Commit - ANSWER-updates head and branch (permanent)
identified by a hash
Git Branch - ANSWER-a pointer to a commit