Add office photos
Snapdeal logo
Engaged Employer

Snapdeal

Verified
3.8
based on 645 Reviews
Video summary
Filter interviews by
Front end Engineer
Skills
Clear (1)

Snapdeal Front end Engineer Interview Questions and Answers

Updated 5 Feb 2024

Q1. Write a code to find if the input date is today or tomorrow based on the current date. If it's not today or tomorrow, output the no of days difference between the input date and the current date.

Ans.

Code to find if input date is today/tomorrow or no of days difference from current date.

  • Get current date using Date() constructor

  • Convert input date to Date object

  • Compare input date with current date to check if it's today/tomorrow

  • If not, calculate the difference in days using getTime() method

  • Output the result accordingly

Add your answer
right arrow

Q2. Explain box model in css, and what is specificity in CSS. What are render-blocking statements?

Ans.

Box model defines how elements are rendered in CSS. Specificity determines which CSS rule applies to an element. Render-blocking statements delay page rendering.

  • Box model includes content, padding, border, and margin.

  • Specificity is calculated based on the number of selectors and their types.

  • Render-blocking statements are CSS or JavaScript files that prevent the page from rendering until they are loaded.

  • Use media queries to optimize rendering and reduce render-blocking stateme...read more

Add your answer
right arrow

Q3. What is event bubbling, event capturing and its use?

Ans.

Event bubbling and event capturing are two mechanisms in JavaScript that describe the order in which events are handled.

  • Event bubbling is the process where an event is first captured by the innermost element and then propagated to its parent elements.

  • Event capturing is the opposite process where an event is first captured by the outermost element and then propagated to its child elements.

  • Event bubbling is the default behavior in most browsers.

  • Event.stopPropagation() can be us...read more

View 1 answer
right arrow

Q4. How will you implement infinite scrolling in react js?

Ans.

Implement infinite scrolling in React JS using Intersection Observer API.

  • Use Intersection Observer API to detect when the user has scrolled to the bottom of the page.

  • Fetch new data and append it to the existing data using setState.

  • Use a loading spinner to indicate that new data is being fetched.

  • Add a debounce function to prevent multiple API calls while scrolling.

  • Use a key prop when rendering the list of data to avoid re-rendering of existing elements.

Add your answer
right arrow
Discover Snapdeal interview dos and don'ts from real experiences

Q5. Tell about Saas( Syntactically Awesome Style Sheets)

Ans.

Saas is a CSS preprocessor that extends the functionality of CSS with variables, mixins, and more.

  • Saas stands for Syntactically Awesome Style Sheets

  • It allows for the use of variables, mixins, and functions in CSS

  • Saas code must be compiled into CSS before it can be used in a web page

  • Saas is often used in conjunction with build tools like Gulp or Webpack

Add your answer
right arrow

Q6. Write code to find if two objects are equal or not in javascript

Ans.

Code to check equality of two objects in JavaScript

  • Use the JSON.stringify() method to convert the objects into strings

  • Compare the string representations of the objects using the === operator

  • If the strings are equal, the objects are considered equal

View 1 answer
right arrow

Q7. What is bind in javascript and write its polyfill

Ans.

Bind creates a new function with a specified 'this' value and arguments.

  • Bind returns a new function with the same body as the original function.

  • The 'this' value of the new function is bound to the first argument passed to bind().

  • The subsequent arguments are passed as arguments to the new function.

  • Polyfill for bind() can be created using call() or apply() methods.

Add your answer
right arrow

Q8. what is the difference between async and defer

Ans.

async loads script while page continues to load, defer loads script after page has loaded

  • async loads scripts asynchronously while page continues to load

  • defer loads scripts after the page has loaded

  • async scripts may not execute in order, while defer scripts do

  • async scripts may cause rendering issues, while defer scripts do not

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Recently Viewed
JOBS
I.T.S - The Education Group
No Jobs
SALARIES
Schlumberger
INTERVIEWS
IndustryBuying.com
No Interviews
INTERVIEWS
Snapdeal
No Interviews
SALARIES
Schlumberger
SALARIES
Schlumberger
INTERVIEWS
Real Time Data Services
No Interviews
SALARIES
Schlumberger
SALARIES
Schlumberger
SALARIES
Schlumberger
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter