The Defanging an IP Address interview question is a simple string manipulation task. A defanged IP address replaces every period "." with "[.]". This is often used in security contexts to prevent links from being clickable or automatically parsed as network addresses. This Defanging an IP Address coding problem is a basic check of your string replacement skills.
Companies like Meta and Bloomberg use this as a very basic "warm-up" or "ice-breaker" question. It tests if a candidate knows the basic string API of their language or if they can manually traverse and reconstruct a string. It’s a test of fundamental coding accuracy.
This follows the String interview pattern.
Input: 1.1.1.1
Always be aware of how your language's replace function works. Does it replace all occurrences or just the first? Does it use regex? Knowing these details shows you understand your tools.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Detect Capital | Easy | Solve | |
| Score of a String | Easy | Solve | |
| Delete Characters to Make Fancy String | Easy | Solve | |
| Consecutive Characters | Easy | Solve | |
| Find the Original Typed String I | Easy | Solve |