SkillStorm Interview Prep Flashcards

(52 cards)

1
Q

Length

Array - Find length of Array

len = my________._________; // gets length

A

len = myArray.length;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Length

ArrayList - Find length of ArrayList

len = my________.________(); // gets length

A

len = myList.size(); // gets length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Get

Array - Get item at index 3

x = my_________[]; //gets item at index 3

A

x = myArray[3]; // gets item at index 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Get

ArrayList - Get item at index 9

x = my_________.________( ); // gets item at index 9

A

x = myList.get(9); // gets item at index 9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Insert

Array - Put an item at index 4 equal to 7

my_______[] = __; // sets item at index 4 equal to 7

A

myArray[4] = 7; // sets item at index 4 equal to 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Insert

ArrayList - Put a 7 at the end of the list

my________.________(__); // adds 7 to the end of the list

ArrayList - Put a 7 at the third position

my________.________(__,__); // adds 7 at index 3

A

myList.add(7); // adds 7 to end of list

myList.add(2, 7); // adds 7 to index 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Create

Array - Create different types of arrays

int[] my_______ = _______ int[];

int[] my_______ = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

Dog[] ______ = new _______[__];

A

int[] myArray = new int[10];

int[] myArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

Dog[] dogs = new Dog[25];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Create

ArrayList - Make several types of ArrayList

ArrayList my________ = new Array________<>( );

Array_________ cats = ________ Array________( );

Array________ _________ = new Array________(25);

A

ArrayList myList = new ArrayList<>();

ArrayList cats = new ArrayList();

ArrayList cats = new ArrayList(25);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Array v ArrayList

Array__ArrayList

Length: _______ Length _________ Length

Data Types: _________, Objects ________, Generics

Performance: Get and Insert in __(_) Get and Insert in __(_)

A

Array v ArrayList

Array__ArrayList

Length: Fixed Length Variable Length

Data Types: Primitives, Objects Objects, Generics

Performance: Get and Insert in O(1) Get and Insert in O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

OOPS Concepts:

What is an Object?

Real World ________, ________, and Performs __________

Example: Human ==> Properties ==> ________, Color, _________ etc.

Human ==> Tasks Performed ==> _________, Run, ________, Write etc.

A

Entity, Properties and Performs Tasks

Name, Color, Height

Walk, Run, Read, Write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Class

What is a Class? ________ of an __________

It is a ___________ that an ________ follows

If Human is the Object then __________ can be a Class

Student ==> ________ (variable) ==> ________, __________, __________ etc.

Student ==> ________ => Read, and Write

A

Instance, Object

Blueprint, Object

Student

Properties, Name, Roll Number, DOJ

Tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the Four Pillars of Object Oriented Programming?

____________

____________

____________

____________

A

Abstraction

Polymorphism

Inheritance

Encapsulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Abstraction I

Abstraction refers to only showing ________ _________ and keeping everything else ___________

If car is the class, we can know car.pushGas() is a _______ that will make the car go _________ even if we don’t understand the ________ that makes it do so.

If classes are _________, then one change creates a ________ effect that causes many more _________.

A

essential, details, hidden

method, forward, code

entangled, ripple, changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Abstraction II

Creating an __________ through which _________ can interact ensures that each piece can be __________ developed.

Abstraction allows the program to be worked on ________ and prevents it from becoming _________ and _________.

Determine specific points of __________ that can act as an __________ between _________, and only worry about the implementation when _________ it.

A

interface, classes, individually

incrementally, entangled, (and) complex

contact, interface (between) classes, coding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Polymorphism

Polymorphism describes _________ that are able to take on many ________.

There are two types polymorphism: _________ and _________.

A

methods, forms

static, dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Polymorphism II

continuing Dynamic Polymorphism…

The implementation of the subclass that the _________ is an instance that __________ that of the superclass.

