#8 most askedVery commonEasyNative modules & platform
Writing platform-specific code
๐ข Asked in real interviews
No reports yet. Were you asked this? Be the first to say where.How do you handle iOS and Android differences in one React Native codebase?
๐ฎ Predict the output
// How Platform.select picks a value
const makeSelect = (os) => (spec) => (os in spec ? spec[os] : spec.default);
for (const os of ["ios", "android", "web"]) {
const select = makeSelect(os);
console.log(os, select({ ios: "shadowOpacity", android: "elevation", default: "boxShadow" }));
}
๐ค Answer it out loud, then check yourself
Say your answer as if the interviewer is listening (30โ90 seconds). Then reveal what a strong answer covers and tick what you said.
Answer out loud first, then compare.
Want to rehearse it?Answer this to the AI interviewer and get a verdict โ