Zensar Technologies
10+ Pinnacle Agritech Interview Questions and Answers
Q1. What are pseudo classes and pseudo elements in CSS?
Pseudo classes and pseudo elements are CSS selectors that target specific states or parts of an element.
Pseudo classes target specific states of an element, such as :hover, :active, and :focus.
Pseudo elements target specific parts of an element, such as ::before and ::after.
Pseudo classes and pseudo elements are denoted by a colon (:) or double colon (::) preceding the selector.
They can be used to add special effects, such as changing the color of a link when it is hovered ov...read more
Q2. Difference between display: inline, display: block and display: inline-block in CSS?
display: inline, block and inline-block are CSS properties that define how an element is displayed on a webpage.
display: inline - element is displayed inline with the text and other inline elements. It does not start on a new line.
display: block - element is displayed as a block-level element, starting on a new line and taking up the full width available.
display: inline-block - element is displayed inline with the text and other inline elements, but can have a width and heigh...read more
Q3. What is the difference between element and components in React?
Elements are the smallest building blocks of React UI, while components are made up of one or more elements.
Elements are immutable and cannot be changed once created
Components are reusable and can be composed of other components
Elements are represented by tags, while components are represented by functions or classes
Examples of elements include
, , and , while examples of components include,
Q4. What is position: absolute vs position: relative in CSS?
position: absolute takes element out of normal flow, position: relative keeps element in normal flow but allows for positioning
position: absolute removes element from normal flow and positions it relative to the nearest positioned ancestor
position: relative keeps element in normal flow but allows for positioning relative to its normal position
position: absolute elements are positioned relative to the nearest positioned ancestor, if none then relative to the initial containing...read more
Q5. What are the ways to create objects in JS?
There are several ways to create objects in JS, including object literals, constructor functions, and ES6 classes.
Object literals: var obj = {key1: value1, key2: value2}
Constructor functions: function Person(name, age) {this.name = name; this.age = age}; var person1 = new Person('John', 30)
ES6 classes: class Car {constructor(make, model) {this.make = make; this.model = model}}; var car1 = new Car('Toyota', 'Corolla')
Q6. What are some of the string methods in JS?
JS has various string methods to manipulate and extract information from strings.
toUpperCase() - converts string to uppercase
toLowerCase() - converts string to lowercase
charAt() - returns character at specified index
indexOf() - returns index of specified substring
slice() - extracts a section of a string
replace() - replaces specified substring with another string
split() - splits a string into an array of substrings
trim() - removes whitespace from both ends of a string
Q7. What is function currying in JS?
Function currying is a technique of transforming a function that takes multiple arguments into a sequence of functions that each take a single argument.
Currying allows partial application of a function.
It helps in creating reusable functions.
Curried functions can be composed easily.
It can be achieved using bind() or closures.
Example: const add = x => y => x + y; add(2)(3) returns 5.
Q8. What are the type of functions in JS?
JS has two types of functions: named and anonymous.
Named functions are declared with a name and can be called anywhere in the code.
Anonymous functions are declared without a name and are usually assigned to a variable.
Arrow functions are a shorthand for anonymous functions.
Higher-order functions take one or more functions as arguments or return a function as a result.
Q9. What is a dynamic import in React?
Dynamic import is a feature in React that allows loading components or modules on demand.
Used to improve performance by loading components only when needed
Implemented using the 'import()' function
Returns a Promise that resolves to the module
Can be used with React.lazy() to lazy load components
Q10. What are the new input types in HTML5?
New input types in HTML5 include color, date, email, number, range, tel, and more.
Color: Allows users to select a color.
Date: Provides a date picker for selecting dates.
Email: Ensures that the input is a valid email address.
Number: Restricts input to numeric values.
Range: Allows users to select a value within a specified range.
Tel: Ensures that the input is a valid telephone number.
Q11. What is bubbling and capturing in JS?
Bubbling and capturing are two phases of event propagation in JavaScript.
Bubbling is the default phase where the event starts from the innermost element and propagates outwards to the outermost element.
Capturing is the opposite phase where the event starts from the outermost element and propagates inwards to the innermost element.
Both phases can be used to handle events on parent and child elements.
Event.stopPropagation() can be used to stop the event from propagating further...read more
Q12. What is a z-index in CSS?
z-index is a CSS property that controls the stacking order of elements on a webpage.
z-index only works on positioned elements (position: absolute, position: relative, position: fixed, or position: sticky)
Higher z-index values stack on top of lower ones
Negative z-index values can be used to place elements behind other elements
z-index can be used to create layered effects on a webpage
Q13. What is canvas and SVGs?
Canvas and SVGs are two different ways to create graphics on the web.
Canvas is a bitmap-based drawing technology that allows for dynamic, scriptable rendering of 2D shapes and bitmap images.
SVG is a vector-based drawing technology that allows for scalable, resolution-independent graphics.
Canvas is best suited for complex, interactive graphics, while SVG is best suited for static, high-resolution graphics.
Canvas is supported by all modern browsers, while SVG has some limitatio...read more
Q14. What are forwardRefs in React?
ForwardRefs allow React components to pass refs to their children.
Used to access child component's DOM node or instance
Used with functional components
Helps in avoiding prop drilling
Can be used with React.memo for performance optimization
Top UI Frontend Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month