Use Floyd's tortoise-and-hare: advance one pointer by 1 and another by 2 each step. If they ever meet, there's a cycle; if the fast pointer reaches null, there isn't. O(n) time, O(1) space.
Data Structures· asked at Google✓ Added to review
Atomicity (all-or-nothing transactions), Consistency (valid state transitions), Isolation (concurrent transactions don't interfere), Durability (committed data survives crashes). They guarantee reliable transaction processing in relational databases.
Databases· asked at Google✓ Added to review
A closure is a function bundled with references to its surrounding lexical scope, retaining access to those variables after the outer function returns. Practical uses: data privacy (module pattern), function factories, and maintaining state in callbacks.
JavaScript· asked at Google✓ Added to review
A decorator is a callable that wraps another function to extend its behavior without modifying it, applied with `@decorator` syntax. Common uses: logging, timing, caching (`functools.lru_cache`), access control. They are functions returning functions.
Python· asked at Google✓ Added to review
DNS resolves the domain to an IP, a TCP (and TLS for HTTPS) connection is established, the browser sends an HTTP request, the server responds with HTML, then the browser parses HTML/CSS/JS, builds the DOM/CSSOM, and renders — fetching additional assets as needed.
System Design· asked at Google✓ Added to review
💬
Send Feedback / Bug
Feedback Submitted!
Thank you. Your help keeps Geeky Script running smoothly.