Posts

Showing posts from February 23, 2019

President of the Republic of China

Image
For the president of the People's Republic of China, see President of the People's Republic of China. President of the Republic of China .mw-parser-output .nobold{font-weight:normal} 中華民國總統 Presidential Seal Presidential Standard Incumbent Tsai Ing-wen since 20 May 2016  ( 2016-05-20 ) Style Her Excellency ( 閣下 ) Residence Yonghe Residence Seat Presidential Palace, Nanking (1947–1949) Presidential Office Building, Taipei (1949–present) Appointer Direct election Term length Two consecutive 4-year terms Section 6 of Article 2 of the Additional Articles of the Constitution of the Republic of China Constituting instrument Constitution of the Republic of China Formation 1 January 1912  ( 1912-01-01 ) as the Provisional President 10 October 1913  ( 1913-10-10 ) as the President (Peiyang Government) 10 October 1928  ( 1928-10-10 ) as the Chairman of the Nationalist Government 20 May 1948  ( 1948-05-20 ) as the Pr...

How to design a Calendar

Image
0 It is an OOD question. Design a calendar. The requirement are: add event delete an event get all events for a particular day Justify the data structure and design test cases I know that I need to provide the APIs like addEvent(), deleteEvent(), getEventByDay() I stuck at the first API, add an event. I have proposed two solutions, I just do not know which pattern is better and why. version1: public class Calender { // helper class public static class Event { String name; Event(String s) { name = s; } } Calender() { } // API public void addEvent(Event e) { // todo } // driver function public static void main(String args) { Calender calender = new Calender(); Event event = new E...