Reverse engineering Instagram in flight mode

Hussein Nasser · Beginner ·🔐 Cybersecurity ·8y ago

Key Takeaways

Reverse engineering Instagram's user experience and performance optimization techniques, including caching, queueing, and error handling, while in flight mode

Full Transcript

what up y'all this is a st. also from I geometry where we're just go software engineering bikes on and today I'm gonna fly back to Los Angeles and I want to do something I wanted to do for a long time work with Instagram while it's offline and see how cool the user experience that that have been developed by those guys really so I'm actually amazed by these little things that improve the user experience from a user point of view and we don't really notice that much so let's get let's get it let's get to this right so I'm gonna play this video now and the first thing here in a few seconds I'm going to perform a like right so I'm gonna like this picture obviously there's no internet connection but see what happens here is like let me pause the video and I like that picture immediately that that heart I can changed and the likes count also changed so this indicates that obviously there's no way that this like actually persisted on the server right because what's happening here is for the sake of user better user experience what Instagram is doing is it's its first showing the user that hey I am gonna register your like as if it's gonna succeed anyway right because it has to do something at the back end right it has to send a rest request to the services that is responsible for the likes and then perform that like right whether registering that adding more data right adding any record to a table whatever that is right it needs to take some latency but they are absorbing that latency by showing you something at the user experience so this is kind of false advertisement here if you think about it because at the time you like this picture this actually did not like it's just queued up your requests and there is a chance that loot you like won't get registered but that's what they don't really care because it's like this is not a financial transaction right so it's like okay if you write is not really succeed i want i built this application to give you the bare best user experience right it's okay if you like did not register at the server oh we're getting looking some turbulence here all right so it's okay if you like to go register so so let's see what happens here after a few seconds after a few seconds since I don't have an internet connection that will undo so that operation got undone and I'm back to two eight four seven likes right so that tells me there is some sort of a queue or a stack at the client-side registered here god damn and that turbulence man whew heavy turbulence man alright so yeah that tells me there is a some sort of a stack and a client-side memory in the beautiful the beauty of this like I am seeing this picture right now this samurai right and I I was able to see that picture because I was browsing Instagram while I had internet connection and just disconnected so all of this is now cached and there is two got memory and guess what when I close and reopen Instagram I was able to see all that stuff so it's good let's go ahead and play the rest of the video what I'm about to do now here next is see their view all comments for comments what we know that there are four comments at the time of querying that pictures there were four common but for I would think for performance reasons those comments did not actually get retrieved right same thing with the likes this is just a count those if I I bet if you click on those likes nothing happens because it needs to query and view all these comments and view all these likes right let's go ahead and click on this view all four comments which will I get this wall any second now makes a request to the service to retrieve the number of comes there you go right so I'm clicking here and I am viewing all these comments the four comments I tend me to defuse the four comments that this picture has but look at that right nothing happens going back right so huge thing like why is this thing I was doing that why is not actually showing all this out or retrieving that comment at a time of coining that picture obviously if you think about it it's all about trade off right so you might want to pull all these comments but what if there are like thousands of comments right that the payload coming back from server will be really big and you don't want that because again poor user experience so let's go ahead and as what I'm gonna do next is here I'm trying to retrieve the feed that I have here but obviously there's nothing so look at that but and I'm getting a message no internet connection let's continue playing that what I'm gonna do here is like I'm gonna click on on the picture and the menu and all them to use one of these stuff right share to messenger so obviously Instagram is owned by Facebook so obviously there will be some sort of integration between Facebook and Instagram so I'm gonna I'm gonna click on copy link and I'm assuming this will succeed because the link is a cheap non expensive pieces of information that it will get back as a result of retrieving these pictures so copying the link to the clipboard is does not require us to query the service all right so it's like and as we expected it's actually succeeded that's good so worse man I'm feeling this the gum profile for the samurai ward that might actually work depend on at the time of querying these pictures it will retrieve some of the profile pictures and the stories for that account or not and it looks like we did not so or maybe we did but that cache got written off by others by other content so there's something called the least recently used cache algorithm where if if if if a certain cache is not used for a certain amount of time it will be overwritten by a newer content and this is what happens I think here going back again we get there no internet connection it's actually very cool that I'm still working with the application it's that picture doesn't hang doesn't crash look at that trying to view nothing in a while I go upstairs I've stairs you can't go up my feet and try to view another account right previously up there I'm trying yeah he remembers trying to re like this picture and you see as you can see that like failed there's another picture that has been previously that's another see there's a 2-1 picture or I think the two videos really and those videos are for I think it's only the first frame has been loaded and the actual video was not queried let's see what we're gonna do here yeah that's exactly what I suspected right it's only videos the video yeah this is actually interesting see what I did here the comment the original comment for that user for that picture was loaded but it was not shown it was actually trying hated but it was cached on this tegami more so when I clicked on view the whole comment I wish I can go back but yeah maybe I can't but yeah when I click on that video and I think really happen when I click on that comment it will show all that video right it's actually interesting view of the comment and we don't need to Quay the rest endpoint to view the rest of the comments that is so cool man yep nothing here I mean we're ending this video round yeah that is that is really cool so it's actually amazing how would the user experience look at I'm gonna like this 467 after a few seconds like 1 2 3 3 seconds and that we don't even get an error right that tells me that histogram is first purposefully hiding those errors for better user experience so if you're like failed you'll never know if you like the picture you'll never know that you actually like that like persisted or not see you're lurking again and fail but it fails silently look at that it just fails silently that is amazing man look at that nothing this is the end of a video yeah yep that's it yeah so guys this was like a quick react on an Instagram working offline how can I save this video I can upload it for you guys somewhere maybe this - this one is day I think alright guys you guys stay awesome hope you like this content let me know if you like this kind of content I'm gonna make more content like this if you really enjoyed we're gonna make more content like this and I like to just view this and just talk about how the user experience works versus the back end versus decisions that the developer makes to make the to make a trade-off between the better user experiences versus load and performance alright guys you guys stay awesome gonna see you on the next one good take care

Original Description

This is a new series that I started where I use a popular app try to reverse engineer the user experience. Making guesses on how it was written and what technologies might have been used. In this episode I am on a flight back to los Angeles, I turn on flight mode and open Instagram and start working with the app and commenting on its behavior. Very interesting video I enjoyed making it. The app didn’t crash at all, the user experience remain solid. We discuss the trade offs the developer makes to make sure the user experience is optimal and performance is met. Enjoy guys let me know what you think about this thanks. Sorry about vertical first video screening from phone. Will do better next time. Stay awesome Hussein
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Hussein Nasser · Hussein Nasser · 44 of 60

1 Extending ArcObjects (IGeometry) - 01 - Getting Started
Extending ArcObjects (IGeometry) - 01 - Getting Started
Hussein Nasser
2 Extending ArcObjects  (IGeometry) - 02 - The Document, The Map and The Layers
Extending ArcObjects (IGeometry) - 02 - The Document, The Map and The Layers
Hussein Nasser
3 Channel Update - New Book, New Job, New Videos
Channel Update - New Book, New Job, New Videos
Hussein Nasser
4 Learn Programming with VB.NET - 01 - Getting Started
Learn Programming with VB.NET - 01 - Getting Started
Hussein Nasser
5 Learn Programming with VB.NET - 02 - Classes and Objects (Part 1)
Learn Programming with VB.NET - 02 - Classes and Objects (Part 1)
Hussein Nasser
6 Learn Programming with VB.NET - 03 - Classes and Objects (Part 2)
Learn Programming with VB.NET - 03 - Classes and Objects (Part 2)
Hussein Nasser
7 Learn Programming with VB.NET - 04 - User Interface
Learn Programming with VB.NET - 04 - User Interface
Hussein Nasser
8 Learn Programming with VB.NET - 05 - By Value v. By Reference
Learn Programming with VB.NET - 05 - By Value v. By Reference
Hussein Nasser
9 Learn Programming with VB.NET - 06 - Variable size, 32 bit vs 64 bit
Learn Programming with VB.NET - 06 - Variable size, 32 bit vs 64 bit
Hussein Nasser
10 Learn Programming with VB.NET - 07 - Conditional Statements
Learn Programming with VB.NET - 07 - Conditional Statements
Hussein Nasser
11 Learn Programming with VB.NET - 08 - Inheritance
Learn Programming with VB.NET - 08 - Inheritance
Hussein Nasser
12 Learn Programming with VB.NET - 09 - Strategy Design Pattern
Learn Programming with VB.NET - 09 - Strategy Design Pattern
Hussein Nasser
13 Learn Programming with VB.NET - 10 -  How did I learn programming
Learn Programming with VB.NET - 10 - How did I learn programming
Hussein Nasser
14 IGeometry 2016 Retrospective - Channel Update
IGeometry 2016 Retrospective - Channel Update
Hussein Nasser
15 Javascript by Example - The Vook
Javascript by Example - The Vook
Hussein Nasser
16 Vlog - Keep your servers close and your database closer
Vlog - Keep your servers close and your database closer
Hussein Nasser
17 Vlog - Client/Server Programming Languages
Vlog - Client/Server Programming Languages
Hussein Nasser
18 Javascript By Example L1E01 - Getting Started
Javascript By Example L1E01 - Getting Started
Hussein Nasser
19 Persistent Connections (Pros and Cons)
Persistent Connections (Pros and Cons)
Hussein Nasser
20 Javascript By Example L1E02 - Building the Calculator Interface
Javascript By Example L1E02 - Building the Calculator Interface
Hussein Nasser
21 Happy new Year from IGeometry!
Happy new Year from IGeometry!
Hussein Nasser
22 Synchronous v. Asynchronous
Synchronous v. Asynchronous
Hussein Nasser
23 Javascript By Example L1E03 - Displaying the Digits on Calculator Screen
Javascript By Example L1E03 - Displaying the Digits on Calculator Screen
Hussein Nasser
24 Show Your Work. Blog, Vlog, Write, Create and Develop!
Show Your Work. Blog, Vlog, Write, Create and Develop!
Hussein Nasser
25 Relational Database Atomicity Explained By Example
Relational Database Atomicity Explained By Example
Hussein Nasser
26 Javascript By Example L1E04 - Operators, All Clear with Arrow Functions
Javascript By Example L1E04 - Operators, All Clear with Arrow Functions
Hussein Nasser
27 What Comes First, User Experience or Software Architecture?
What Comes First, User Experience or Software Architecture?
Hussein Nasser
28 Javascript By Example L1E05 -  Evaluate the Calculator Expressions with eval
Javascript By Example L1E05 - Evaluate the Calculator Expressions with eval
Hussein Nasser
29 Fastest Way to Learn Programming Language or Technology
Fastest Way to Learn Programming Language or Technology
Hussein Nasser
30 Javascript By Example L1E06 -  Fix Leading Zero Bug with Conditions
Javascript By Example L1E06 - Fix Leading Zero Bug with Conditions
Hussein Nasser
31 Stateful vs Stateless Applications (Explained by Example)
Stateful vs Stateless Applications (Explained by Example)
Hussein Nasser
32 Javascript By Example L1E07 - Running our Calculator on the Mobile Phone
Javascript By Example L1E07 - Running our Calculator on the Mobile Phone
Hussein Nasser
33 Advice for New Software Engineers and Developers
Advice for New Software Engineers and Developers
Hussein Nasser
34 Why JSON is so Popular?
Why JSON is so Popular?
Hussein Nasser
35 Building Scalable Software - SLA, HS, VS
Building Scalable Software - SLA, HS, VS
Hussein Nasser
36 Vlog (Istanbul) - Datacenter Proximity
Vlog (Istanbul) - Datacenter Proximity
Hussein Nasser
37 Should Software Engineers Learn Bleeding-Edge Technologies?
Should Software Engineers Learn Bleeding-Edge Technologies?
Hussein Nasser
38 Do Developers Build Bad User Interfaces/Experience?
Do Developers Build Bad User Interfaces/Experience?
Hussein Nasser
39 Learn By Doing.
Learn By Doing.
Hussein Nasser
40 I Wrote Bad Front-End Code That Broke Chrome
I Wrote Bad Front-End Code That Broke Chrome
Hussein Nasser
41 My Story
My Story
Hussein Nasser
42 Vlog - Horizontal vs Vertical Scaling
Vlog - Horizontal vs Vertical Scaling
Hussein Nasser
43 Can User Experience Help Build Better Rest API?
Can User Experience Help Build Better Rest API?
Hussein Nasser
Reverse engineering Instagram in flight mode
Reverse engineering Instagram in flight mode
Hussein Nasser
45 The Benefits of the 3-Tier Architecture (e.g. REST API)
The Benefits of the 3-Tier Architecture (e.g. REST API)
Hussein Nasser
46 Stateless v. Stateful Architecture (Podcast)
Stateless v. Stateful Architecture (Podcast)
Hussein Nasser
47 The evolution from virtual machines to containers
The evolution from virtual machines to containers
Hussein Nasser
48 Proxy vs. Reverse Proxy (Explained by Example)
Proxy vs. Reverse Proxy (Explained by Example)
Hussein Nasser
49 Canary Deployment (Explained by Example)
Canary Deployment (Explained by Example)
Hussein Nasser
50 No Excuses
No Excuses
Hussein Nasser
51 Synchronous vs Asynchronous Applications (Explained by Example)
Synchronous vs Asynchronous Applications (Explained by Example)
Hussein Nasser
52 What is an Asynchronous service?
What is an Asynchronous service?
Hussein Nasser
53 Difference between Client Polling vs Server Push in Notifications
Difference between Client Polling vs Server Push in Notifications
Hussein Nasser
54 Software vs. Hardware AdBlockers (Explained by Example)
Software vs. Hardware AdBlockers (Explained by Example)
Hussein Nasser
55 HTTP Caching with E-Tags -  (Explained by Example)
HTTP Caching with E-Tags - (Explained by Example)
Hussein Nasser
56 Simple Object Access Protocol Pros and Cons (Explained by Example)
Simple Object Access Protocol Pros and Cons (Explained by Example)
Hussein Nasser
57 Nodejs Express "Hello, World"
Nodejs Express "Hello, World"
Hussein Nasser
58 Reverse Engineering Instagram feed
Reverse Engineering Instagram feed
Hussein Nasser
59 Popup Modal Dialog with Javascript and HTML
Popup Modal Dialog with Javascript and HTML
Hussein Nasser
60 MIME and Media Type sniffing explained and the type of attacks it leads to
MIME and Media Type sniffing explained and the type of attacks it leads to
Hussein Nasser

