Skip to content

Instantly share code, notes, and snippets.

View panktip15's full-sized avatar

Pankti Doshi panktip15

View GitHub Profile
@panktip15
panktip15 / Link.js
Created September 17, 2018 20:13
Frontend React-Native
@panktip15
panktip15 / plaid.js
Created September 17, 2018 19:56
Backend server
const router = require('express').Router();
const envvar = require('envvar');
const moment = require('moment');
const plaid = require('plaid');
const Item = require('../db/models/item');
const Account = require('../db/models/account');
const Transaction = require('../db/models/transaction');
const Budget = require('../db/models/budget');
module.exports = router;
import { createStackNavigator } from 'react-navigation';
import CategoryPie from './CategoryPie';
import HomeConnect from './Home';
import Quiz from './Quiz';
import Result from './Result';
import CategoryPie from './CategoryPie';
import HeatMap from './HeatMap';
import ProfileConnect from './Profile';
import Login from './Login';
import React from 'react';
import Icon from 'react-native-vector-icons/FontAwesome';
import { HomeStack } from './Home';
import { ProfileStack } from './Profile'
import { styles, colorTheme } from '../common/styles'
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
const homeIcon = ({ tintColor }) => (
<Icon name="home" size={25} color={tintColor} />
import React from 'react';
import { Provider } from 'react-redux';
import { View, Text } from 'react-native';
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
import {
Initial,
Login,
Signup,
BudgetSetup,

Prompt

Given an an array of numbers, find the length of the longest possible subsequence that is increasing. This subsequence can "jump" over numbers in the array. For example in [3, 10, 4, 5] the longest increasing subsequence (LIS) is [3, 4, 5].

Examples

longestIncreasingSubsequence([3, 4, 2, 1, 10, 6]);
// should return 3, the length of the longest increasing subsequence:
// 3, 4, 6 (or 3, 4, 10)
@panktip15
panktip15 / ultimate-ut-cheat-sheet.md
Created July 25, 2018 13:44 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


Clock Minute Adder


Interviewer Prompt

Given:

  • a time in string format HH:MM
  • a number of minutes

Return:

  • The time given those minutes added to the base time

Slides

Prompt

Implement an immutable binary search tree class. The class constructor should accept (at least) a single argument which will represent the value for its root node. Each instance should have two methods: insert, which takes a numerical value and returns a new binary search tree containing that value, and contains, which takes a numerical value and returns true or false based on whether the tree contains it.

Insert should not mutate the existing binary search tree. That is:

const bstA = new ImmutableBST(5);
@panktip15
panktip15 / balancedbrackets.md
Created July 25, 2018 13:42 — forked from dewad2/balancedbrackets.md
Balanced Brackets

Slides


Prompt

Write a function that determines whether an input string has balanced brackets.

You are given an input string consisting of brackets—square [ ], round ( ), and curly { }. The input string can include other text. Write a function that returns either true if the brackets in the input string are balanced or false if they are not. Balanced means that any opening bracket of a particular type must also have a closing bracket of the same type.