Prince Singh

237 posts

Prince Singh banner
Prince Singh

Prince Singh

@princegcs

Java developer. Spring Boot · React | sharing what I learn 🚀

Bharat🇮🇳 Katılım Ağustos 2018
86 Takip Edilen49 Takipçiler
Prince Singh
Prince Singh@princegcs·
For the first time, I touched the LRU Cache problem. Then realized I was avoiding it because of its reputation, not complexity 😭 Thanks you @alexxubyte for the free trial that forced me to finally go through it 😅 And once I started reading, it was like.. wait what? 🤷🏼 Turns out I was more scared of the internet aura around it than the actual problem 🧐
Prince Singh tweet media
English
0
0
1
32
Prince Singh
Prince Singh@princegcs·
𝗢𝗯𝗷𝗲𝗰𝘁 vs 𝗢𝗯𝗷𝗲𝗰𝘁𝘀 in Java → 𝗢𝗯𝗷𝗲𝗰𝘁 • Root parent class of all Java classes(java.lang package) • Every class in Java implicitly extends Object class Object obj = new String("Hello"); → Common methods: • toString() • equals() • hashCode() • getClass() → 𝗢𝗯𝗷𝗲𝗰𝘁𝘀 • Utility class (java.util package) • Provides static helper methods for safer coding Objects.equals(a, b); Objects.isNull(obj); Objects.requireNonNull(obj); → Mainly used for: • null-safe operations • comparisons • validations 𝗦𝗶𝗺𝗽𝗹𝗲 𝗧𝗶𝗽: → 𝗢𝗯𝗷𝗲𝗰𝘁 = base class in java → 𝗢𝗯𝗷𝗲𝗰𝘁𝘀 = utility/helper methods #CoreBits #Java #CoreJava #JavaBasics
English
0
0
0
18
Prince Singh
Prince Singh@princegcs·
𝐂𝐨𝐥𝐥𝐞𝐜𝐭𝐢𝐨𝐧 vs 𝐂𝐨𝐥𝐥𝐞𝐜𝐭𝐢𝐨𝐧𝐬 in Java → 𝐂𝐨𝐥𝐥𝐞𝐜𝐭𝐢𝐨𝐧 • Interface (java.util package) • Root of List, Set, Queue, Deque etc. Collection c = new ArrayList<>(); → 𝐂𝐨𝐥𝐥𝐞𝐜𝐭𝐢𝐨𝐧𝐬 • Utility class (java.util package) • Static helper methods: sort(), reverse(), shuffle() etc. Collections.sort(list); Collections.reverse(list); → 𝐌𝐚𝐢𝐧𝐥𝐲 𝐰𝐨𝐫𝐤𝐬 𝐰𝐢𝐭𝐡 with Collections Framework classes (List, Set, Map, Queue, Deque, etc.) 𝐒𝐢𝐦𝐩𝐥𝐞 𝐓𝐢𝐩: → 𝐂𝐨𝐥𝐥𝐞𝐜𝐭𝐢𝐨𝐧 = Data Structure → 𝐂𝐨𝐥𝐥𝐞𝐜𝐭𝐢𝐨𝐧𝐬 = Helper Methods #CoreBits #Java
Français
0
0
0
57
Prince Singh
Prince Singh@princegcs·
𝗔𝗣𝗜 𝗮𝗻𝗱 𝗘𝗻𝗱𝗽𝗼𝗶𝗻𝘁 𝗮𝗿𝗲 𝗻𝗼𝘁 𝘁𝗵𝗲 𝘀𝗮𝗺𝗲 𝘁𝗵𝗶𝗻𝗴 Many beginners use both terms interchangeably They shouldn't. 𝗔𝗣𝗜 = the overall interface/system • A way for two systems to communicate 𝗘𝗻𝗱𝗽𝗼𝗶𝗻𝘁 = one specific resource/action within that API • A specific path inside the API • Where a particular resource or action is accessed 𝗘𝘅𝗮𝗺𝗽𝗹𝗲𝘀: • Food delivery API → /orders endpoint • Weather API → /weather endpoint A single API can have multiple endpoints, such as: • /users • /orders • /products • /payments Each endpoint is defined by a specific URL and HTTP method (GET, POST, PUT, DELETE, and others). 𝗧𝗵𝗶𝗻𝗸 𝗹𝗶𝗸𝗲 𝘁𝗵𝗶𝘀: • API = building • Endpoint = a specific room or door inside it An endpoint is part of an API, not the API itself. #CoreBits #Backend #API
English
0
1
0
59
Prince Singh
Prince Singh@princegcs·
Security implemented successfully me, after encoding the username instead of the password. System was safe. No one could log in… including me :)
Prince Singh tweet media
English
0
0
0
49
Prince Singh
Prince Singh@princegcs·
Spent too much time checking models in AI Studio 😭 Then I found something more useful than the entire AI Studio UI 🥲 GET: [ https://generativelanguage. googleapis .com/v1beta/models?key=YOUR_API_KEY ] (replace YOUR_API_KEY with your actual Gemini API key) …and it literally tells: • which models are supported • what methods they support • token limits • versions • everything in one simple JSON response 🫠 Helped me debug a “model not supported” issue much faster :)
English
0
0
1
70
Prince Singh
Prince Singh@princegcs·
Ever struggled with head operations in Linked Lists? → Inserting at head → Deleting the first node → Messy pointer updates & extra if checks Fix: Dummy Node Pattern → Add a Dummy Node before head ListNode dummy = new ListNode(-1); dummy.next = head; dummy → head → node1 → node2.... Now: → head is no longer a special case → all nodes treated uniformly → you always have a previous node (even for head) → pointer logic becomes clean & consistent Useful for: → Deleting nodes → Removing elements → Remove Nth Node from End → Merge Two Sorted Lists → Partition List Always return dummy.next as new head. This one trick removes most edge cases. Save it. 🔖 #DSA #Java #LinkedList #CoreBits
English
0
0
0
48
Pavan
Pavan@gpkpavan143·
1M impressions on X…long way to go for 5 M 😩 So apparently my random thoughts have better reach than my career plans 😭 Anyway, going back to tweeting nonsense 👍
Pavan tweet media
English
7
0
15
267
Prince Singh
Prince Singh@princegcs·
📌 What actually is an API? ❗ Let’s understand it simply → you = client → bank = backend → ATM = API ✔ You don’t go inside the bank → ATM gives you a defined way to interact → bank handles everything behind the scenes 💡 API works the same way → you send a request → system processes it → you get a response ✔ Fixed rules: → what to send → what you’ll get ❗ Same API can serve: → web → mobile → other apps 📍 API = Application Programming Interface → a contract between client and server → client knows how to ask → server knows how to respond #CoreBits #Backend #API #Dev
English
0
0
1
72
Kirtesh
Kirtesh@AKirtesh·
11 Free Resources Every Developer Should Use in 2026: 1. Roadmaps.sh 2. Excalidraw 3. Cursor / Claude 4. GitHub Student Pack 5. Dev.to 6. Roadmap.sh 7. LeetCode Discuss 8. Public APIs (rapidapi) 9. Draw.io 10. Refactoring.Guru 11. YouTube (Theo, Fireship, Traversy) Save this. 📌 Which one do you use daily? 👇
English
9
13
118
4.1K
Prince Singh
Prince Singh@princegcs·
@_jaydeepkarale the one who integrates a tool/software into an org systems... mostly these roles are in defence companies..
English
1
0
1
22
Jaydeep
Jaydeep@_jaydeepkarale·
So this "tech influencer" on Instagram is promoting these as the 10 HIGH DEMAND IT JOBS in 2026 I agree with some of these but have no clue what Forward Deployment Engineer is Can someone enlighten me please ?
English
6
0
13
1.7K
Prince Singh
Prince Singh@princegcs·
📌 "Turn it off and on again", actually works ❗ Not magic → it's a state reset ✔ Running apps hold: → memory allocations → file locks → network connections → cached states ✔ Over time, these can: → leak memory → get stuck in broken state → hold resources they shouldn't ✔ Restart clears all of it: → process terminated → memory freed → connections re-established → fresh state on startup ✔ Many bugs happen due to: → bad state → partial failures → resource leaks 💡 If a bug disappears after restart: → the root cause still exists → restart only removed the broken state temporarily 📍 So what actually happens? → system resets state → everything starts clean again → hidden issues temporarily vanish #CoreBits #Web #Debugging #Dev
English
0
0
0
66
Kirtesh
Kirtesh@AKirtesh·
@princegcs 😂 Linux is waiting silently… once you start, no going back.
English
2
0
1
110
Kirtesh
Kirtesh@AKirtesh·
Which Operating System are you actually using for coding in 2026?
Kirtesh tweet mediaKirtesh tweet mediaKirtesh tweet mediaKirtesh tweet media
English
65
3
69
3.3K
Kirtesh
Kirtesh@AKirtesh·
Bro disappeared like he never existed.
Kirtesh tweet media
English
16
1
26
608
Prince Singh
Prince Singh@princegcs·
📌 API key is not strong authentication ❗ It’s more like identification ✔ API key = “I am a client with this key” → not proof of who is using it → just proof that the key is valid ✔ That’s why → leaked API key = potential full access → server doesn’t ask “is this really you?” → it just checks “is this key valid?” ✔ By default, API keys don’t verify: → who is using it → whether it’s the real owner or not 💡 Think of it like a QR ticket → whoever holds it can use it → system only checks if it’s valid, not who is holding it 🫠 ✔ Extra protections like IP restrictions, rate limits, and scopes can reduce abuse → but they don’t change the core thing ❗ Still not real authentication. → API keys are meant to be used with other security layers → not as standalone security 📍 That’s why: → never expose API keys in frontend → never push them to GitHub → rotate immediately if leaked #CoreBits #Backend #Security #API
English
0
0
0
62
Prince Singh
Prince Singh@princegcs·
📌 You have 10 tabs open, how does your OS know which data goes where? ❗ Not just ports → it's a full connection identity ✔ Every connection is uniquely identified: → YouTube request → OS assigns an ephemeral port (e.g. 52341) → Gmail request → another port (e.g. 54123) → Spotify request → another one (e.g. 58934) 💡 Ephemeral ports: → temporary, auto-assigned by OS → typically high-numbered ports (Windows: 49152+, Linux: often 32768+) → you never see them, but always there ✔ Ports alone aren't enough → OS tracks each connection using a 5-tuple: → (Source IP, Source Port, Destination IP, Destination Port, Protocol) 💡 This tuple = unique identity of every connection → even if ports repeat, the tuple keeps things distinct ✔ How responses reach the correct tab: → server replies to your IP + port → OS matches the full tuple in its connection table → delivers to the correct socket (process) → browser maps responses to the right request/tab ❗ Clarity: → tabs ≠ connections → HTTP/2 / HTTP/3 allow multiple requests over one connection → one tab can open multiple connections 💡 Without this system: → responses would mix → your YouTube data could land in Gmail 🥴 → complete chaos #CoreBits #Networking #Web #Browser
English
0
0
2
55
Kirtesh
Kirtesh@AKirtesh·
🎉 5,000 developers strong! Thank you for being part of this journey. Here’s the next target 10K 🔥 Drop a Hi 👋🏻, Let's Connect
Kirtesh tweet media
English
15
0
22
459
Prince Singh
Prince Singh@princegcs·
📌 Your browser may send an extra request before your API call ❗ Not a bug → it's a CORS preflight ✔ Before your actual request: → browser sends an OPTIONS request ✔ It's basically asking: → “Can I send this request from this origin?” ✔ Server must respond with: → allowed origin → allowed methods → allowed headers ✔ If allowed → actual request is sent ✔ If not allowed → browser blocks access to the response 💡 Happens when: → cross-origin request → custom headers (Authorization, etc.) → methods like PUT / DELETE 💡 Exception: → simple requests (e.g. GET with no custom headers) skip preflight → but CORS check still applies on the response 💡 Why this exists: → prevents malicious cross-site requests → server must explicitly allow cross-origin access 💡 Key point: → request may succeed on server → but browser decides whether frontend can access the response 📍 That's why API works in Postman but fails in browser → CORS is a browser security policy, not a server-side restriction #CoreBits #Backend #Web #Security #Dev
English
0
0
1
64