Posts

Showing posts from December 23, 2018

Rio Volga

Image
  Nota: Se procura por outras acepções, veja Volga (desambiguação). Coordenadas: 46° 44' N, 47° 51' O Rio Volga O rio Volga em Ulyanovsk Mapa da bacia hidrográfica do Volga Localização Continente Europa País  Rússia Parte de Unified Deep Water System of European Russia  ( en ) Coordenadas 57° 15′ 05″ N, 32° 28′ 05″ L Dimensões Comprimento 3 688 km Posição: 16 Hidrografia Tipo Rio Bacia hidrográfica Volga Basin Área da bacia 1 360 000 km 2 Nascente Valdai Altitude da nascente 225 m Afluentes principais Vetluga River  ( en ) , Rio Kama, Rio Oka, Rio Sura, Bezdna River  ( en ) , Rio Unzha, Rio Samara, Rio Akhtuba, Rio Kazanka, Sviyaga River  ( en ) , Kerzhenets River  ( en ) , Kostroma River  ( en ) , Kotorosl River  ( en ) , Sheksna  ( en ) , Mologa River  ( en ) , Kashinka River  ( en ) , Nerl River  ( en ) , Medveditsa River  ( en ) , Dubna River  ( en ) , Tvertsa River  ( en ) , Vazuza ...

Design a object oriented parking lot

Image
0 I solved this system design interview question. The problem description Constraints and assumptions What types of vehicles should we support? Motorcycle, Car, Bus Does each vehicle type take up a different amount of parking spots? Yes Motorcycle spot -> Motorcycle Compact spot -> Motorcycle, Car Large spot -> Motorcycle, Car Bus can park if we have 5 consecutive "large" spots Does the parking lot have multiple levels? Yes To make the solution more adaptable to future business rules I decided to represent the parking space required for each vehicle type as a continuous set of parking spots. To keep track of the continuous set of parking spots and their types I used a sorted set to find a particular range of parking spots and also...