Skip to content

Instantly share code, notes, and snippets.

View kalyantm's full-sized avatar

Kalyan TM kalyantm

  • Remote
View GitHub Profile
@kalyantm
kalyantm / doctype-db.sql
Last active September 27, 2020 08:33
Doctype DB task
/*
2) Write the DDL for creating the tables for a MariaDB database with users, tweets and followers.
A user has a username, password, email, first name and last name.
A tweet has text, a publication date and is posted by a user.
A user can be followed by other users.
*/
CREATE TABLE users (
@kalyantm
kalyantm / solution.go
Last active September 14, 2020 13:30
DocType - Basics of GoLang
// 1. Write a struct in Go for a Person object that has a numeric Age attribute.
type Person struct {
Age int
}
// 1.1) Write two functions in Go with the following function signature: func ([]Person) bool
// The first function should return true if there is a person who is exactly twice as old as any other person in the list, otherwise the function returns false.
func doubleAgeExists(persons []Person) bool {
// Approach: Use a set (made from a GoLang Map DS) to store the age details
// On one parse, check if age/2 or age*2 exists for the given age.
@kalyantm
kalyantm / dropdown.jsx
Last active September 1, 2020 05:16
Dropdown component
/*
Prompt:
We have defined a basic dropdown via the Dropdown and DropdownItem components below, with example usage in the ExampleNav component.
The Dropdown and DropdownItem components have some problems, and also have room for improvements.
Please fix any obvious bugs you see with the dropdown, and explain your reasoning.
Please then describe some improvements you would make to the dropdown, and how you would implement them.
Consider the different contexts in which you might use this dropdown and what changes might be neccessary to make it more flexible.
Follow up question: if we wanted to sync this dropdown selection to the server with app.sync('PATCH', 'user', { dropdown_1_state: {true,false} }) where would this be included
@kalyantm
kalyantm / SketchSystems.spec
Created March 11, 2020 10:03
My Awesome Sketch
My Awesome Sketch
Add Phone Number
add_phone_number -> Resend Code Disabled
Resend Code Disabled
time_remaining? -> Resend Code Disabled
no_time_remaining? -> Verify Phone Number
max_resend_tries_reached? -> Verify Captcha Flow
verify_phone_number -> Verifying Code
check_phone_number -> Redirect Phone Number?
@kalyantm
kalyantm / SketchSystems.spec
Last active March 10, 2020 14:47
Add Phone Number Flow
Add Phone Number Flow
Add Phone Number
add_phone_number -> Verify Phone Number
Verify Phone Number
resend_code -> Resend Code
verify_phone_number -> Verifying Code
check_phone_number -> Redirect Phone Number
Resend Code
@kalyantm
kalyantm / SketchSystems.spec
Last active January 6, 2020 03:25
PWA Login Screen SERP
PWA Login Screen SERP
Main Page*
click login -> Login Modal
Login Modal
click continue with facebook -> Facebook OAuth Flow
focus input email textbox -> Active TextBox
focus input password -> Active TextBox
click login button -> Try Login Flow
<Icon fileType="svg" icon="check" alt="check icon" />