Virkano LeetCode Algorithm Solutions

website·Indexed 30 days ago

https://docs.virkano.com/

A collection of LeetCode problem solutions and explanations categorized by algorithmic patterns, including double pointer, dynamic programming (DP), binary tree, and linked list. Features JavaScript implementations for problems such as Trapping Rain Water (42), Longest Palindromic Substring, and various tree and list manipulations.

Tokens
143.3K
Snippets
469
Records
812
Agent score
50%

What's inside Virkano Algorithm Docs

  1. Overview of the Virkano Camera desktop application

    The Virkano Camera is a desktop application developed using Electron, Vue 3, and Vite. It is designed to facilitate live streaming and short video recording across Windows and macOS. Key features include the ability to open multiple camera windows, window mirroring, and full-screen support.
    # Source code available at:
    https://github.com/Virkano/camera
  2. Overview of UDT (UDP-based Data Transfer Protocol)

    UDT is an application-layer, connection-oriented, bidirectional protocol built on top of UDP. It is designed for high-speed, large-scale data transfer over wide-area networks (WANs) where standard TCP performs poorly due to bandwidth-delay products. UDT introduces its own congestion control and reliability mechanisms, supporting both reliable data streams and partially reliable datagrams. Common use cases include P2P technology, firewall penetration, and multimedia transmission.
  3. Overview of tRPC

    tRPC is a TypeScript-based RPC (Remote Procedure Call) framework designed to allow frontend and backend developers to call remote functions as if they were local functions, abstracting away the underlying network communication details.
  4. Overview of Common Sorting Algorithms

    • Bubble Sort: Repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
    • Quick Sort: A divide-and-conquer algorithm that picks a pivot and partitions the array into elements smaller and larger than the pivot.
    • Insertion Sort: Builds the final sorted array one item at a time by inserting unsorted elements into their correct position in the sorted part.
    • Selection Sort: Repeatedly finds the minimum element from the unsorted part and puts it at the end of the sorted part.
    • Merge Sort: A divide-and-conquer algorithm that recursively splits the array in half, sorts the halves, and merges them back together.
    • Array.prototype.sort(): In JavaScript, this sorts the array in place. By default, it converts elements to strings and sorts them by Unicode code points unless a comparator function is provided.
    • Array.prototype.reverse(): Reverses the order of elements in an array.
  5. Overview of HTML5 new features

    HTML5 introduced several new elements and APIs to enhance page structure and functionality:

    • Semantic Tags: header, footer, article, nav, section for better page structure.
    • Media: video and audio for native playback.
    • Graphics: Canvas (raster/pixel-based, may lose quality on scale) and SVG (vector-based, does not lose quality).
    • Storage: localStorage and sessionStorage for offline local storage.
    • Communication/Performance: webSocket for full-duplex TCP communication and web Worker for background JavaScript execution.
    • Other: Geolocation for location data, Drag and Drop API, and new form controls like date, time, email, url, and search.
  6. Overview of Nuxt.js for Server-Side Rendering (SSR)

    Nuxt.js is a universal application framework based on Vue.js designed for Server-Side Rendering (SSR) and static site generation. It provides built-in configurations for typical client/server architectures, including:

    • Automatic code splitting.
    • Powerful routing with support for asynchronous data fetching (no manual route config required).
    • HTML head tag management via vue-meta.
    • Pre-configured Webpack settings.
  7. Understand Session-based authentication and its limitations

    A Session is a server-side mechanism used to maintain state in the stateless HTTP protocol. The server allocates memory (typically a ConcurrentHashMap) to store a session object for a specific client.

    Limitation (Scalability/Load Balancing): Sessions are typically stored in the memory of a single server. In a load-balanced environment, if a request is routed to Server B but the session was created on Server A, the session will be invalid unless a distributed session store (like Redis) or session stickiness is implemented.

  8. Understand the Same-Origin Policy (SOP)

    The Same-Origin Policy is a fundamental security mechanism that restricts how documents or scripts loaded from one 'origin' can interact with resources from another origin. Two URLs are considered 'same-origin' if their protocol, domain, and port are identical. The policy operates on three levels:

    • DOM Level: Restricts JavaScript scripts from different origins from reading or writing to the current DOM object.
    • Data Level: Restricts different-origin sites from reading the current site's Cookie, IndexedDB, and LocalStorage data.
    • Network Level: Restricts the sending of site data to different-origin sites via XMLHttpRequest and similar APIs.
  9. Implement the Mediator/Middleware pattern to decouple components

    The Mediator (or Middleware) pattern centralizes communication between components. Instead of components communicating directly with one another (creating a complex many-to-many relationship), they interact only with a central mediator. This simplifies the system architecture by converting many-to-many interactions into many-to-one interactions, preventing communication chaos and making data flow easier to track for developers. In JavaScript, a mediator can be implemented as an object literal or a function.
  10. Resources for implementing frontend core principles (Hand-coding)

    Guidance and tutorials for implementing core frontend mechanisms from scratch, which is a common requirement in high-level technical interviews. Recommended implementation targets include:

    • Vue 2.0 core principles and MVVM architecture
    • Promise/A+ specification
    • JSONP implementation
    • JavaScript function methods: call, apply, and bind