Skip to content

Instantly share code, notes, and snippets.

@fredthekid
fredthekid / The Technical Interview Cheat Sheet.md
Created March 16, 2016 21:15 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
from collections import deque
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Codec:
After Reading 126import.txt:
1+1i
2+2i
3.3+3.4i
4.4-4.5i
-5.5-5.6i
-6+0i
0+7i
0-8i
@fredthekid
fredthekid / watchdoghw.cpp
Last active March 10, 2016 23:11
cmpe244 watchdog hw
/* Add this line to /L5_Application/Source/terminal.cpp
* cp.addHandler(taskStartSuspend, "task", "Watchdog HW");
*
* Add this line to /L5_Application/handlers.hpp
* CMD_HANDLER_FUNC(taskStartSuspend);
*
* Add this function to L2_Drivers/src/rtc.c
* const char* myTimeFunction(void)
* {
* time_t rawtime;
@fredthekid
fredthekid / semaphore.cpp
Last active December 4, 2022 20:50
semaphore
SemaphoreHandle_t buttonSemaphore = NULL;
void port2Pin6Init()
{
uint32_t pin6 = 1 << 6;
LPC_GPIO2->FIODIR &= ~(pin6);
}
void port6ButtonPressInterrupt()
{
@fredthekid
fredthekid / producerconsumerhw6.cpp
Last active March 10, 2016 23:12
Producer Consumer Tasks hw6
typedef enum
{
invalid,
up, // z is positive
down, //z is negative
left, //x is negative
right, // x is positive
front, //y is positive
back, //y is negative
@fredthekid
fredthekid / taskhw5.cpp
Created March 16, 2015 00:57
FreeRTOS Task hw5
void t1(void *p)
{
while(1)
{
uart0_puts("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
vTaskSuspend(0);
}
}
void t2(void *p)
@fredthekid
fredthekid / i2chw4.cpp
Last active March 10, 2016 23:11
i2c hw4
//I2C Assignment
//Created By: Fred Sun
//Worked with Noe Quintero
//ADDITIONAL COMMENTS:
//contains only ADDITIONALLY ADDED code for the I2C assignment
//contains code added to i2c_base.hpp/cpp, i2c2.hpp/cpp, terminal.cpp, handlers.hpp/cpp, and "a file I created".hpp/cpp
//Start of functions and variables added to i2c_base.hpp
//Slave initialization function
@fredthekid
fredthekid / uarthw3.cpp
Last active March 10, 2016 23:10
uart hw3
// Code contains files that are part of 5 separate files in my workspace.
// I believe the parts that are more important for checking is "Start of handlers.cpp" and "Start of "the file I made" .cpp"
// P.S. although it looks long, it is essentially the length divided by half. uart2 and uart3 have pretty much the same stuff
//Start of "the file I made" .cpp and .hpp code
//UART2 HW Headers
void initUART2();
void uart2Baud(uint32_t baudRate);
bool uart2SendByte(char send);
char uart2GetByte(void);
@fredthekid
fredthekid / spihw2.cpp
Created February 23, 2015 13:17
spi hw2
//Function headers
void flashSpiInit();
char spiGiveAndTake(char send);
void read512BytesFlashMemory();
void readManufacAndDeviceID();
void readFlashStatusReg();
void readGoodStuff();
//initialize SSP1
void flashSpiInit()