Ani

4K posts

Ani banner
Ani

Ani

@its_ani9

Debugging

Katılım Mart 2022
99 Takip Edilen37 Takipçiler
✧ 𝙑𝘿 ★⋆
✧ 𝙑𝘿 ★⋆@Vishwas_Weirdo·
before i deactivate, i wanna clarify i didn't know my private life would be revealed like this. i trusted my moots and friends but it turns out I’m getting exposed. i’m leaving because you are all jealous of me and can’t accept the fact that i’m married to Zhang Linghe
English
6
0
10
514
Ani
Ani@its_ani9·
@javarevisited One missing WHERE clause and congrats, every user is an admin now. That’s instant privilege escalation, a security nightmare, and probably a production incident.
English
1
0
1
102
Javarevisited
Javarevisited@javarevisited·
Interviewer: Why is this risky? UPDATE users SET role = 'admin';
English
15
0
27
10.2K
Ani
Ani@its_ani9·
@SumitM_X Don’t pass huge files through microservices directly Design: Store files in object storage (e.g., Amazon S3) Services exchange only metadata/URLs via API or queue Use streaming/chunked upload for large payloads CDN + compression for delivery Move references,not giant payloads
English
0
0
0
555
SumitM
SumitM@SumitM_X·
Your microservice needs to transfer large amounts of data (e.g., files, images) between services. How do you design the communication to avoid performance bottlenecks and manage large payloads efficiently?
English
18
6
119
21.6K
Ani
Ani@its_ani9·
@OjasSharma276 Think of context window like a whiteboard in d AI’s brain Everything u type+everything AI replies gets written there,but d whiteboard has limited space When filled: Old notes get erased AI forgets earlier parts Responses become less accurate Measured in tokens(chunks of text)
English
0
0
0
37
Ojas Sharma
Ojas Sharma@OjasSharma276·
Does everyone know about the context window?
English
10
0
24
1.4K
Ani
Ani@its_ani9·
@javarevisited Verify the search pipeline Check if search index is stale/corrupted Compare DB data vs indexed data Verify ranking/relevance config changes Rebuild/re-sync index if needed Check analyzers/tokenization/synonyms Wrong results with no errors usually = indexing or ranking issue.
English
0
0
3
94
Javarevisited
Javarevisited@javarevisited·
Interviewer: Your search results are suddenly wrong. Users are seeing irrelevant data. No errors in logs. You have 20 minutes. What do you do?
English
5
1
10
3.1K
Ani
Ani@its_ani9·
@ashoKumar89 Mostly JSONB in production. Why? Binary format -> faster queries/indexing Supports GIN indexes Better for filtering/search/updating JSON fields JSON is mainly for storing exact raw text/formatting. JSON = preserve input JSONB = query efficiently at scale.
English
1
0
14
3.6K
Ashok Sahoo
Ashok Sahoo@ashoKumar89·
PostgreSQL gives you both: JSON and JSONB Which one are you actually using in production and why?
English
18
5
302
70K
Ani
Ani@its_ani9·
@javarevisited Powerful,but expensive at scale Large joins = heavy CPU/memory/shuffle cost Distributed joins across servers r slow Can hurt latency under huge traffic Big sys often: Denormalize data Precompute views Use caching/search indexes Trade storage duplication for speed&scalability
English
0
0
4
1K
Javarevisited
Javarevisited@javarevisited·
Interviewer: If SQL joins are powerful, why do large-scale systems avoid them?
English
6
4
54
18.8K
Ani
Ani@its_ani9·
@javarevisited Don’t restart blindly,capture evidence fast Check memory graphs-> heap vs non-heap growth Take heap dump/profile(top objects,retaining refs) Look for unbounded caches,listeners,queues,static refs Compare snapshots over time Find what keeps growing and why it’s still referenced
English
0
0
0
45
Javarevisited
Javarevisited@javarevisited·
Interviewer: Memory usage keeps increasing. App crashes every few hours. You suspect a leak. You have 30 minutes. What do you do?
English
5
0
15
5K
Ani
Ani@its_ani9·
@javarevisited PostgreSQL JSON is powerful,but it’s still relational DB NoSQL when: Massive horizontal scaling Flexible/high-velocity schemas Ultra-high write throughput Specialized models(document,graph,key-value) PostgreSQL=versatility+consistency NoSQL=scale/specific workload optimization
English
0
0
1
279
Javarevisited
Javarevisited@javarevisited·
Interviewer: If PostgreSQL supports JSON, why would anyone choose a NoSQL database?
English
25
7
176
74.2K
Ani
Ani@its_ani9·
@javarevisited Usually poorly, or not effectively != is a negative condition, so DB may need to scan many rows because everything except completed could be huge. Indexes work best for selective matches (=/ ranges). Often causes full scan or weak index usage depending on data distribution.
English
0
0
2
1.8K
Javarevisited
Javarevisited@javarevisited·
Interviewer: What’s the problem here? SELECT * FROM orders WHERE status != 'completed';
English
25
4
48
35.2K
Ani
Ani@its_ani9·
@SumitM_X Server local time is dangerous in distributed systems. Different servers may have different timezones DST changes cause bugs Logs/events become inconsistent Best practice: Store/return timestamps in UTC (ISO 8601), convert to local time only in UI/client.
English
0
0
4
1K
SumitM
SumitM@SumitM_X·
Tech Lead says: " return Timestamps always in server local time.” Are you ok with it?
English
30
3
119
35.3K
✧ 𝙑𝘿 ★⋆
✧ 𝙑𝘿 ★⋆@Vishwas_Weirdo·
Finally committed with a guy whom I had a crush on for over 4 years. Now we are a couple. he accepted my proposal instantly. One of the best days of my life 🥹♥️🧿
English
15
0
28
2.3K
Ani
Ani@its_ani9·
@devops_nk Hard link=another name for the same file inode Works even if original file is deleted Can’t cross filesystems Soft link (symlink)=shortcut/path to a file Breaks if original is deleted Can point across filesystems/directories Hard link= same file Symlink= reference to file path
English
0
0
0
144
Nandkishor
Nandkishor@devops_nk·
What is the difference between a soft link and a hard link in Linux ?
English
8
2
36
9.1K
Ani
Ani@its_ani9·
@javarevisited Hashing hides the password, but identical passwords still produce identical hashes. Salting adds a unique random value before hashing, so even if two users use the same password, their hashes differ. This also blocks rainbow table and precomputed hash attacks.
English
0
1
3
394
Javarevisited
Javarevisited@javarevisited·
Interviewer: If hashing passwords is secure, why do companies still use salting?
English
7
1
29
10.6K
Ani
Ani@its_ani9·
@Sarthak4Alpha A virus is like a fake email attachment, you must open it first, so it needs user action to spread. A worm is like an automatic intruder that finds unlocked doors in a network and spreads by itself, infecting thousands of computers very quickly.
English
0
0
0
11
Sarthak
Sarthak@Sarthak4Alpha·
Interviewer: Why does a computer virus need user interaction to spread, while a worm can infect thousands of systems automatically?
English
27
3
105
2.1K
Ani
Ani@its_ani9·
@faroque_eee @0xlelouch_ Yeah, it gives an approx count with small error(~1–2%) but is extremely memory efficient If exact count is required: Distributed hash partitioning Deduplicate userIds per partition using HashSet/sorting Merge counts across nodes Accurate but much more memory+compute intensive
English
0
0
0
24
Abhishek Singh
Abhishek Singh@0xlelouch_·
Interested in Data structures? Count the number of distinct user IDs across a 10TB clickstream. Solve that!
English
6
3
114
14.4K
Ani
Ani@its_ani9·
@0xlelouch_ Don’t try to load tables, partition first. Hash both 500GB tables by join key into smaller buckets on disk Same keys land in same bucket Join matching bucket pairs one at a time in memory Classic hash join / distributed join: divide -> local joins -> scalable
English
0
0
0
269
Abhishek Singh
Abhishek Singh@0xlelouch_·
Sanjay Ghemawat at Google: Join two 500GB tables on a key when neither fits in RAM and you are hired!
English
3
8
229
37.7K
Ani
Ani@its_ani9·
@SahilExec REST->multiple fixed endpoints(/users, /orders) Simple,cache-friendly, great for stable APIs. GraphQL->single endpoint where client asks exactly what it needs Avoids over/under-fetching, ideal for complex UIs. REST for simplicity/scalability, GraphQL for flexible data fetching
English
1
0
1
38
Edgex
Edgex@SahilExec·
Interviewer: What's the difference between REST and GraphQL? And why would you pick one over the other?
English
19
3
44
10.8K
Ani
Ani@its_ani9·
@pulkit_mittal_ JWT scales well because servers stay stateless, ideal for microservices. But revoking tokens/logout is hard. Redis sessions add a lookup but give better control, instant invalidation, and security. At scale, many systems use a hybrid of both.
English
1
0
1
135
pulkit mittal
pulkit mittal@pulkit_mittal_·
Tech Lead asks this in an architecture discussion: Which session strategy works better at scale? Stateless JWT - token carries all user data, nothing stored server side vs Server-side sessions - token is just a key, state lives in Redis What's your answer?
English
5
1
19
2.2K