Most of those are built by agencies*, so normally what they are is just WordPress (or similar tech: WebFlow for example) sites with a load of JS plugins. What they look like is very much in the design, which often isn’t really in the purview of the developer.
Make stuff, practice.
* note that many are built specifically for publicity, eg to get on sites like awwwards. The actual work the agencies produce generally looks a lot more prosaic as it has to deal much more with real-world concerns
Do you need D & A for the job as a web dev?
No, you can build entire apps without ever having solved a single one.
Are they useful to learn?
Yes, you will very likely get some during the application process.
They also train your problem solving skills.
That’s the reason why you get those tasks, your analytical skills are tested and sometimes the interviewer won’t even need to see the solution after you described your thought process.
Best try to find out early what the most popular D & A questions are currently, it will save you time and you can prepare.
Another tip: Learn backend, even as a frontend focused developer, with headless CMS like Sanity or Contentful.
They make setting up a backend easy and you will be much more independent. You can take freelance side gigs for example and build a fullstack app for a business for some nice extra dollars.