1. how do you implement concurrency in javascript? a - they've to explain single threaded javascript, browser or node environment, and only then the event loop
  2. why do html forms auto-submit and reroute? a - ajax only came later, this was the only way before
  3. different ways of fetching or posting data xhr img or src tags, since they're all HTTP request, technically you can send data via GET request params jsonp
  4. can a script on one tab access another tabs dom, or if open an iframe and open a banking website, can I send requests or access cookies? a - SOP, and then follow up questions on SOP. also, http cookies.
  5. what is under and what isn't under SOP? a - storage, cookies, scripts and xhr fall under sop. while other resources such as imgs etc don't.
  6. CORS a - explain how CORS is set, and why there's still a problem with it i.e request will still be sent, response can't be read. hence can be exploited.
  7. if i try to fire 10 xhr requests at once, what happens? a - browsers have a concurrency limit based on the tcp protocol i.e http1, http2 etc. ideally, you should chunk it to 5 requests.
  8. why the need for IIFE? a - before es6, only way of emulating block scope
  9. explain closures and why? a - indepth explanation of execution context, lexical environments. and for loop creating new block for each iteration with let.
  10. is ecma script specifies something, how is it implementeed? a - it's upto the js engine to decide how it'll implement a feature. es only specifies behaviour, not internal implementation.
  11. protoype based OOP a - explain oop in terms of prototypes vs class.
  12. explain the dynamic nature of javascript a - prototype based, can append properties to objects even after creation, functions are also objects, run time types, allows for reassignment etc
  13. why is javascript like this? why prototype based model, why dynamic? a - originally, it was just a scripting language and not meant to be a full blown programming langugage.
  14. explain cascading, inheritance and specificty in CSS a - high level explanation of cascading and specificty algorithm for style resolution, and different origins of css i.e user-agent stylesheet, user, author etc
  15. explain viewport, and logical px in css a - preferred answer would be meta tag introduced by apple and then virtual resolutions
  16. if i load a viedo with video tag, and run an infinite loop in js main thread, the site is stuck, but how does video still play? a - browser offloads media playback to seperate threads. only interactions with video etc are handled by js
  17. from an application perspective, how is mobile and web dev different? a - intuitive answer includes mobile apps being an entire package i.e default SPAs, single entry point and different routing paradigm, and data fetching, initial global data everything handled differently from web.
  18. explain SPAs, and different rendering strategies in modern web dev a - SSR, CSR, SSG etc
  19. can i store a huge image file in a data url? a - differnt types of urls, paths, data url and url character limit