Technical Questions Flashcards

1
Q

What is an Index?

A

A Data structure that makes it faster to retrieve records from a database

  • -> Lets you sort records on multiple fields
  • -> Holds a value for the field, as well as a pointer to the related record
  • -> Index is then sorted, letting you do binary searches on it

Example:
Database of students, primary key is student ID which is sorted. Lets say you have names, and grades
If you want to query a student with a certain name, without indexing you’d have to look through every single row
if you index based on the student name, with that field sorted you can use a binary search which is much faster

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

What is a Compound Index?

A

A single index that references more than one field

  • -> You can have more than one index and that way if you are querying an item on more than one field, you can get that record faster.
  • -> can also save time if you want to sort the results, so if the field is indexed it will be pre sorted so you don’t have to sort it after retrieving it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Correlated Query

A

A Nested Query,

so a query in a query, where the inner query uses values from the outer query

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

What happens when I submit a query to a database?

A
  1. Syntax is checked
  2. Checks if the tables and columns you are referencing exist
  3. Determines whether to return results from memory or from the storage system depending on whats faster
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you go about troubleshooting a performance issue?

A

Start by looking at

  • -> Disk Usage
  • -> Memory Usage
  • -> CPU Usage
  • -> Network Bandwidth

Monitor any running applications to see if they are hogging resources
Is the issue consistent or intermittent?
You might need to log performance and try to replicate the issue to narrow it down to a specific piece of software or process

Linux –> Top or Htop, Vmstat
Windows –> Task Manager

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

What is TCP?

A

Transmission Control Protocol

  • -> Breaks down application data in to packets
  • -> Sends or accepts the packets from the network layer
  • -> handles error checking
  • -> Acknowledges when packets arrive
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is UDP?

A

User Datagram Protocol

  • -> Less latency than TCP
  • -> Doesn’t check if packets were sent successfully
  • -> Drops errors, but relies on the application to deal with the results
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is DNS

A

Domain Name System
–> Translates names into IP addresses,
Example: www.mongodb.com in a web browser, the DNS resolves this to the public IP of the website

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

What is DHCP?

A

Dynamic Host Configuration Protocol

  • -> Leaves it up to the host to automatically assign IP addresses to clients
  • -> Will ensure you don’t have IP conflicts
  • -> IP addresses of clients won’t stay consistent
  • -> You can set a static IP address to make sure it will stay the same for that client
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain RAID

Raid 0, 1, 5 and 10

A

RAID –> Redundant array of disks, combines multiple disks into one cohesive unit

RAID 0 –> Data is written across multiple disks, so you utilize all the disks to write data making it faster

RAID 1 –> Data is copied across disks so you have redundancies

RAID 5 –> Faster than raid 1 but also has fault tolerance. Not sure about the details

RAID 10 –> uses twice as many disks, but if one fails you don’t have to read from all the disks to rebuild it, just mirrored one

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

What Utilities can you use in Linux to monitor performance?

A

Top or HTop –> display CPU usage, memory usage, swap memory, process PIDs and a bunch of other stuff
Lsof –> lists all open files, can help to figure out what files are in use
tcpdump –> lets you analyze network packets
netstat –> gives network statistics
Iostat –> if you install sysstat you can use it to show I/O storage statistics

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

How do you troubleshoot a connection issue between an application and a database server?

A
  1. Check the connection string
  2. Ensure the network connection is alive
  3. Make sure your drivers are up to date?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does Swap Space work?

A

Used to free up RAM by using Disk Space

  • -> Looks for blocks of memory that are rarely used and stores them in the disk
  • -> frees up space for RAM

thats the extent of my understanding

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

How do you configure RAM and CPU in a docker?

A

I’m not super experienced using docker

–> I assume you can configure this using the CLI, unsure of the exact command

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

How do you split data across mongo servers?

A

“Shard” the collection of data

  • -> Look at how many entries there are and how big they are, then come up with a uniform size to split it into
  • -> Then you can spread the entries out over different machines to utilize more hardware for faster performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why does Mongo/NoSQL scale better?

A

MongoDB stores data in non structured documents
Binary formatted JSON
Self contained documents, so they can be spread out across multiple nodes

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

