Tagged articles
17 articles
Page 1 of 1
IT Services Circle
IT Services Circle
Aug 25, 2025 · Fundamentals

How to Efficiently Compress Strings in Java: Interview‑Ready Solution

The article critiques absurd interview questions, then presents a practical Java solution for compressing strings by replacing consecutive characters with their counts, explains the algorithm’s O(n) time and O(1) extra space, discusses edge cases like multi‑digit counts and Unicode handling, and offers implementation tips.

String Compressionalgorithminterview question
0 likes · 6 min read
How to Efficiently Compress Strings in Java: Interview‑Ready Solution
Liangxu Linux
Liangxu Linux
May 14, 2025 · Fundamentals

Can TCP and UDP Share the Same Port? A Deep Dive into Port Mechanics

This article breaks down the interview question "Can TCP and UDP use the same port?" by examining protocol-level port spaces, client‑side TCP and UDP port sharing rules, server‑side TCP reuse with SO_REUSEADDR, and UDP reuse with SO_REUSEPORT, complete with code examples and practical implications.

Network programmingPort SharingSO_REUSEADDR
0 likes · 17 min read
Can TCP and UDP Share the Same Port? A Deep Dive into Port Mechanics
NiuNiu MaTe
NiuNiu MaTe
Oct 27, 2021 · Fundamentals

Master the House Robber Problem with Dynamic Programming

This article explains the classic House Robber interview question, detailing the problem constraints, illustrating why a naive alternating‑house approach fails, and presenting a clear dynamic‑programming solution with recurrence, base cases, and a concise code example.

DPalgorithmdynamic programming
0 likes · 5 min read
Master the House Robber Problem with Dynamic Programming
Programmer DD
Programmer DD
Jan 9, 2019 · Fundamentals

How to Find the Peak in a Bitonic Array Using Binary Search

This article presents a JavaScript solution for locating the maximum element in a bitonic (first increasing then decreasing) array, explaining that the problem is a variant of binary search and providing a complete implementation using a binary‑search‑based algorithm.

Binary SearchJavaScriptalgorithm
0 likes · 3 min read
How to Find the Peak in a Bitonic Array Using Binary Search
MaGe Linux Operations
MaGe Linux Operations
Aug 20, 2018 · Fundamentals

Why Does This Python Lambda Loop Print 6 Every Time? Mastering Late Binding

The article examines a Python interview question where a lambda list inside a loop unexpectedly prints 6 for all elements due to late binding in closures, explains the underlying mechanism, and presents four practical solutions—including default‑argument binding, functools.partial, generator expressions, and yield‑based approaches—to achieve the intended 0, 2, 4, 6 output.

Lambdaclosuresinterview question
0 likes · 5 min read
Why Does This Python Lambda Loop Print 6 Every Time? Mastering Late Binding
AI Cyberspace
AI Cyberspace
Dec 7, 2017 · Fundamentals

Why Python’s Chain Assignment Can Trip You Up – Understanding Value vs Object Semantics

Python’s chain assignment offers concise multiple-variable assignment, but its left-to-right evaluation differs from C’s right-to-left value-semantic approach, leading to surprising results in interview questions; understanding the distinction between value-semantic and object-semantic languages helps avoid subtle bugs.

Pythonchain assignmentinterview question
0 likes · 5 min read
Why Python’s Chain Assignment Can Trip You Up – Understanding Value vs Object Semantics