This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you delete the default Storyboard etc., put this in the AppDelegate.m | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
When setting things like images in cells, reuse the cells. For some reason, if you allocate a fresh cell, it doesn't work. | |
Pass data between controllers, rather than views, or modifying the view of the next controller. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Select Image View Mode for Image Resizing if its bigger than the screen. | |
* Delegate - Add callbacks somewhere else when something changes. | |
* protocol and interface are synonyms in objc. | |
Delegate Pattern | |
* Can use delegate instead of passing around controllers. | |
* Mark protocol methods as @optional if you dont need them. | |
* Check this via respondsToSelector method. | |
* KVO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Do binary search on a rotated array. | |
Eg., given [100, 110, 121, 5, 11, 44, 78, 91, 99], be able to binary search on it. | |
2. Implement the * and / operations without actual multiplication and division. | |
3. Implement the ^ operator without using any in-build exponentiation methods. | |
4. Implement the median of an unsorted array in O(n). | |
5. Implement sqrt() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Delivery/Logistics: | |
Instacart | |
Munchery | |
Lyft | |
Sidecar | |
Uber | |
Thumbtack | |
DoorDash | |
Grubhub | |
Seamless |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdio> | |
#include <vector> | |
#include <event2/event.h> | |
#include <glog/logging.h> | |
#include <cassert> | |
#include <string> | |
#include <cstring> | |
#include <sys/socket.h> | |
#include <netinet/in.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <cassert> | |
using namespace std; | |
struct Edge { | |
int src, dst; | |
int w; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cassert> | |
#include <set> | |
#include <map> | |
#include <vector> | |
#include <algorithm> | |
#include <utility> | |
#include <cstdio> | |
#include <limits> | |
#include <bitset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cassert> | |
#include <set> | |
#include <map> | |
#include <vector> | |
#include <algorithm> | |
#include <utility> | |
#include <cstdio> | |
#include <limits> | |
#include <bitset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <iostream> | |
#include <cassert> | |
#include <set> | |
#include <map> | |
#include <vector> | |
#include <algorithm> | |
#include <utility> | |
#include <cstdio> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Slope { | |
int n, d; | |
Slope(int nn, int dd) { | |
int g = gcd(abs(nn), abs(dd)); | |
// cout << "gcd of " << nn << ", " << dd << " is: " << g << endl; | |
n = (g > 0 ? nn/g : nn); | |
d = (g > 0 ? dd/g : dd); | |
} | |
}; | |