{"id":286692,"date":"2017-05-22T17:45:04","date_gmt":"2017-05-22T13:45:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286692"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286692","title":{"rendered":"\u0432\u044b\u043f\u0443\u0441\u043a#2: IT\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0442 \u0432\u0435\u0434\u0443\u0449\u0438\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439"},"content":{"rendered":"<p>\u041d\u0430 \u044d\u0442\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u0451\u0442 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 <b>Uber<\/b>. \u0417\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u00abEasy\u00bb \u0434\u043e \u00abHard\u00bb, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435\u043c \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u0430\u043d\u043e \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<br \/>  \u041e\u0442\u0432\u0435\u0442\u044b, \u043a\u0430\u043a \u0438 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438. \u041a\u0440\u0443\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0441\u0432\u043e\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \ud83d\ude42<\/p>\n<p>  <b>\u0412\u043e\u043f\u0440\u043e\u0441\u044b:<\/b><br \/>  1.\u041a\u0430\u043a\u0438\u0435 KPI \u0432\u044b \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u0435\u0441\u043b\u0438 \u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 Uber \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u0438\u0440\u0430 \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0437\u043d\u0430\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u0443\u0441\u043f\u0435\u0448\u0435\u043d?<\/p>\n<p>  2.\u041a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u043b\u0441\u044f? \u041c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u043b?<\/p>\n<p>  <b>\u0417\u0430\u0434\u0430\u0447\u0438:<\/b><br \/>  1. <\/p>\n<blockquote><p>Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.<br \/>  push(x) \u2014 Push element x onto stack.<br \/>  pop() \u2014 Removes the element on top of the stack.<br \/>  top() \u2014 Get the top element.<br \/>  getMin() \u2014 Retrieve the minimum element in the stack. <\/p><\/blockquote>\n<p>  <b>Example:<\/b>  <\/p>\n<pre><code>MinStack minStack = new MinStack(); minStack.push(-2); minStack.push(0); minStack.push(-3); minStack.getMin();   --&gt; Returns -3. minStack.pop(); minStack.top();  \t--&gt; Returns 0. minStack.getMin();   --&gt; Returns -2. <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a><br \/>  2. <\/p>\n<blockquote><p>Design a data structure that supports all following operations in average O(1) time.<br \/>  insert(val): Inserts an item val to the set if not already present.<br \/>  remove(val): Removes an item val from the set if present.<br \/>  getRandom: Returns a random element from current set of elements. Each element must have the same probability of being returned.<\/p><\/blockquote>\n<p>  <b>Example:<\/b>  <\/p>\n<pre><code>\/\/ Init an empty set. RandomizedSet randomSet = new RandomizedSet();   \/\/ Inserts 1 to the set. Returns true as 1 was inserted successfully. randomSet.insert(1);   \/\/ Returns false as 2 does not exist in the set. randomSet.remove(2);   \/\/ Inserts 2 to the set, returns true. Set now contains [1,2]. randomSet.insert(2);   \/\/ getRandom should return either 1 or 2 randomly. randomSet.getRandom();   \/\/ Removes 1 from the set, returns true. Set now contains [2]. randomSet.remove(1);   \/\/ 2 was already in the set, so return false. randomSet.insert(2);   \/\/ Since 2 is the only number in the set, getRandom always return 2. randomSet.getRandom(); <\/code><\/pre>\n<p>  <habracut\/><br \/>  3. <\/p>\n<blockquote><p>Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.<br \/>  Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization\/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.<br \/>  For example, you may serialize the following tree<br \/>   1<br \/>   \/ \\<br \/>   2 3<br \/>   \/ \\<br \/>   4 5<br \/>  as &quot;[1,2,3,null,null,4,5]&quot;, serializes a binary tree. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.<br \/>  Note: Do not use class member\/global\/static variables to store states. Your serialize and deserialize algorithms should be stateless.  <\/p><\/blockquote>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/329208\/\"> https:\/\/habrahabr.ru\/post\/329208\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430 \u044d\u0442\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u0451\u0442 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 <b>Uber<\/b>. \u0417\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u00abEasy\u00bb \u0434\u043e \u00abHard\u00bb, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435\u043c \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u0430\u043d\u043e \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<br \/>  \u041e\u0442\u0432\u0435\u0442\u044b, \u043a\u0430\u043a \u0438 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438. \u041a\u0440\u0443\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0441\u0432\u043e\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \ud83d\ude42<\/p>\n<p>  <b>\u0412\u043e\u043f\u0440\u043e\u0441\u044b:<\/b><br \/>  1.\u041a\u0430\u043a\u0438\u0435 KPI \u0432\u044b \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u0435\u0441\u043b\u0438 \u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 Uber \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u0438\u0440\u0430 \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0437\u043d\u0430\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u0443\u0441\u043f\u0435\u0448\u0435\u043d?<\/p>\n<p>  2.\u041a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u043b\u0441\u044f? \u041c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u043b?<\/p>\n<p>  <b>\u0417\u0430\u0434\u0430\u0447\u0438:<\/b><br \/>  1. <\/p>\n<blockquote><p>Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.<br \/>  push(x) \u2014 Push element x onto stack.<br \/>  pop() \u2014 Removes the element on top of the stack.<br \/>  top() \u2014 Get the top element.<br \/>  getMin() \u2014 Retrieve the minimum element in the stack. <\/p><\/blockquote>\n<p>  <b>Example:<\/b>  <\/p>\n<pre><code>MinStack minStack = new MinStack(); minStack.push(-2); minStack.push(0); minStack.push(-3); minStack.getMin();   --&gt; Returns -3. minStack.pop(); minStack.top();  \t--&gt; Returns 0. minStack.getMin();   --&gt; Returns -2. <\/code><\/pre>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-286692","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=286692"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286692\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}