Skip to content

Instantly share code, notes, and snippets.

@vnmtwo
Last active January 24, 2022 22:10
Show Gist options
  • Save vnmtwo/0e3e98faf87a54782e05e959cfc1de69 to your computer and use it in GitHub Desktop.
Save vnmtwo/0e3e98faf87a54782e05e959cfc1de69 to your computer and use it in GitHub Desktop.
2 questions from preinterview 2

T: Напишите на C# библиотеку для поставки внешним клиентам, которая умеет вычислять площадь круга по радиусу и треугольника по трем сторонам. Дополнительно к работоспособности оценим:

  • Юнит-тесты
  • Легкость добавления других фигур
  • Вычисление площади фигуры без знания типа фигуры в compile-time
  • Проверку на то, является ли треугольник прямоугольным

T: Write a C# library for delivery to external clients that can calculate the area of a circle from its radius and a triangle from three sides. In addition to performance, we evaluate:

  • Unit-tests
  • Easy to add other shapes
  • Calculate the area of a figure without knowing the type of figure in compile-time
  • Checking if a triangle is a right triangle

see https://github.com/vnmtwo/AreaCalculator

T: Задание не записал, восстанавливаю по памяти:
В базе данных MSSQL хранятся продукты и категории продуктов.
Одному продукту может соответствовать несколько категорий, одной категории может соответствовать несколько продуктов. Напишите запрос к БД, который выводит все продукты с соответствующими ему категориями. Если продукт не имеет категории, он все равно должен быть выведен.

T: I did not write the task, I restore it from memory:
The MSSQL database stores products and product categories. Several categories can correspond to one product, and several products can correspond to one category. Write a database query that returns all products with their categories. If a product does not have a category, it should still be displayed.

SELECT ProductName, CategoryName
FROM products LEFT OUTER JOIN pc
ON pc.ProductID=products.ProductID
LEFT OUTER JOIN categories
ON categories.CategoryID=pc.CategoryID

http://sqlfiddle.com/#!18/0ebb6/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment