Skip to content

Instantly share code, notes, and snippets.

@grigoriy
grigoriy / question1.md
Created October 20, 2020 16:47 — forked from thoroc/question1.md
Skyscanner HackerRank questions - Oct 2015 - Backend Developer

Find the Most Popular Destination:

Your task is to find the most popular holiday destination from a list of destinations searched for by users. You are given as standard input the integer size of the list, followed by the names of the destinations themselves. The input has the following format:

  • on the first line, the count of items in the list
  • on the subsequent lines, the name of each destination searched for, one per line (each destination is a single word with no spaces, destinations can be searched for and appear more than once) The input is correct. There is at least one destination in the input. Write a program that reads the input from stdin and then outputs out the name of the most searched for destination i.e. the destination that appears most in the list. One destination is guaranteed to be the outright winner in the input.
@grigoriy
grigoriy / scala_test_upd.md
Created May 21, 2019 18:59
Scala_test_upd.md

Тестовое задание для Scala

Написать примитивный mtproto сервер (два состояния) с помощью scodec, scalaz-zio (для хранения и обработки состояния) и java NIO 2 (TCP).

Сервер должен уметь выполнять первые 2 команды при инициализации DH-сессии: req_pq и req_DH_params.

На req_pq отдает res_pq со случайными данными и ждет req_DH_params на который закрывает коннект.

Валидация не нужна, используйте random данные и игнорируйте правила в документации какие значения полей должны быть. Проект нужен только как демонстрация scalaz-zio + nio2 + scodec.

@grigoriy
grigoriy / keytool_new_alias.sh
Last active February 14, 2020 15:53
Duplicate a key creating new alias in a jks keystore using keytool.
keytool -keyclone -alias 'old-alias' -dest 'new-alias' -keypass 'old_keypass' -new 'new_keypass' -keystore '/path/to/keystore' -storepass 'storepass'