This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>Authors</title> | |
| <script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
| <script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script> | |
| <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script> | |
| <script src='https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser-polyfill.min.js'></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1,2,3,5,4,6,7,8 => 1 | |
| // 4,1,2,3 => Too chaotic | |
| class Result | |
| { | |
| public static void minimumBribes(List<int> q) | |
| { | |
| bool isChaotic = false; | |
| int bribes = 0; | |
| for (int i=0; i<q.Count; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1,2,3,4,5 d=4 | |
| // 5,1,2,3,4 | |
| public static List<int> rotLeft(List<int> a, int d) | |
| { | |
| if (a != null && a.Count > 1) | |
| { | |
| List<int> b = new List<int>(); | |
| // d = 3 | |
| // 1,2,3,4,5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const largestInt = n => { | |
| const digits = []; | |
| // Extract digits. | |
| while (n) { | |
| const digit = n % 10; | |
| digits.push(digit); | |
| n = Math.floor(n / 10); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Given two sorted lists, merge the lists together into sorted order. | |
| Example: [1,3,20] and [2,5,10,15] => [1,2,3,5,10,15,20] | |
| https://jdoodle.com/ia/ez4 | |
| */ | |
| public class MergeSorted | |
| { | |
| private Node head, tail; | |
| public MergeSorted() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum DepartmentType { | |
| Engineering, | |
| Data, | |
| HR, | |
| CustomerService | |
| } | |
| class IdGenerator { | |
| static _id: number = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Using dynamic programming. | |
| var twoSumDp = function (nums, target, i, n, indices) { | |
| n = n === undefined ? 0 : n; | |
| i = i === undefined ? nums.length - 1 : i; | |
| indices = indices === undefined ? [] : indices; | |
| if (i < 0) { | |
| // We ran out of values. | |
| return { n, indices }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. | |
| Question 1 | |
| In 5 years you are going to get $2,000. | |
| If interest rates unexpectedly rise, the present value of that future amount to | |
| you would | |
| 1 point | |
| ### Fall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. | |
| Question 1 | |
| Stock A has a beta of 0.8, whereas stock B has a beta of 1.5. Which one of these stocks would you recommend to a very risk-averse investor? | |
| 1 point | |
| ### Stock A | |
| Stock B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| What happens to a firm’s WACC if the firm’s tax rate increases? | |
| 1 / 1 point | |
| WACC increases | |
| ### WACC decreases | |