Technical Interview Questions - Java

Terms in this set (67)

⦁ Produces programs by composing mathematical functions and avoids shared state & mutable data
⦁ Programming paradigm (defined as a standard, perspective, or set of ideas. Comes up a lot in the academic, scientific, and business worlds)

⦁ An essential concept of JavaScript
⦁ Pure Functions
⦁ A function where the return value is only determined by its input values, without observable side effects
⦁ Ie. Math functions
⦁ Math.cos(x)
⦁ Computing it does not change x, does not write to log files, do network requests, ask for input, or change the program state
⦁ A style of building the structure and elements

⦁ In all programs there are two primary components:
⦁ The data (what a program knows)
⦁ Behaviors

⦁ OOP sas that bringing together data and its associated behavior in a single location (object) makes it easier to understand how a program works -- data is supplied to an object at creation
⦁ Ie. instance variables (lives in the object)

⦁ FP says that data and behavior are distinctively different things and should be kept separate for clarity
⦁ Ie. Data structure is an array of arrays
⦁ employees = [
[ "Bob", 100000.0 ],
[ "Jane", 125000.0 ]
]

⦁ Or in hashes
⦁ Instead of converting the data to an object and then calling methods on it, we write a pair of standalone methods called change_salaries (plural) and change_salary (singular). We pass change_salaries two arguments: the array of arrays representing our data and the change amount. change_salaries uses map instead of the each method we used in the OOP version

⦁ Which is better?
⦁ Depends on what you want to accomplish
⦁ Object driven or asking 'do I even need objects to do what I need to do?'
;