Amdocs
10+ Dr. Mar Theophilus School Interview Questions and Answers
Q1. Sort Array Problem Statement
Given an array consisting of 'N' positive integers where each integer is either 0, 1, or 2, your task is to sort the given array in non-decreasing order.
Input:
Each input starts wi...read more
Sort an array of 0s, 1s, and 2s in non-decreasing order.
Use a counting sort algorithm to count the occurrences of 0s, 1s, and 2s in the array.
Then reconstruct the array by placing the counted elements in order.
Time complexity of the counting sort algorithm is O(N).
Q2. Swap Two Numbers Problem Statement
Given two integers a
and b
, your task is to swap these numbers and output the swapped values.
Input:
The first line contains a single integer 't', representing the number of t...read more
Swap two numbers 'a' and 'b' and output the swapped values.
Create a temporary variable to store one of the numbers before swapping
Assign the value of 'a' to 'b' and the temporary variable to 'a'
Output the swapped values as 'b' followed by 'a'
Components in React go through various stages like mounting, updating, and unmounting.
Components are created and inserted into the DOM during the mounting phase.
During the updating phase, components can re-render due to changes in props or state.
Components are removed from the DOM during the unmounting phase.
Lifecycle methods like componentDidMount, componentDidUpdate, and componentWillUnmount are used to perform actions at different stages.
HTML5 is the latest version of the HTML standard with new features for web development.
Support for multimedia elements like <video> and <audio>
Canvas and SVG for graphics and animations
Improved form controls and validation
Offline storage capabilities with Local Storage and IndexedDB
Geolocation API for location-based services
Prototype chaining in JavaScript is the mechanism by which objects inherit properties and methods from other objects.
In JavaScript, each object has a prototype property, which points to another object. When a property or method is accessed on an object, JavaScript will look for it in the object itself first, and then in its prototype chain.
If the property or method is not found in the object, JavaScript will continue to look up the prototype chain until it finds the property ...read more
Promises are objects representing the eventual completion or failure of an asynchronous operation.
Promises have three states: pending, fulfilled, and rejected.
Pending: initial state, neither fulfilled nor rejected.
Fulfilled: operation completed successfully.
Rejected: operation failed.
Promises can be chained using .then() to handle success and failure.
Example: const promise = new Promise((resolve, reject) => { ... });
The CSS Box Model is a fundamental concept in CSS that defines the layout and spacing of elements on a webpage.
The Box Model consists of content, padding, border, and margin.
Content: The actual content of the box, such as text or images.
Padding: Space between the content and the border.
Border: The border surrounding the padding and content.
Margin: Space outside the border, separating the element from other elements.
Example: div { width: 200px; padding: 20px; border: 1px solid...read more
Media elements in HTML are used to embed audio and video content on a webpage.
Media elements include <audio> and <video> tags in HTML.
They allow for the playback of audio and video files directly on a webpage.
Attributes like src, controls, autoplay, and loop can be used to customize the behavior of media elements.
Example: <video src='video.mp4' controls></video>
Same-origin policy is a security measure in web browsers that restricts how a document or script loaded from one origin can interact with a resource from another origin.
It prevents a web page from making requests to a different domain than the one it was loaded from.
It helps protect user data and prevent malicious attacks like cross-site scripting (XSS).
Cross-origin resource sharing (CORS) headers can be used to relax the same-origin policy in certain situations.
Callbacks in JavaScript are functions passed as arguments to other functions, to be executed later.
Callbacks are commonly used in asynchronous operations, such as event handling or AJAX requests.
They allow for more flexible and dynamic programming, by defining behavior that should happen after a certain event or task is completed.
Example: setTimeout function in JavaScript takes a callback function as an argument to be executed after a specified time.
Top Front end Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month