
Frontend Engineer
CourseraFrontend Engineer
AmazonFrontend Developer
PubMaticSystem Engineer
InfosysHi. My name is Shivam Soni. I'm currently working as a front-end engineer at Amazon, and my technical expertise include HTML, CSS, JavaScript, and React. I have around 4.5 years of experience. I belong to Rajasthan. And, yes. That's a very short introduction. I'll
So how can I okay. So for the initial loading, I guess, we can start with the web portal. We can use the lighthouse. That is a kind of performance tool from which the 1st load time or the cumulative layout shift are like, there are so many metrics available to which we can test our page load application. Second, to increase the loading time, we can use the CDN also, just to get the earlier assets. Third, image compression, we can compress our images to webp, so that a complete image will also be there. Four, just to add more loading, just to fasten the loading time, we can have a basically lazy loading component. And so, that our bundle size would be less, and we can fetch it faster. And for the responsiveness, we can use Tailwind, which is like, currently a popular framework. Apart from that, page assets would be yeah. We can inline our CSS. So because CSS is a render-blocking element, we can inline the CSS for the app component so that the render block can be prevented. Yeah. These are the major steps that we can take for the optimization of the web page.
So ensure that your job differs across browsers. So just to ensure cross-browser compatibility in JavaScript. So ensuring cross-browser compatibility. Make sure your JavaScript code works across all browsers. First thing is, it's always better to choose a framework that is more compatible. The MDN document sees everything about it. Second thing is, we should consider our polyfill. A polyfill is the major thing that should work across. Otherwise, we have to write our own polyfill. Just like for an example, includes won't work in the IE, which is deprecated now. So another thing about this is, avoid excessive use of the markup. Use the list tools just to create the menus instead of the p elements, using the correct HTML5 syntax, which can help us. Or what more, providing the fallbacks could be a major thing that we can do. And, these are the major things that we can do.
Would you apply to create the form layout as both accessible and responsible on the mobile devices using HTMLs and CSS? So to increase the accessibility, I guess we should first use the HTML five semantic elements because they are used for web accessibility as well as for the SEO part. That's the first thing. Second, to increase accessibility, we can include ARIA attributes, which are really helpful for screen readers and for disabled people to get more accessibility. We can also include the speech text, which is also helpful in achieving this accessibility. In terms of responsiveness, we can use Flexbox, which is majorly used. Second, we should add media queries wherever possible. And we should have breakpoints on each screen size just to increase the responsiveness of the web as well as mobile application.
So how would you approach creating a JavaScript function that dynamically updates the UI without reloading the page? So just to reload the page, initially, AJAX requests were there. But now the single page application has already came. So without reloading the page, we can handle that? Again, second thing, like, prevent default is, again, the like, inside the function, if we use the prevent default, it won't rerender the whole page. Instead of that, it will just prevent the rerendering of the whole page, and will, just update the UI dynamically? That's how, like, we can add the dynamic updates on the UI
When building a high-traffic website, how would you optimize the CSS delivery to improve critical path performance? So, CSS is a major render-blocking factor. While building our sites, the steps to reach a complete, pixel-perfect page are first creating the DOM. Second, is creating the CSSOM. So, DOM updates occur when chunks of HTML elements are committed. It creates the DOM. But CSS has to wait for the complete CSS to arrive before creating the CSSOM. Then, it creates the CSSOM, then the DOM, and finally, they merge to create the complete layout. Paint or reflow then happens. Coming to the optimization of CSS delivery, first, we should have a smaller bundle size. That's the first thing. Second, we can increase CSS delivery by writing some inline code, just to block the initial build wherever possible. Third, we can use preload, prefetch, and preload or prefetch highly critical images or CSS, apart from that, these are the major things from where we can optimize the process. Apart from this, we can add one more thing: using a CDN. We can store all these files in this CDN, which we can fetch easily. Minification of the CSS file will also help in reducing the bundle size of the CSS, so it can be sent over the network.
In the given transcript, there are several grammatical errors and inconsistencies in sentence structure. Here is the corrected transcript: "In the following HTML service segments, there is a common error that could affect our user experience. Can you spot and explain the mistake and provide the debugging approach for this? So, when I add an event listener to an HTML submit button, click on it. So, when will the HTML be there? First, we can do this during the function, but I guess the page will be reloaded initially because we are not using the e.preventDefault method. Once we can actually remove the alert part, let me think it through one more time. It's not a good practice to use the alert inside the function because it can be much faster than the DOM. It will instantly block the UI whenever you click on that function. So, we should avoid writing the function that way. Apart from this, I feel like the submit button is not defined in the HTML part. We should give an ID to the submit button."
Can you identify any potential issue with the following CSS snippet related to the response in your design? Provide explanation what could be wrong enough for some advisers on how to improve this. About potential issue with the CSS snippet related to the responsiveness design. About So the thing here I identified is, about so if the width is 960 pixel, then it will be aligned to the center part. And about if it is lesser than 960px then width would be on the 100%. So it will definitely, about no. I'm not much aware about this
What approach would you take to build a single page application with the JAVA JavaScript, ensuring both smoother experience on the mobile? Single page application with vanilla JavaScript to ensuring both smoother and smoother experience. So just to include What approaches I would take first to organize the code? So second thing is reactive reacting the changes with the whatever Changes we are doing, like, whatever based on the interaction with the UI. We can also include the support of data binding. we can have a proper handling the navigation routing. That could also be done. And, we can also include the keyboard support, controls, and clicks on the tabs. So
Can you suggest a way to dynamically adjust a boot strap grid layout based on the data fetched from the API? I'm not aware about this.
How would you set up a CSS preprocessor like SASS in a new project? What benefits it provides. So SASS is basically a wrapper built on top of CSS only. And it's ultimately code is combined to CSS only. The major benefits of SASS are, we can declare variables inside it. We can have a nesting of CSS one inside another. We can also use the import and include feature. So, just writing one CSS code can be used in other things also. Apart from this, we can extend SASS by providing modules inside it. We can have a mixin with SASS. Like, mixing. You can just write a code, and then you can mix that. You can use an include to add it anywhere you want. Within that, you can use it as a function also. You can pass dynamic parameters there also. And, it also supports inheritance. And, it has some operators. You can use them to dynamically define sizes.
So the best way to handle backward compare compatibility is to use the feature flag. That is one of the ways by which we can do that. The feature flag is the way by which we can have the new JavaScript while launching the new feature, we can keep that feature for a particular audience. If that does not ensure that or of a particular reason, if that does not guarantee that, this will be going ahead or this is not going to sustain, we can just add a feature flag to turn off that particular flag and just include the older version of that. So we can have backward compatibility. Another thing is to ensure keeping the older code in a very reusable fashion so that you can add more backward compatibility. So, I guess, feature flag is one of the best ways by which we can have backward compatibility.