-
Notifications
You must be signed in to change notification settings - Fork 30
finished general concepts #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
williamldennis
wants to merge
1
commit into
fractal-nyc:main
Choose a base branch
from
williamldennis:will-dennis/general-concepts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| QUESTIONS | ||
| What is the difference between synchronous and asynchronous processing? What is a Promise in JS? How are promises handled in JS? How do other languages (go, python, etc) handle asynchronous function calls? | ||
| - Synchronous processing runs tasks one at a time, waiting for each to finish, while asynchronous processing allows tasks to run in the background without blocking others. In JavaScript, asynchronous operations are handled using Promises, which represent values that may be available later, and are managed with .then(), .catch(), or async/await. Other languages handle async differently: Python uses asyncio and await, Go uses lightweight threads called goroutines, and Java uses tools like Future and CompletableFuture. Each language has its own way to manage non-blocking, concurrent operations. | ||
|
|
||
| What is recursion? When would you use it? | ||
| - Recursion is when a function calls itself in order to solve a smaller version of a problem. It continues until it reaches a base case, which stops the recursion. | ||
|
|
||
| You’d use recursion when a problem can be broken down into similar subproblems — like traversing trees, calculating factorials, solving mazes, or implementing algorithms like quicksort or Fibonacci. It’s often used instead of loops for elegant solutions to complex, nested structures. | ||
|
|
||
| What is the difference between parallel and concurrent processing? | ||
| - Concurrent processing means multiple tasks are making progress over the same time period — they may take turns using the CPU, often via context switching. | ||
| Parallel processing means multiple tasks are running at the exact same time, usually on multiple cores or processors. | ||
|
|
||
| What is an anonymous or lambda function? Why would you ever use this? | ||
| - An anonymous function (also called a lambda function) is a function defined without a name, often used for short, throwaway tasks. | ||
| - You’d use one when: | ||
|
|
||
| You don't need to reuse the function elsewhere. | ||
|
|
||
| You want cleaner, more concise code (especially for callbacks, event handlers, or functional methods like .map, .filter, .reduce). | ||
|
|
||
| Why would you choose one language over another? Can you give an example scenario and trade off two languages? | ||
| - You choose one programming language over another based on the project's needs, including factors like performance, developer experience, ecosystem, scalability, and community support. | ||
| - | ||
| You choose one programming language over another based on the project's needs, including factors like performance, developer experience, ecosystem, scalability, and community support. | ||
|
|
||
| 🎯 Example Scenario: Building a Real-Time Chat App | ||
| Option 1: JavaScript (Node.js) | ||
| Pros: | ||
|
|
||
| Great for real-time apps using WebSockets | ||
|
|
||
| Single language (JS) on both client and server | ||
|
|
||
| Huge ecosystem and community | ||
|
|
||
| Non-blocking I/O makes it fast for handling many connections | ||
|
|
||
| Cons: | ||
|
|
||
| Not ideal for CPU-heavy tasks | ||
|
|
||
| Dynamically typed — can lead to runtime bugs if not careful | ||
|
|
||
| Option 2: Go (Golang) | ||
| Pros: | ||
|
|
||
| Very fast and efficient — great for handling high concurrency | ||
|
|
||
| Built-in support for concurrency with goroutines | ||
|
|
||
| Statically typed — fewer runtime surprises | ||
|
|
||
| Cons: | ||
|
|
||
| Smaller ecosystem for front-end/web stuff | ||
|
|
||
| More boilerplate and less flexibility compared to JS for dynamic tasks | ||
|
|
||
| ⚖️ Trade-off: | ||
| Choose JavaScript if you want fast development and a full-stack JS environment. | ||
| Choose Go if you need raw speed and efficient handling of thousands of connections. | ||
|
|
||
| In short, the "best" language depends on what you're building and your priorities (speed, ease, ecosystem, etc.). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate bullet found in the language choice answer. Remove the repeated entry.