Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.
https://leetcode.com/problems/add-digits/description/?envType=problem-list-v2&envId=prshgx6i
| // PROBLEM: https://www.codewars.com/kata/5662292ee7e2da24e900012f/train/javascript | |
| // Codewars 80s Kids #3 Punky Brewsters Socks | |
| function getSocks(name, socks) { | |
| let desiredSocks = []; | |
| const sockColors = {}; | |
| const isPunky = name === 'Punky'; | |
| console.log('name is ', name); |
Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.
https://leetcode.com/problems/add-digits/description/?envType=problem-list-v2&envId=prshgx6i
Slide from: https://youtu.be/hJP5GqnTrNo?feature=shared&t=740
GPT-4 clearly has the capability, but the context you give it matters a lot!
We have:
| const fakePokemons = [ | |
| { name: 'Charizar', type: 'fire', isCaught: true}, | |
| { name: 'Pokemon', type: 'electric', isCaught: true}, | |
| { name: 'Ditto', type: 'normal', isCaught: false}, | |
| { name: 'Eevee', type: 'normal', isCaught: true}, | |
| ] | |
| /** | |
| * Creates and returns a new object which has all the same | |
| * properties as the poke object, but also has an `index` prop |
| class Aviary: | |
| def __init__(self, name, birds=[]): | |
| self.birds = birds | |
| self.name = name | |
| def add_bird(self, bird): | |
| self.birds.append(bird) | |
| class Bird: | |
| aviary = Aviary("a1") | |
| def __init__(self, name): |
The interview process - approx. 3-5 interviews, approx. 1hr each. Here is a rough outline of the process. It doesn't always occur in this order and sometimes there are multiple behavioral/technical rounds.
This is a walkthrough of a tutorial exercise from Eloquent Javascript
You will improve your skills at manipulating the DOM and using DOM events to execute your JS code when a button is clicked!
Review the tutorial in the link above before doing this walkthrough! They are the same : )
This is also a very practical exercise, as you will learn about the <img> element's alt attribute, which is used when the browser is unable to download there desired image, or for accessibility purposes.
I hereby claim:
To claim this, I am signing this object:
Example of code to generate reducers and actions for "generic" or basic HTTP requests to GET/POST JSON data. The idea is that each particular request (for user account info, for X most recent comments, etc) has its own reducer which is only responsible for tracking the state of that HTTP request and holding response data. With redux-thunk, callbacks to handle success/error states (i.e., do something with data, or, display error message to the user) can then be programmatically executed once the request has completed.
In general, I have found it useful to have reducers be small and responsible for one specific thing, and using redux-thunk to have action creator functions access data and pass it to other reducers (via actions, of course) when necessary. Thus there will be a large number of very small reducers.
This increases re-usability of code between projects (especially since everything is in a single file because of the redux ducks pattern, and uses a common set of helper/utility functions), and make