Skip to content
tezvyn:

App Thinning: slicing, bitcode, and on-demand resources

Source: interviewHardHow cards are made

Summary

download-size optimization mechanisms.

Key points

slicing delivers only the assets and code a device needs; bitcode let Apple recompile and re-optimize; on-demand resources defer large assets until requested.

What's really being asked

The interviewer probes whether you can distinguish three distinct size-reduction techniques and articulate exactly what each one optimizes rather than blurring them together.

The full answer

Slicing is the App Store building and delivering device-specific variants of your app from the universal build you upload, so a given device downloads only the executable architecture and the asset catalog resources, such as the matching image scale, that it actually needs, instead of every variant. Bitcode was an LLVM intermediate representation embedded in the upload that allowed Apple to recompile and re-optimize the app binary on its servers, including targeting future architecture or compiler improvements without you resubmitting; note Apple has since deprecated bitcode. On-demand resources are asset bundles you tag and that Apple hosts; the app downloads a tag's resources only when it requests them at runtime and the system can purge them when storage is low, keeping the initial install lean.

The mistakes people make

Claiming bitcode itself reduces the user's download; its purpose was server-side recompilation and optimization, while slicing is what trims the delivered size. Confusing on-demand resources with general lazy loading from your own server. Treating all three as the same feature.

What usually comes next

Which of these is still used today given bitcode's deprecation? How do asset catalogs enable slicing? How do you tag resources for on-demand delivery and handle their lifecycle?

A concrete example

Slicing: a 3x iPhone downloads only the 3x app icon and image set, not the 1x and 2x variants meant for other devices. Bitcode: by embedding it, Apple could recompile your binary to take advantage of a new optimizer without you uploading again. On-demand resources: a game tags level-ten artwork as an on-demand bundle, so the initial install excludes those large textures and the device fetches them only when the player reaches level ten, then frees them under storage pressure.

Interview question

Which App Thinning mechanism directly reduces the size a specific device downloads by delivering only its matching assets and architecture?

  • a.Bitcode
  • b.On-demand resources
  • c.SlicingCorrect
  • d.Automatic signing
Why?

Slicing delivers a device-tailored variant containing only the needed architecture and asset resolutions. Bitcode enabled server-side recompilation rather than trimming downloads, on-demand resources defer specific tagged bundles, and signing is unrelated.

Just read this? Test yourself on what you have been reading.

Read the original → developer.apple.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on ios — each one lists the topics its interview covers.

See open roles