Reverse Engineering Twitter
Skills:
LLM Foundations80%Prompt Craft70%Prompting Basics60%Advanced Prompting50%Prompt Systems Engineering50%
Key Takeaways
Reverse engineering Twitter's architecture and user experience, including retrieval augmented generation, fine-tuning, and queue handling for requests, as well as designing for performance, efficiency, and business decisions using tools like Twitter and YouTube.
Full Transcript
what's up y'all this is the same NASA from I geometry where we discuss software engineering by example and this is our reverse engineering series where we pick an app mobile app usually does it's a vertical view and we try to reverse engineering we try to see what are the API is the user experience that that the developers of this app use there and and why did they design the app or even we turns on try to guess the back-end infrastructure or architecture software architecture and why they pick this kind of decisions and we just learned from them because like software engineer you have to keep learning man that's what we do every day we learn a new thing every day by just trying by just writing new apps writing new software you learn new things that's the trick no new language will make you better software engineer nothing will make you better software engineer just actually trying with that let's just jump into it guys and yeah today's Twitter is what today app is Twitter really excited for this right so as you can see i just opened the app here if I click on whom I have my internet know so I'm connected and when I do that it will start scrolling through things I which is interesting right and take a look at the left-hand side here where there is this light gray scroll bar and it's and it's just like scrolling right it's just this is going so at one point I believe what we what we did is we queried certain number of tweets I would imagine we cannot just square the entire feed we quit I don't know maybe 200 we can't really tell the air it's really hard but we crave that and we start displaying them and as as we scroll I believe if we reach certain number we start querying the rest and basically basic this is basic paging exercise so what I want to do next is I'm gonna turn off turn on flight movie or just like I don't have any internet connection and let's see what's what what will happen so I don't have any internet connection so if I what I order will happen if I click on this so that's pretty cool right so this is a very seamless experience although this actually right this this opens the tweet of view which will kinda require more information right and we'll show you the comments or or I guess the tweets on this okay we can call it comments on this tweets right but it will naturally fail and who will not show you the comments because there is no internet connection there is nothing that tells me that hey I fail to do that what happens if I click on these likes obviously that makes sense but that's actually very nice it immediately tells me that hey I you know you don't have internet connection that's pretty cool I like that a lot of what happens if I click this that's just what can I do very nice user experience what happen if I click like see that's pretty cool so liking this I don't have internet connection yet it seems like what Twitter does at least the IRS app it first does this in the user experience as if the rest call will succeed anyway the back end code will succeed and we'll we'll just go ahead and do it and if it fell we're gonna deal with it but that is nice not a lot of people do that at least in youtube if you notice if you click like it doesn't actually immediately take that effect it asks the axe ask the server hey I'm liking this page as I can almost a synchronous call it's almost like a synchronous call it is actually an synchronous : in case of leaving YouTube and then it will it will say ok succeeded and I think it'll also return the number of likes so you will notice something really weird like if you like on YouTube and they're like 7 likes and then you like that and end up with 15 so you'll you'll you'll get the latest one which is I don't know if it's a consistent to you I wouldn't I would like to see that but well as long as it works but like against all decisions that the companies or the developer make here and looks like looks like this this this co obviously failed right but still there is our experience here it says ok I am detecting that there's no internet but let me try again I think I think there is some sort of a queue somewhere here going on all right so let's just let's just go and click on this that's nice it knows that I like this picture there are no numbers here but there's like 418 likes oh I lost it okay there you go so no look at that interesting you would think all right and it is kept here 418 all right what I want to want to do here is now let's go back and turn out my internet connection let's see what happens if I do that does oh man see I immediately pulled that and it remembered that I liked this picture so it was there was like a slight bug here but in general there was some sort of like you I believe that is going on here I'm getting some forecasts notification so yeah so looks like there was a queue and that request got put in the queue and then the user experience got updated and then whenever the internet connection resumed that like has been persisted right and then you can see that clearly here that is pretty cool so if I turn off the internet connections here you can notice that all of these requests on I see so that's another thing so when they requested those comments on this tweet what happened is what what comes back what is coming back in this query that's mystically yeah there's coming back their user that was commenting there's a there's the text of the tweet there is the number of likes on this comment that is the number of comments on this comments which is not retrieved here right because I have to enable the internet connection to retrieve it there's F likes there's another communities and these guys are just replied back and going back so there is a Jeff or if you're on the other side gif that has been retrieved it knows it's a gift or a jiff right but it didn't load it because efficiency and bandwidth right only if you need it you can unload it for you right so I bet then the moment I or another internet hmm look at eventing dude I will not accept that god bless you Oprah look at that so that tells me that Twitter app is listening to this internet connection that's pretty cool alright the game's dead as you can see are we internet now or not an internet connection [Music] alright so even the thumbnails are not getting retrieved here all the users thumbnail right so so what we get here we get a list of all the comments and if I am visualizing those comment this is pretty much similar to the YouTube experience here check out the YouTube or a person engineering episode that we did but yeah it looks like we don't retrieve we retrieve only the URLs of the thumbnails and then we only load those that are in the current view if they user looking at them this could be a default one which is always loaded by the app so that's why I just showed but let's turn them back on that immediately we get all the thumbnails right and as we can we continue zooming in show more reply okay that's why they are called echo replies if you click that you can see more replies than that and obviously it's very interactive app so if I do this so that's unlike this so we can just unlike we cannot unlike oil offline huh interesting about tweet so you can retweet it you can comment I would bet look at that it just like takes it all right I'm betting that a store it will store it somewhere in the draft that is your pretty cool look at that it's trying like I like the dedication all right turn it back on oh did we do we lost this we're not that way but alright regardless okay so it looks like oh no I got my internet connection back where did not it is that's my tweet right did not lose that tweet but that's good but look it Twitter actually the streets oh ha ha ha stop boy all right and you're not gonna go through the entire beat but yeah guys uh that's another thing I love about this look at this look at that so if you go to it a Twitter account that is active like Markie here in KB HD look at that there is some sort of a counter that is going on here one two one two three one it's not even a time it's like it's an ax flip flipping timer like even two seconds sometimes three sometimes one stun so like doesn't look like a timer all right or maybe it's a sec a second by second timer and if if that didn't change okay that makes sense so maybe is it's a two second timer and if there are new likes or tweets it will start updating that right and obviously this will only be for the active tweet that you're currently looking at it's not gonna do this for everything I believe that is just too expensive right so it's just too expensive to query everything in the view and then sledge is like a sixteen hundred so if I like this 1632 okay come on you can do it oh it stopped come on people still liking that thing there must be some streaming going on it's like we're listening to a stream of lies that is as continuing yeah Mike we just stuck there all right it's like it again it's weird if I click on this thing doesn't refresh it here looks like this view doesn't have a refresh which which is weird because this is just like I am viewing a single tweet why are you not updating that I'd like this out to be updated there must be a reason no czarina always are anything goes for everything those guys made alright looks like if I like it it just stops is that really it is that how it works is that the reason it's like oh man seriously so they want you to like it because like they want to show you that hey this is getting our now I was wrong this is updating regardless all right guys I think that's all for me today I hope you enjoy this I liked making those videos let me know if you if you what what other app you want interview check out the other content and in my youtube channel and Instagram la ID TV I put this usually in IG IG TV but yeah alright guys I see on the next one you guys stay awesome
Original Description
This is our #reverseengineering series where we pick a mainstream app and try to understand how the developers built it, how the APIs are designed on the backend and how the front-end user experience is designed for performance, efficiency and business decisions. We can become better software engineers by learning how the likes of Google, Facebook, and Twitter are building APIs and user experiences. Obviously, I might make a mistake here and there but that is part of the fun!
In this episode, we try to reverse engineer the Twitter feed. We discuss how the IOS Twitter App is doing efficient thumbnail caching and insane client queuing of tweets, likes and retweets actions. Enjoy!
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Hussein Nasser · Hussein Nasser · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Extending ArcObjects (IGeometry) - 01 - Getting Started
Hussein Nasser
Extending ArcObjects (IGeometry) - 02 - The Document, The Map and The Layers
Hussein Nasser
Channel Update - New Book, New Job, New Videos
Hussein Nasser
Learn Programming with VB.NET - 01 - Getting Started
Hussein Nasser
Learn Programming with VB.NET - 02 - Classes and Objects (Part 1)
Hussein Nasser
Learn Programming with VB.NET - 03 - Classes and Objects (Part 2)
Hussein Nasser
Learn Programming with VB.NET - 04 - User Interface
Hussein Nasser
Learn Programming with VB.NET - 05 - By Value v. By Reference
Hussein Nasser
Learn Programming with VB.NET - 06 - Variable size, 32 bit vs 64 bit
Hussein Nasser
Learn Programming with VB.NET - 07 - Conditional Statements
Hussein Nasser
Learn Programming with VB.NET - 08 - Inheritance
Hussein Nasser
Learn Programming with VB.NET - 09 - Strategy Design Pattern
Hussein Nasser
Learn Programming with VB.NET - 10 - How did I learn programming
Hussein Nasser
IGeometry 2016 Retrospective - Channel Update
Hussein Nasser
Javascript by Example - The Vook
Hussein Nasser
Vlog - Keep your servers close and your database closer
Hussein Nasser
Vlog - Client/Server Programming Languages
Hussein Nasser
Javascript By Example L1E01 - Getting Started
Hussein Nasser
Persistent Connections (Pros and Cons)
Hussein Nasser
Javascript By Example L1E02 - Building the Calculator Interface
Hussein Nasser
Happy new Year from IGeometry!
Hussein Nasser
Synchronous v. Asynchronous
Hussein Nasser
Javascript By Example L1E03 - Displaying the Digits on Calculator Screen
Hussein Nasser
Show Your Work. Blog, Vlog, Write, Create and Develop!
Hussein Nasser
Relational Database Atomicity Explained By Example
Hussein Nasser
Javascript By Example L1E04 - Operators, All Clear with Arrow Functions
Hussein Nasser
What Comes First, User Experience or Software Architecture?
Hussein Nasser
Javascript By Example L1E05 - Evaluate the Calculator Expressions with eval
Hussein Nasser
Fastest Way to Learn Programming Language or Technology
Hussein Nasser
Javascript By Example L1E06 - Fix Leading Zero Bug with Conditions
Hussein Nasser
Stateful vs Stateless Applications (Explained by Example)
Hussein Nasser
Javascript By Example L1E07 - Running our Calculator on the Mobile Phone
Hussein Nasser
Advice for New Software Engineers and Developers
Hussein Nasser
Why JSON is so Popular?
Hussein Nasser
Building Scalable Software - SLA, HS, VS
Hussein Nasser
Vlog (Istanbul) - Datacenter Proximity
Hussein Nasser
Should Software Engineers Learn Bleeding-Edge Technologies?
Hussein Nasser
Do Developers Build Bad User Interfaces/Experience?
Hussein Nasser
Learn By Doing.
Hussein Nasser
I Wrote Bad Front-End Code That Broke Chrome
Hussein Nasser
My Story
Hussein Nasser
Vlog - Horizontal vs Vertical Scaling
Hussein Nasser
Can User Experience Help Build Better Rest API?
Hussein Nasser
Reverse engineering Instagram in flight mode
Hussein Nasser
The Benefits of the 3-Tier Architecture (e.g. REST API)
Hussein Nasser
Stateless v. Stateful Architecture (Podcast)
Hussein Nasser
The evolution from virtual machines to containers
Hussein Nasser
Proxy vs. Reverse Proxy (Explained by Example)
Hussein Nasser
Canary Deployment (Explained by Example)
Hussein Nasser
No Excuses
Hussein Nasser
Synchronous vs Asynchronous Applications (Explained by Example)
Hussein Nasser
What is an Asynchronous service?
Hussein Nasser
Difference between Client Polling vs Server Push in Notifications
Hussein Nasser
Software vs. Hardware AdBlockers (Explained by Example)
Hussein Nasser
HTTP Caching with E-Tags - (Explained by Example)
Hussein Nasser
Simple Object Access Protocol Pros and Cons (Explained by Example)
Hussein Nasser
Nodejs Express "Hello, World"
Hussein Nasser
Reverse Engineering Instagram feed
Hussein Nasser
Popup Modal Dialog with Javascript and HTML
Hussein Nasser
MIME and Media Type sniffing explained and the type of attacks it leads to
Hussein Nasser
More on: LLM Foundations
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
The AI Moat Paradox: The Better Models Become, the Less Models Matter
Medium · AI
170,927 AI Papers Reveal the Biggest Research Shifts of the First Half of 2026
Medium · Machine Learning
170,927 AI Papers Reveal the Biggest Research Shifts of the First Half of 2026
Medium · Data Science
[PoV] When Everyone Is Smart, No One Is
Medium · AI
🎓
Tutor Explanation
DeepCamp AI