Add office photos
Engaged Employer

Amdocs

3.7
based on 4k Reviews
Video summary
Filter interviews by

10+ Dr. Mar Theophilus School Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

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
Ans.

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).

Add your answer

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
Ans.

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'

Add your answer
Q3. Can you explain the lifecycle of components in React?
Ans.

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.

Add your answer
Q4. What are the features of HTML5?
Ans.

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

Add your answer
Discover Dr. Mar Theophilus School interview dos and don'ts from real experiences
Q5. What is prototype chaining in JavaScript?
Ans.

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

Add your answer
Q6. Can you explain promises and their three states?
Ans.

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) => { ... });

Add your answer
Q7. Can you explain the CSS Box Model?
Ans.

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

Add your answer
Q8. What are media elements in HTML?
Ans.

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>

Add your answer
Q9. What is the Same-origin policy?
Ans.

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.

Add your answer
Q10. What are callbacks in JavaScript?
Ans.

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.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Front end Developer Interview Questions from Similar Companies

3.7
 • 22 Interview Questions
3.5
 • 14 Interview Questions
3.7
 • 13 Interview Questions
3.6
 • 12 Interview Questions
3.5
 • 11 Interview Questions
3.5
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
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