This video teaches how to reverse engineer Instagram's user experience and performance optimization techniques while in flight mode, highlighting the importance of caching, queueing, and error handling in providing a seamless user experience. By analyzing Instagram's behavior in flight mode, viewers can gain insights into the app's architecture and design trade-offs. The video also touches on cybersecurity and defensive AI concepts, demonstrating how these principles are applied in a real-world

Key Takeaways
  1. Like a picture on Instagram while offline
  2. View all comments for a picture on Instagram while offline
  3. Click on the view all comments button
  4. Undo the like operation
  5. Close and reopen Instagram
  6. Analyze app behavior in flight mode
  7. Identify caching and queueing mechanisms
  8. Understand error handling and performance optimization techniques
💡 Instagram's use of caching, queueing, and error handling mechanisms allows for a seamless user experience even in offline mode, but also introduces potential security risks and trade-offs between user experience and performance

Related AI Lessons

API-RTA Exam Walkthrough — Passed | CyberWarFare Labs
Get hands-on experience with the API-RTA exam, a practical black-box certification for red team analysts, and learn how to prepare for it
Medium · Cybersecurity
Ethical Hacking Step-by-Step (Part 3)
Learn ethical hacking by understanding network security fundamentals, including packets, firewalls, and traffic analysis using Wireshark.
Medium · Cybersecurity
DORA Compliance in 2026: What European Businesses Actually Need to Know
European businesses using cloud infrastructure must understand DORA compliance in 2026 to avoid regulatory risks
Medium · Cybersecurity
VAPT Series Part 2: Reconnaissance and Information Gathering — The Foundation of Every Pentest
Learn the importance of reconnaissance and information gathering in pentesting and how to apply these techniques in a real-world scenario
Medium · Cybersecurity
Up next
You Think Your Card Declined by Mistake? It Might Be a 2026 Scam
Tolulope Michael
Watch →