Sollicitatiegesprek voor de functie IOS Developer


Implement the MyStack. (A lot of questions about multi-threading) @protocol Stack -(void)pushObject:(nonnull id)obj; -(nonnull id)popObjext; @property(nonatomic,assign)NSInteger count; @end @interface MyStack : NSObject <Stack> @end @implementation MyStack @end


Antwoorden op sollicitatievragen

4 antwoorden


Did you have any system design questions?

Anoniem op


Can you give me an example what you mean? Stack is considered as System Design?

Anoniem op


You interviewed in person at booking? What kind of technical questions did you face? Could you give some details.

Annonymous op


@protocol Stack -(void)pushObject:(nonnull id)obj; -(nonnull id)popObject; @property(nonatomic,assign) NSInteger count; @end @interface MyStack : NSObject @property (nonatomic, strong) NSMutableArray *contents; @end @implementation MyStack @synthesize count; - (id)init { if (self = [super init]) { self.contents = [NSMutableArray array]; } return self; } - (NSInteger)count { return self.contents.count; } - (void)pushObject:(nonnull id)obj { if(obj) { [self.contents addObject:obj]; } } - (nonnull id)popObject { if ([self.contents count] > 0) { id lastObj = [self.contents lastObject]; [self.contents removeLastObject]; return lastObj; } return [NSNumber numberWithInteger:-1]; } - (void)print { for (id obj in self.contents) { NSLog(@"%ld",(long)[(NSNumber*)obj integerValue]); } } @end

Khawaja Farooq op

Voeg antwoorden of opmerkingen toe

Meld u aan of registreer u om hier een opmerking over te maken.