Duduling Coding Test and Algorithm Wiki
website·Indexed 30 days ago
https://blog.duduling.devA collection of coding test solutions and algorithm study notes. It includes JavaScript solutions for Programmers (Level 1 and Level 2) and CodeWars challenges, as well as conceptual guides on recursion, graphs, stacks, queues, brute force, and dynamic programming from Inflearn algorithm lectures.
What's inside Duduling Wiki
- Picky Data is a Chrome DevTools panel extension designed to simplify the process of copying specific request and response data (status codes, headers, and bodies) into a pre-defined Markdown format. It captures network requests in real-time, allows filtering by method/type and URL, and provides a configurable copy template and keyboard shortcut.
Overview of Greedy Algorithms
A Greedy algorithm makes the locally optimal choice at each step with the hope of finding the global optimum. It is an approximate method used to find optimal solutions by selecting the best available option at the moment of decision.Understand the definition and role of an Operating System
An Operating System (OS) is the highest-level software that sits above all other software. Its primary purpose is to manage computer resources efficiently and coordinate hardware. It abstracts hardware complexity by providing an interface to users and application programs, hiding the underlying resource details. When an OS operates with characteristics of both software and hardware, it is referred to as firmware.Understand the role and trade-offs of Virtual Machines (VMs)
A Virtual Machine is a program that operates between the operating system and application programs. It provides a consistent environment for applications to run regardless of the underlying OS. A prominent example is the Java Virtual Machine (JVM), which allows Java applications to run across different operating systems like Unix and Windows. The primary disadvantage of using a VM is a decrease in performance (speed) because applications must operate through the VM layer rather than directly on the OS.Understand Two Pointers, Sliding Window, and Hash Table concepts
Three common algorithms used to improve efficiency when processing sequential data:
- Two Pointers Algorithm: Used when accessing a list sequentially by recording and manipulating the positions of two pointers.
- Sliding Window Algorithm: Uses a fixed-size 'window' (frame) that slides across the data set to process elements.
- Hash Table: A data structure that uses a hash function to map keys to specific indices for efficient storage and retrieval.
Understand the Von Neumann architecture
The Von Neumann architecture is a design where the CPU, memory, I/O devices, and storage are all connected via a bus. A critical constraint of this architecture is that all programs must be loaded into memory before they can be executed.Understand the Brute Force search algorithm
Brute Force is a straightforward search method that explores all possible candidates for a solution. It is analogous to trying every possible combination from 0000 to 9999 to unlock a forgotten password.
Advantages: Relatively easy to implement. Disadvantages: High consumption of resources (time and memory) due to its exhaustive nature. Implementation Tip: The key is creating logic that generates every possible case, which often involves the heavy use of nested
forloops.Understand the Brute Force search algorithm
Brute Force is a straightforward search method that explores all possible cases to find a solution. It is analogous to trying every possible combination from 0000 to 9999 to open a locked locker.
Advantages: Relatively easy to implement. Disadvantages: High consumption of resources (time and memory) due to its exhaustive nature. Implementation Tip: The key is creating logic that generates every possible case, which often involves the heavy use of nested
forloops.Understand Dynamic Programming (DP) basics
Dynamic Programming is a technique used to solve a large, complex problem by breaking it down into smaller, overlapping sub-problems. The results of these smaller problems are stored (memoized) so that they can be reused to solve the larger problem efficiently without redundant calculations.Define Embedded Systems
An embedded system is a specialized computer integrated into a larger device to perform a dedicated function, as opposed to a general-purpose computer used for web surfing or document creation. Examples include smartwatches, smart TVs, and smart cars.Understand JavaScript Closures
A closure is the combination of a function and the lexical environment within which that function was declared. This allows an inner function to access variables from an outer function's scope, and this access persists even after the outer function has returned.Understand Stack, Queue, and Deque data structures
Linear data structures are categorized by how elements are added and removed:
- Stack: A Last-In-First-Out (LIFO) structure. Elements are added and removed from the same end (the Top). Like a stack of books, the last item placed on top is the first one removed.
- Queue: A First-In-First-Out (FIFO) structure. Elements enter at the Bottom (rear) and exit at the Top (front). Like a waiting line at a bank, the first person to arrive is the first to be served.
- Deque (Double-Ended Queue): A hybrid structure that combines Stack and Queue properties, allowing insertion and deletion from both the front and the rear ends.