Car and sportsCar both have .drive(miles) ________ but the .drive(miles) on Car class __________ Car.gas 0.04 miles and the .drive(miles) on the sportsCar Class decreases Car.gas by _.__ miles yet that all changes when you make an instance of sportscar called mySportsCar.drive() which will _________ Car.gas by 0.02 but an instance of ________.__________() will decrease the Car.gas by 0.04 miles

A

object, overrides

methods, decreases, 0.02, decrease, myCar.drive, decrease, myCar.drive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Polymorphism III

continuing Dynamic Polymorphism…

Dynamic Polymorphism works because the form of the _________ is decided based on where in the class ________ it is called.

The implementation of a method ____ that will be used is determined _________ as the proram is run

A

method, hierarchy

signature, dynamically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Polymorphism IV

Static Polymorphism cont…

Static Polymorphism occurs during the _________ rather than _________.

Static Polymorphism refers to when multiple methods with the same _________ but different ________ are defined in the ________ class.

How do you differentiate methods of the same name? Different order of ____, Different ________ of parameters and Different ________ of parameters. This is known as method ______. Despite the methods having the same name, their ____ are different due to their ____ arguments.

A

compile-time, runtime

name, arguments, same

parameters, order, types, overloading, signatures, different

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Polymorphism V

Static Polymorphism cont…

Method overloading can cause ____ if you do not keep in mind which _____ you need for which _____.

Using the ______ argument may not cause an error if it matches that of another form of the ____, which can cause issues.

Overall, _____ allows methods to take on many different ____.

When utilizing polymorphism and method ____, be sure that you’re calling the correct ____ of the method.

A

trouble, parameters, implementation

incorrect, method

Polymorphism, forms

overloading, form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Inheritance

____ is the principle that allows classes to derive from other _________.

Subclass inherits from Superclass

____________ ====> ___________.

Game Example:

________ Weapon ====> ________ Sword (weapon.damageType = “sharp”)

OR

class _________ ====> ________ Club (weapon.damageType = “blunt”)

A

Inheritance, classes

Superclass, Subclass

class, class

OR

Sword, class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Inheritance II

Hierarchy:

Class hierarchies created will have many more _______ with many more ________ in each layer.

Class hierarchy acts as a ____ of classes with different ______ to one another

A

layers, classes

web (of) , relationships

22
Q

Inheritance III

Access Modifiers:

Access modifiers change which classes have ________ to other classes, __________, or __________.

The three type of access modifiers are _________, _________, and _________.

Public members can be accessed from anywhere both inside of the class ____ it is defined in as well as ____ in the rest of the ____.

A

access, methods (or) attributes

Public, Private, (and) Protected

hierarchy, outside, program

23
Q

Inheritance IV

Access Modifiers cont. - Private:

Private ____ can only be accessed from within the ____ class that the member is ____.

This allows you to create multiple ____ members of the same name in different ____ so that they do not ____ with one another.

A

members, same, defined

private, locations, conflict

24
Q

Inheritance V

Accessing Modifiers cont. - Protected:

Protected members can be accessed within the ____ it is ____, as well as any ____ of that class.

This essentially makes protected members ____ to the hierarchy in which they are ____.

A

class, defined, subclasses

private, defined

25
Encapsulation I Encapsulation refers to ____ data with methods that can operate on that ____ within a \_\_\_\_. Essentially, it is the idea of ____ data within a class, preventing anything ____ that class from directly ____ with it. This does not mean that ____ of other classes cannot interact at all with the ____ of another \_\_\_\_.
bundling, data, class hiding, outside, interacting members, attributes, object
26
Encapsulation II Methods: Members of other classes can interact with the attributes of another object through its \_\_\_\_. Remember, methods are the ____ defined within the \_\_\_\_. Methods: Getting ====\> Retrieving \_\_\_\_ Methods: Setting ====\> ____ Information Setting methods also allow the programmer to easily keep track of ____ that depend on one another i.e. Method 1 ==\> ____ 2.
methods functions, class Information Changing attributes, Method
27
Encapsulation III Setter Method If you have Class Player1 with attributes Player1.maxHealth and Player1.currentHealth and a method Player.levelUp(), when the player levels up, you want their ____ health to \_\_\_\_. When that happens you want the ____ health to match their max health. Instead of having to increase each type of health separately, you can ____ a ____ setting method. maxHealth ____ method allows both attributes (maxHealth, currentHealth) to be changed ____ as they should, rather than requiring you to ____ change them.
max, increase, current, create, maxHealth setting, simultaneously, individually
28
Encapsulation IV Setter Method cont.: The following setting method ensures that the change to the ____ is within the ____ that is allowed: def setCurrentHealth(\_\_\_\_): \_\_\_\_.currentHealth = newHealth if player.\_\_\_\_ \> player.\_\_\_\_ player.currentHealth = \_\_\_\_.maxHealth
attribute, boundary def setCurrentHealth(newHealth): if player.currentHealth \> player.maxHealth player.currentHealth = player.maxHealth
29
Encapsulation V Getter Method - Chess Example You may also want some attributes to be "\_\_\_\_ only" from the outside To do this, you would define a ____ method but not a ____ method The ____ could only be referenced, not \_\_\_\_. Chess Example You have a Class Piece with attributes \_\_\_\_.rank and \_\_\_\_.file and you want to move this piece so you create a new ____ called Piece.move()
read getter, setter variable, changed Piece, Piece, method
30
Encapsulation VI Getter Method cont.: Piece.move() which allows validation by checking whether the new rank and file is \_\_\_\_, if it's on the ____ still, if it is occupied by a piece of the ____ color and finally if it doesn't put the King in a check position. Information Hiding: It's generally best to not allow ____ classes to directly ____ an object's \_\_\_\_. This is very important when working on ____ and ____ programs.
empty, board, opposite Information Hiding: external, edit, attributes large, complex
31
Encapsulation VII Information Hiding cont.: Each piece should not have access to or rely on the ____ workings of other sections of \_\_\_\_. \_\_\_\_ hiding, or keeping the ____ of one class hidden from external classes, helps you keep control of your ____ and prevent it from becoming too \_\_\_\_. Encapsulation is a vital principle in ____ because it keeps the programmer in control of access to ____ and prevents the program from ending up in a ____ or unwanted state.
inner, code Information, data, program, complicated Object Oriented Programming, data, strange
32
1. What does SQL stand for? 2. What type of Database is it? 3. Who developed it and where and when was it developed? 4. What does SEQUEL stand for? 5. What is SQL? 6. Is it a declarative or a procedural language?
1. Structured Query Language 2. Relational Database 3. Chamberlain and Boyce developed it at IBM in the 1970s 4. Structured English QUEry Language 5. A powerful language that uses English Sentences 6. Declarative
33
Data is a collection of \_\_\_\_, \_\_\_\_, and ____ from different sources. Database is a ____ where data is ____ in a certain \_\_\_\_. Types of Databases: \_\_\_\_, \_\_\_\_, \_\_\_\_, \_\_\_\_, \_\_\_\_, \_\_\_\_, \_\_\_\_, \_\_\_\_ Most popular databases is ____ and \_\_\_\_. A few popular Databases are \_\_\_\_, my\_\_\_\_, \_\_\_\_SQL, \_\_\_\_, SQL \_\_\_\_\_
facts, figures, and values location, stored, format Distributed Database, Centralized Database, Graph Database, Object Oriented Database, Operational Database, NoSQL Database, Cloud Database, Relational Database Relational (and) NoSQL mongoDB, SQL, postgres, Oracle, Server
34
Simple Database Queries: -To make a Database \_\_\_\_ database RajsLibrary -To delete a Database \_\_\_\_ database RajsLibrary
create drop
35
Table is a collection of data in ____ form. Table consists of ____ and \_\_\_\_. Intersecting of a column and row is a \_\_\_\_. Table can have unlimited ____ but numbered amount of \_\_\_\_. Rows are \_\_\_\_. Each column is an ____ of the data i.e. \_\_\_\_, \_\_\_\_, Age, Measurement etc.
tabular columns (and) rows Cell rows, columns Tuples attribute ID, Name
36
1. What is a table constraint? specified by the ____ when creating the \_\_\_\_. 2. When must table constraints be decided? 3. What must you do if you want to change the constraints? 4. What is the list of the Normal Constraints?
1. A restriction specified by the user when creating the table? 2. Before the table is created. 3. You have to delete the table and create a new table with the desired restraints. 4. Not Null, Check Default, Foreign Key, Primary Key, Unique, and Index
37
What will the following queries do? 1. Select \* from RajsLibrary 2. Select ID from RajsLibrary 3. SELECT FName FROM Student WHERE City = "Clearwater"
1. This will produce the whole table 2. This will produce only the column with the ID attribute 3. This will produce all rows with the FName attribute where the city attribute is Clearwater
38
- -\>AND Query - \>This operator displays a record if ____ the conditions separated by AND are \_\_\_\_. - -\>OR Query - \>This operator displays a record if ____ of the conditions separated by OR is \_\_\_\_. - -\>NOT Query - \>This operator displays a record if the \_\_\_\_(s) are NOT TRUE - -\>INSERT INTO Query - \>If we want to insert any new ____ or ____ into a table then we can use the INSERT INTO query
ALL, TRUE ANY, TRUE CONDITION(S) RECORD (or) DATA
39
--\> AGGREGATE FUNCTIONS ===\>COUNT Function ==\>This function returns the number of ____ that match specified \_\_\_\_ ===\>AVERAGE Function ==\>This function returns the ____ value of a numeric \_\_\_\_ ===\>SUM Function ==\>This ____ returns the ____ of a numeric column ===\>MIN Function ==\>This function returns the ____ value of the ____ column
rows, criteria average, column function, sum smallest, selected
40
--\>GROUP BY ---\>Used in SQL to arrange ___ data into groups with the help of some \_\_\_\_. --\>HAVING ---\>Use to place ____ where we need to decide which group will be the part of ____ result-set --\>ORDER BY ---\>This keyword is used to sort the \_\_\_\_-\_\_\_\_ in ascending or ____ order. --\>NULL VALUES ==\>IS NULL is used to test the ____ values ==\>\>IS NOT NULL is used to test for \_\_\_\_-\_\_\_\_ values --\>UPDATE ---\>The Update command is used to modify ____ in a table
identical, functions conditions, final result-set, descending empty non-empty rows
41
\>DELETE - --\>The SQL DELETE command is used to delete ____ that are no longer ____ from the database tables - -\>IN OPERATOR - --\>IN operator is used to specify multiple values inside the ____ clause. It acts as short for multiple \_\_\_\_ - -\>BETWEEN OPERATOR - --\>BETWEEN operator will select a particular ____ within the specified \_\_\_\_.
rows, required WHERE, OR value, range
42
BIG-O Rules 1. If you have steps in your \_\_\_\_, you ____ them: O(a + b) 2. ____ constants. 3. Different ____ ==\> ____ variables 4. Drop non-\_\_\_\_\_ terms
1. algorithm, add 2. Drop 3. inputs, different 4. dominant
43
HashMap: - Allows you to store \_\_\_\_-\_\_\_\_ associations - HashMap is similar to a \_\_\_\_. - HashMaps allows us to convert a large ____ into a shorter \_\_\_\_-\_\_\_\_ value that will represent the ____ string - In Java, every object has a method ____ int \_\_\_\_( ) that will return a hash value for a given \_\_\_\_
Key-Value Dictionary string, fixed-length, original public, hashcode(), object
44
Stacks & Queues Both are ____ structures Both have various \_\_\_\_ Stacks: Last In First Out (\_\_\_\_) Queue: \_\_\_\_ In First ____ (FIFO)
linear sizes LIFO First, Out
45
- Each box in a ____ can be considered an object considering we have made a ____ called "Box" for each ____ in our LinkedList. - Int Data represents whatever ____ is in each box and that can be anything from \_\_\_\_, \_\_\_\_, etc. - A regular LinkedList goes in ____ direction and the ____ will be all the way to the ____ like how we read. - head.\_\_\_\_ would give the data in the first ____ all the way to the left - head.next.data would give us the ____ in the ____ box from the \_\_\_\_
LinkedList, class, node data, integers, strings one, head, left data, box data, second, left
46
-\> Abstraction --\> Showing only ____ parts ---\> hiding the \_\_\_\_ ===\> Android Application ==\> AP -\> Polymorphism --\> Performing the same ____ (task means method) in different ways Examples: 1. ____ ( ) 2. Add (\_\_\_ a, ____ b) draw Polygon( ) 1. Draw a \_\_\_\_ 2. ____ rectangle 3. Draw \_\_\_\_ Note: All three are \_\_\_\_
essential, implementation tasks 1. Add () int, int square Draw triangle polygons
47
We can implement the ____ with: 1. Method ____ -\> Can be achieved with Compile-Time 2. ____ Overriding -\> Can be achieved with \_\_\_\_-\_\_\_\_.
polymorphism Overloading Method, Run-Time
48
Encapsulation is the mechanism of wrapping up ____ and code acting on the ____ together as a single \_\_\_\_. Encapsulation is achieved by ____ the variables of a class as ____ and then providing the public setter and ____ methods to modify and ____ the variables values. An ____ in java is a ____ of a class which contains static constants and ____ methods and enables ____ inheritance and helps in achieving ____ coupling and lastly it provides 100% of \_\_\_\_
data, methods, unit declaring, private, getter, view interface, blueprint, abstract, multiple, loose, abstraction
49
An ____ class is a template definition to methods and variables of a ____ that contains ___ or more abstracted \_\_\_\_\_. It can provide from ____ to \_\_\_\_% of abstraction Abstract Classes must be declared with an ____ keyword, can have abstract and \_\_\_\_-abstract methods, cannot be \_\_\_\_, and can have ____ and static methods. Run-Time Polymorphism or ____ Polymorphism is resolved during ____ time. Method ___ is an example of run ____ polymorphism An ____ method is called through the ____ variable of a Superclass
abstract, class, one, methods 0 (to) 100 abstract, non, instantiated, constructor dynamic, run Overriding, time overridden, reference
50
Rules of Overloading 1. Overriding method ____ list must match the ____ method 2. The ____ type must be the same or ____ of overridden method 3. Access level cannot be more ____ than the overridden method
argument, overridden return, subtype restrictive
51
Compile Time Polymorphism or ____ Polymorphism is resolved during ____ time Overloading is an example of ____ time polymorphism 1. Overloaded methods must have a different ____ list. 2. It can have different ____ types if ____ list is \_\_\_\_. 3. It can throw different \_\_\_\_. 4. It can have different ___ modifiers
Static, compiler compile 1. argument 2. return, argument, different 3. exceptions 4. access
52
Object Oriented Programming 1. ____ Up approach 2. Divided into \_\_\_\_ 3. Has ____ modifiers 4. Objects can move & communicate with each other through ____ functions 5. More \_\_\_\_ 6. Supports \_\_\_\_ Procedural Programming 1. Top ____ approach 2. Divided into \_\_\_\_ 3. Doesn't have ____ modifiers 4. Data can move freely from ____ to ____ in the system 5. Less \_\_\_\_ 6. Does not support \_\_\_\_
1. Bottom 2. objects 3. Access 4. member 5. secure 6. overloading 1. Down 2. functions 3. Access 4. function (to) function, 5. secure 6. overloading