Add office photos
Engaged Employer

Synopsys

3.9
based on 331 Reviews
Filter interviews by

10+ Twinkle Stars School Interview Questions and Answers

Updated 10 Sep 2024
Popular Designations

Q1. you will be given dimensions of a bigger rectangle and smaller rectangle,derive a formula to get how many smaller rectangles fit into the bigger rectangle

Ans.

Derive a formula to determine how many smaller rectangles fit into a bigger rectangle given their dimensions.

  • Calculate the number of times the smaller rectangle can fit into the bigger rectangle horizontally and vertically

  • Divide the width of the bigger rectangle by the width of the smaller rectangle to get the horizontal count

  • Divide the height of the bigger rectangle by the height of the smaller rectangle to get the vertical count

  • Multiply the horizontal and vertical counts to...read more

View 2 more answers

Q2. what will be the new coordinates of a rectangle points if rectangle length and breadth is scaled and write a program to calculate the coordinates of corner points of scaled rectangle

Ans.

Answering how to calculate new coordinates of a scaled rectangle and providing a program for it.

  • To calculate new coordinates, multiply the original coordinates by the scaling factor

  • Scaling factor can be calculated by dividing the new length/breadth by the original length/breadth

  • Program can take input of original coordinates, scaling factor, and output new coordinates

  • Example: Original coordinates: (0,0), (0,5), (5,5), (5,0). Scaling factor: 2. New coordinates: (0,0), (0,10), (...read more

Add your answer

Q3. How many points are required to draw a rectangle

Ans.

At least 4 points are required to draw a rectangle.

  • A rectangle has 4 sides and 4 corners, so at least 4 points are needed to define those corners.

  • The points must be arranged in a specific order to form a closed shape with 4 sides.

  • Additional points can be used to add details or modify the shape of the rectangle.

  • The number of points required may vary depending on the software or tool used to draw the rectangle.

Add your answer

Q4. where is it necessary to use references

Ans.

References are necessary when passing large objects to functions or when returning objects from functions.

  • When passing large objects to functions

  • When returning objects from functions

  • When working with complex data structures

  • When implementing operator overloading

  • When working with polymorphism

View 1 answer
Discover Twinkle Stars School interview dos and don'ts from real experiences

Q5. where to declare const pointers

Ans.

Const pointers should be declared in the same scope as the variable they point to.

  • Declaring const pointers in the same scope as the variable they point to ensures that the pointer cannot be used to modify the variable.

  • If the pointer is only used within a function, it should be declared within that function.

  • If the pointer is used across multiple functions, it should be declared in a header file or at the top of the source file.

  • Examples: const int* ptr = &variable; const MyClas...read more

Add your answer

Q6. 1.given a large rectangle

Ans.

Need more context. What needs to be done with the large rectangle?

  • What are the dimensions of the rectangle?

  • Is it a 2D or 3D object?

  • What is the context of the problem?

  • Are there any constraints or limitations?

  • What tools or programming languages can be used?

Add your answer

Q7. Identify if the number is positive, negative or zero

Ans.

Identify if a number is positive, negative, or zero

  • Check if the number is greater than 0 to determine if it is positive

  • Check if the number is less than 0 to determine if it is negative

  • If the number is neither greater nor less than 0, it is zero

Add your answer

Q8. References vs pointers

Ans.

References and pointers are both used to refer to memory locations, but references cannot be null and cannot be reseated.

  • Pointers can be null or uninitialized

  • Pointers can be reseated to point to a different memory location

  • References are automatically dereferenced

  • References cannot be used with arrays

  • Pointers can be used with arrays

Add your answer

Q9. Copy constructor with pointers

Ans.

Copy constructor with pointers creates a new object by copying the values of the existing object's pointers.

  • Copy constructor is used to create a new object from an existing object.

  • Pointers in the new object point to the same memory locations as the original object.

  • Deep copy should be used to avoid shallow copy issues.

Add your answer

Q10. new vs malloc

Ans.

new and malloc are used for dynamic memory allocation in C++ and C respectively.

  • new is an operator in C++ while malloc is a function in C.

  • new automatically calls the constructor while malloc does not.

  • new returns a pointer to the object while malloc returns a void pointer.

  • new throws an exception if allocation fails while malloc returns NULL.

  • new can be overloaded while malloc cannot be.

  • new and delete are used together while malloc and free are used together.

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 Software Engineer Interview Questions from Similar Companies

3.9
 • 44 Interview Questions
3.7
 • 20 Interview Questions
3.8
 • 18 Interview Questions
3.6
 • 13 Interview Questions
3.3
 • 10 Interview Questions
3.9
 • 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
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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