Madhav ⚡️

1.2K posts

Madhav ⚡️ banner
Madhav ⚡️

Madhav ⚡️

@askmaddyy

Engineer | @Amazon | @AmericanExpress | PEC - 22

Bengaluru, India เข้าร่วม Temmuz 2025
168 กำลังติดตาม1.1K ผู้ติดตาม
ทวีตที่ปักหมุด
Madhav ⚡️
Madhav ⚡️@askmaddyy·
You're in a noisy cafe, a banger comes on, you pull out your phone, and BAM. @Shazam names the song in 5 seconds. How is this even possible?! It’s not magic. It’s one of the most brilliant pieces of engineering in your pocket. A thread on how Shazam really works 🧠🎶👇
Madhav ⚡️ tweet media
English
4
2
33
4.5K
Madhav ⚡️
Madhav ⚡️@askmaddyy·
@danish__an Good going, the beauty of the problem is how you shrink the search space.
English
0
0
2
6
Danish 𝕩
Danish 𝕩@danish__an·
@askmaddyy I will make implement binary search with little modification, will return only when mid index is greater than mid + 1 or mid - 1 is also greater then mid then return mid - 1 and if both the condition isn't satisfied then will reduce the searching space by adding..
English
1
0
0
15
Madhav ⚡️ รีทวีตแล้ว
Madhav ⚡️
Madhav ⚡️@askmaddyy·
Sick of seeing fake AI interview questions on the timeline. I’ll post one real question every day. Stuff I’ve actually seen in interviews. Day 3: You are given a sorted array that has been rotated an unknown number of times. Find the minimum element. Example: [4, 5, 6, 7, 0, 1, 2] → 0 How would you approach this?
English
2
1
4
117
Danish 𝕩
Danish 𝕩@danish__an·
@askmaddyy In this question first I will try to find the pivot element the condition to get the pivot would be if Previous number is greater and next number is also greater if both condition satisfied then that is the minimum element in the array...
English
1
0
0
17
Madhav ⚡️
Madhav ⚡️@askmaddyy·
Hint: The array is still partially sorted. Use that.
English
0
0
2
18
Madhav ⚡️
Madhav ⚡️@askmaddyy·
@PythonPr Ans: 6 When we start processing X as it contains numerical operators (+ and *) the value true and false are converted to the numerical equivalent of them. True becomes 1, false becomes 0. Now the calculation is simple X = 1+ 1*2 => 1+2 => 3 Y = 0+3 => 3 X+Y = 6
English
0
0
6
484
Madhav ⚡️
Madhav ⚡️@askmaddyy·
@EOEboh 12 rows. Cross join creates a cartesian product, every row in A pairs with every row in B (3 × 4 = 12).
English
0
0
1
552
Captain-EO 👨🏾‍💻
How many rows does this return? Table A: 3 rows Table B: 4 rows SELECT * FROM A CROSS JOIN B
English
7
0
25
12.2K
Madhav ⚡️
Madhav ⚡️@askmaddyy·
This is a common bug, so the idea is each server pulls the count from DB, calculates the final count (by adding the page views it stored locally) and updates the DB with that final count, would've worked absolutely fine if we had a single server. Here we are losing the counts from other servers. Ideally it should just send an update query to add the page views on the server and let DB handle concurrency.
English
0
0
2
353
Abhishek Singh
Abhishek Singh@0xlelouch_·
You're implementing a distributed counter (total page views) across 100 servers. Each server increments locally and syncs to database every 10 seconds, but the count is always incorrect. What's the bug? [Topic: Distributed Counters]
English
7
0
41
6.2K
Madhav ⚡️
Madhav ⚡️@askmaddyy·
@ashoKumar89 Indexes slow writes in high traffic systems, every insert, update and delete query has to update B-trees. Better approach is to check and update existing indexes, caching, or read replicas first.
English
0
0
5
229
Ashok Sahoo
Ashok Sahoo@ashoKumar89·
A senior dev proposes: “Add more indexes- queries are slow.” But write traffic is very high. What is your concern?
English
10
1
33
9.4K
Madhav ⚡️
Madhav ⚡️@askmaddyy·
@imukulmunjal Interesting direction, can you explain more about this approach because I see a small bug with this approach where it might not be able to catch duplicates
English
0
0
1
14
Mukul building InterviewFlowAI
@askmaddyy bloom filter pass to flag candidates, then external sort + merge for confirmation. classic constraint problem. love this series
English
1
0
0
22
Madhav ⚡️ รีทวีตแล้ว
Madhav ⚡️
Madhav ⚡️@askmaddyy·
Sick of seeing fake AI interview questions on the timeline. I’ll post one real question every day. Stuff I’ve actually seen in interviews. Day 2: This one was asked to me in an internship interview back in college. You have 1 billion integers. You need to find duplicates. You can’t load everything into memory. What would you do?
English
2
1
4
129
Madhav ⚡️
Madhav ⚡️@askmaddyy·
Hint: If it doesn’t fit in memory, think about splitting the data and working on smaller parts.
English
0
1
5
62
Madhav ⚡️
Madhav ⚡️@askmaddyy·
@PythonPr The answer is 20, t[1] points to the 2nd element in the list which in this case is 10. We just multiply it by 2 and get our answer.
English
0
1
6
872
Madhav ⚡️ รีทวีตแล้ว
Madhav ⚡️
Madhav ⚡️@askmaddyy·
Could be questions I’ve asked candidates or ones I’ve been asked
English
1
1
2
50
Madhav ⚡️ รีทวีตแล้ว
Madhav ⚡️
Madhav ⚡️@askmaddyy·
Everyone on X are posting fake interview questions lately. Should I start posting the real interview questions starting tomorrow?👀
English
3
1
4
99
Hacktivist
Hacktivist@hackt1v1st·
@askmaddyy AI resource cost is coming to bite these orgs? 👀
English
1
0
0
10
Madhav ⚡️
Madhav ⚡️@askmaddyy·
@PythonPr Took me a good 2 mins to understand but we’re using uppercase ‘P’ for print in the second part of the image, python is case sensitive so it should be ‘print’ not ‘Print’
English
0
0
5
345