BFS explores level by level using a queue — best for shortest path in unweighted graphs. DFS goes as deep as possible using a stack/recursion — useful for topological sort, cycle detection, and exploring all paths. Both are O(V+E).
Algorithms· asked at Generic✓ Added to review
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
Normalization organizes tables to reduce redundancy and avoid update anomalies, via normal forms (1NF–3NF/BCNF). It improves data integrity but can require more joins; denormalization is sometimes used for read performance.
Databases· asked at Amazon✓ 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
Event delegation attaches a single listener to a common ancestor instead of many listeners on individual children. Events bubble up, and you inspect `event.target` to act on the originating element. It reduces memory use and works for dynamically-added elements.
JavaScript· asked at Meta✓ 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 process is an independent program with its own memory space; threads are lighter units of execution that share their process's memory. Threads are cheaper to create and communicate, but shared memory requires synchronization to avoid race conditions.
Operating Systems· asked at Microsoft✓ 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
Vertical scaling adds more power (CPU/RAM) to one machine — simple but capped and a single point of failure. Horizontal scaling adds more machines — more complex (load balancing, data partitioning) but elastic and fault-tolerant.
System Design· asked at Generic✓ 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.