What are C-Groups?

A

A container for processes where you can limit the resources that group of processes is allowed to use

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

What layers in the OSI model are Routers and Switches on?

A

Routers are on the network layer (3)

Switches are on the data link layer (2)

Routers work with IP addresses and have services like QoS, NAT
switches work with MAC addresses, don’t really offer many services

19
Q

How can you optimize a slow database?

A
  • -> Optimize the queries you are using
  • -> Use better indexing or compound indexes
  • -> Use better hardware for storage
  • -> Spread the database over multiple machines
20
Q

What is Memory Ballooning in a VM?

A

Memory Management Feature

–> Takes back unused memory that was allocated to other virtual machines

21
Q

What is TLS / SSL?

A

Transport Layer Security / Secure Socket Layer

  • -> Used for emailing, instant messaging, VOIP, and HTTPS
  • -> Uses certificates between two computer applications to ensure integrity and authentication
  • -> Runs on application layer
  • -> Handshake protocol, checks type of encryption, authentication, and exchanging session keys
  • -> SSL is deprecated, TLS is newer but the names are sometimes used interchangably
22
Q

What is SSL

A

Secure Sockets Layer

–>

23
Q

Using vmstat, what information is given about swap space?

A
  • Swap cache (kb)
  • Total, used and free swap (kb)
  • Pages swapped in/out
24
Q

What do you do if you get a “no valid OpenPGP data found” error?

A

Check that your public GPG key exists using

sudo apt-key list

25
Q

When importing public key used by package management system, you get a
“gpg: no valid OpenPGP data found.” error.

How do you check that the key exists on the system?

A

Check that your public GPG key exists using

sudo apt-key list

26
Q

Authentication to database deployment failed.

What are possible solutions?

A

Authentication –> Check username/password, connection string and make sure password is encoded properly if there are special characters

Too many open connections –> Close database connections, restart application,

27
Q

What is the difference between a document store and a relational database?

A

Relational Databases store data in separate defined tables. A single object can be spread across multiple tables

Document Store –> Can use unstructured data, so you don’t have to define the schema first, so they are easier to update.
Documents are independent and can be scaled horizontally
A document store stores all information for a given object in a single instance in the database, and every object can be different

28
Q

What Linux CLIs would you use to isolate a performance problem?

A

Top, Iostat and netstat

29
Q

What are MongoDBs Core Values?

A
Think Big, Go Far
Build Together
Embrace the Power of Differences
Make it Matter
Be Intellectually Honest
Own What You Do
30
Q

How does MongoDB provide consistency?

A

Uses Reader-Writer locks
allows simultaneous readers to access database/collection
always offers private access to single writes

31
Q

What is a Replica Set?

A

Group of Mongo instances that maintains the same data set

provides redundancy and high availability

32
Q

What are the key features of MongoDB

A

Automatic Scaling
High Performance
High Availability

33
Q

What is CRUD?

A

Create
Read
Update
Delete

34
Q

What is Sharding?

A

Storing data on multiple machines

35
Q

What can Impact MongoDB (Database) Performance?

A

Hardware availability
Number of open database connections
Database Access Strategies

36
Q

What is a Gateway IP used for?

A

When packets are being sent outside the network, they are first passed to the gateway which will send them to their destination

37
Q

What is Swappiness?

A

Swappiness is a setting that changes how aggressively the kernel will try to swap memory pages

38
Q

What is a subnet?

A

A network inside a network
Generally, the first three octets of an IP address will define the subnet
in a basic configuration you can have 254 IP addresses within each subnet,
there are a ton of different configurations to split up the subnets further

39
Q

What is CPU affinity?

A

You can bind or unbind specific CPU cores from specific processes

40
Q

What is memory management?

A

Provides ways to dynamically provide memory to processes and free up memory that is no longer being used

41
Q

What is process management?

A

Involves creating, scheduling and terminating processes.

42
Q

How does Traceroute work?

A

Traceroute will send packets of data to a destination, dropping them along the way to send back an error message, this way you can measure the time between each hop

43
Q

You accidentally do
cd /bin; chmod 644 chmod

How do you fix it?

A

Perl script

perl -e ‘chmod 0755 “/bin/chmod”’