Computer Science Concepts

C++

What is the difference between a pointer and a reference?
A reference must always refer to some object and, therefore, must always be initialized; pointers do not have such restrictions. A pointer can be reassigned to point to different objects while a reference always refers to an object with which it was initialized.

What is the difference between const char *myPointer and char *const myPointer?
Const char *myPointer is a non constant pointer to constant data; while char *const myPointer is a constant pointer to non constant data.

Constructor - go ahead and throw exception
Destructor - never throw an exception

What is the difference between a copy constructor and an overloaded assignment operator?
A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class.

IP

Application - DNS, HTTP, SSH

Transport - TCP, UDP
encapsules application data blocks into data units (datagrams) suitable for transmission (and reverse)

Internet - IP (v4, v6)
3 functions: (1) For outgoing packets, select the "next hop" host (gateway) and transmit the packet to this host by passing it to the appropriate Link Layer drivers; (2) for incoming packets, capture packets and pass the packet payload up to the appropriate Transport Layer module, if appropriate. (3) In addition it provides error detection and diagnostic capability.
Link - ARP, RARP
physical and logical network components used to interconnect hosts or nodes
Address Resolution Protocol (ARP) is the method for finding a host's link layer (hardware) address when only its Internet Layer (IP) or some other Network Layer address is known

TCP/IP


Connection-based - SYN, SYN-ACK, ACK (3-way handshake)
Reliable - checksum computed for each packet; cumulative acknowledgment sent to sender; packets resent if not received
Ordered - receiver buffers packets to ensure they are in order
Termination - FIN, FIN-ACK, ACK
Security: SYN Flood - clients sends SYN packets, & server allocates resources before receiving ACK (causes half-open connections)

UDP


Simple packet structure: Source/Destination Ports, Checksum, Length, Data
No connection/no termination
No reliability - no re-sends, not guaranteed to be in order
Uses: streaming video, DNS